2010年8月8日

跨Vlan Lab實作二 (Router on a stick)



Router的設定
R1#config t
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface fa0/0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface fa0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 10.0.0.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface fa0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 20.0.0.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface fa0/0.30
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip address 30.0.0.1 255.255.255.0
R1(config-subif)#exit
R1(config)#end

R1#show ip int brief
Interface IP-Address OK? Method Status Prot ocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/0.10 10.0.0.1 YES manual up up
FastEthernet0/0.20 20.0.0.1 YES manual up up
FastEthernet0/0.30 30.0.0.1 YES manual up up
R1#wr

重要:每台Switch上面都需先有Vlan 10、20、30的資料
Trunk port上面才會轉送Vlan 10、20、30的封包
(Trunk port只會轉送Vlan database裡面有的Vlan封包)

SW_A的設定
SW_A(config)#line console 0
SW_A(config-line)#exec-timeout 0 0
SW_A(config-line)#logging synchronous
SW_A(config-line)#exit
SW_A(config)#exit
SW_A#vlan database
SW_A(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
SW_A(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
SW_A(vlan)#vlan 30
VLAN 30 added:
Name: VLAN0030
SW_A(vlan)#exit
SW_A#configure t
Enter configuration commands, one per line. End with CNTL/Z.
SW_A(config)#interface fa0/0
SW_A(config-if)#switchport mode trunk
SW_A(config-if)#switchport trunk encapsulation dot1q
SW_A(config-if)#no shut
SW_A(config-if)#exit
SW_A(config)#int
SW_A(config)#interface fa0/10
SW_A(config-if)#switchport mode access
SW_A(config-if)#switchport access vlan 10
SW_A(config-if)#no shutdown
SW_A(config-if)#exit
SW_A(config)#interface fa0/15
SW_A(config-if)#switchport mode access
SW_A(config-if)#switchport access vlan 20
SW_A(config-if)#no shutdown
SW_A(config-if)#exit
SW_A(config)#int
SW_A(config)#interface range fa0/13 - 14
SW_A(config-if-range)#switchport mode trunk
SW_A(config-if-range)#switchport trunk encapsulation dot1q
SW_A(config-if-range)#no shutdown
SW_A(config-if-range)#exit
SW_A(config)#exit
SW_A#wr

SW_B的設定
SW_B#config t
SW_B(config)#line console 0
SW_B(config-line)#exec-t
SW_B(config-line)#exec-timeout 0 0
SW_B(config-line)#lin
SW_B(config-line)#loggg
SW_B(config-line)#log
SW_B(config-line)#logg
SW_B(config-line)#logging sysc
SW_B(config-line)#logging sys
SW_B(config-line)#logging sy
SW_B(config-line)#logging synchronous
SW_B(config-line)#exit
SW_B(config)#exit
SW_B#vlan database
SW_B(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
SW_B(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
SW_B(vlan)#vlan 30
VLAN 30 added:
Name: VLAN0030
SW_B(vlan)#exit
SW_B#configure t
Enter configuration commands, one per line. End with CNTL/Z.
SW_B(config)#interface range fa0/3 - 4
SW_B(config-if-range)#switchport mode trunk
SW_B(config-if-range)#switchport trunk encapsulation dot1q
SW_B(config-if-range)#no shutdown
SW_B(config-if-range)#exit
SW_B(config)#interface range fa0/13 - 14
SW_B(config-if-range)#switchport mode trunk
SW_B(config-if-range)#switchport trunk encapsulation dot1q
SW_B(config-if-range)#no shutdown
SW_B(config-if-range)#exit
SW_B(config)#interface fa0/10
SW_B(config-if)#switchport mode access
SW_B(config-if)#switchport access vlan 10
SW_B(config-if)#no shutdown
SW_B(config-if)#exit
SW_B(config)#interface fa0/15
SW_B(config-if)#switchport mode access
SW_B(config-if)#switchport access vlan 30
SW_B(config-if)#no shutdown
SW_B(config-if)#exit
SW_B(config)#exit
SW_B#wr

SW_C的設定
SW_C#configure t
SW_C(config)#line console 0
SW_C(config-line)#exec-timeout 0 0
SW_C(config-line)#logging synchronous
SW_C(config-line)#end
SW_C#vlan database
SW_C(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
SW_C(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
SW_C(vlan)#vlan 30
VLAN 30 added:
Name: VLAN0030
SW_C(vlan)#exit
SW_C#configure t
SW_C(config)#interface range fa0/3 - 4
SW_C(config-if-range)#switchport mode trunk
SW_C(config-if-range)#switchport trunk encapsulation dot1q
SW_C(config-if-range)#no shutdown
SW_C(config-if-range)#exit
SW_C(config)#interface fa0/10
SW_C(config-if)#switchport mode access
SW_C(config-if)#switchport access vlan 20
SW_C(config-if)#exit
SW_C(config-if)#interface fa0/15
SW_C(config-if)#switchport mode access
SW_C(config-if)#switchport access vlan 30
SW_C(config-if)#no shutdown
SW_C(config-if)#exit
SW_C(config)#exit
SW_C#wr

最後再測試是否有Ping 通

0 回應:

Copyright © 2009 New Life in Taipei All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.