vlan间的路由
2个交换机,3个路由器,其中2个模拟PC。
拓扑: R1 E0--F0/1 SW1 F0/15---F0/15 SW2 F0/2 ---R2
SW2 F0/3---R3 R2,R3 模拟PC
R1
Router>
Router>en
Router#conf t
Router(config)#hos r1
r1(config)#int e0/0
r1(config-if)#ip add 192.168.100.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#ip add 1.1.1.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#exit
r1(config)#^Z
R2
Router>
Router>en
Router#conf t
Router(config)#no ip routing
Router(config)#hos Pc1
Pc1(config)#int e0/0
Pc1(config-if)#ip add 192.168.1.2 255.255.255.0
Pc1(config-if)#no sh
Pc1(config-if)#exit
Pc1(config)#ip default-gateway 192.168.1.1
Pc1(config)#^Z
pc1#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
R3
Router>
Router>en
Router#conf t
Router(config)#hos pc2
pc2(config)#no ip routing
pc2(config)#int e0/0
pc2(config-if)#ip add 192.168.2.2 255.255.255.0
pc2(config-if)#no sh
pc2(config-if)#exit
pc2(config)#ip default-gateway 192.168.2.1
pc2(config)#exit
pc2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
SW1
Router>en
Router#
Router#conf t
Router(config)#hos sw1
sw1(config)#ip routing
sw1(config)#int f0/1
sw1(config-if)#no switchport #开启3层交换
sw1(config-if)#exit
sw1(config)#exit
sw1#vlan database
sw1(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
sw1(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#conf t
Sw1(config)#int f0/15
sw1(config-if)#switchport trunk encapsulation dot1q
sw1(config-if)#switchport mode trunk
sw1(config-if)#no sh
sw1(config)#no cdp run
sw1(config)#int vlan 2
sw1(config-if)#ip add 192.168.1.1 255.255.255.0
sw1(config-if)#no sh
sw1(config-if)#int vlan 3
sw1(config-if)#ip add 192.168.2.1 255.255.255.0
sw1(config-if)#no sh
sw1(config-if)#exit
sw1(config)#^Z
sw1#
SW2
Router>
Router>en
Router#conf t
Router(config)#hos sw2
sw2#vlan database
sw2(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
sw2(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
sw2(vlan)#exit
APPLY completed.
Exiting....
sw2#
sw2#conf t
sw2(config)#no cdp run
sw2(config)#int f0/2
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 2
sw2(config-if)#no sh
sw2(config-if)#int f0/3
Sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 3
sw2(config-if)#no sh
sw2(config-if)#int f0/15
sw2(config-if)#switchport trunk encapsulation dot1q
sw2(config-if)#switchport mode trunk
sw2(config-if)#no sh
sw2(config-if)#exit
sw2(config)#^Z
阅读(1115) | 评论(0) | 转发(0) |