实战多层交换vlan间路由。有详细的配置
vlan间路由实验
3550配置:
3550配置:
vlan database
vlan 2 name 2
vlan 3 name 3
vtp domain cisco (与其他交换机域名要一致)
vtp mode server
vlan 2 name 2
vlan 3 name 3
vtp domain cisco (与其他交换机域名要一致)
vtp mode server
int f0/1
switchport trunk encasulation dot1q (以dot1q封装trunk)
switchport mode trunk (连接交换机之间的接口用trunk)
int f0/2
switchport trunk encasulation dot1q
switchport mode trunk
switchport trunk encasulation dot1q (以dot1q封装trunk)
switchport mode trunk (连接交换机之间的接口用trunk)
int f0/2
switchport trunk encasulation dot1q
switchport mode trunk
int vlan 2
ip address 192.168.2.1 255.255.255.0 (vlan 2的管理ip,做vlan 2 pc 的网关)
no shut
int vlan 3
ip address 192.168.3.1 255.255.255.0 (做vlan 3 pc 的网关)
no shut
ip address 192.168.2.1 255.255.255.0 (vlan 2的管理ip,做vlan 2 pc 的网关)
no shut
int vlan 3
ip address 192.168.3.1 255.255.255.0 (做vlan 3 pc 的网关)
no shut
ip routing (开启多层交换机的路由功能)
2950(a)配置
vlan database
vtp domain cisco
vtp domain cisco
int f0/1
switchport mode trunk
int f0/5
switchport mode access
switchport access vlan 2 (定义交换机接口5属于vlan 2)
switchport mode trunk
int f0/5
switchport mode access
switchport access vlan 2 (定义交换机接口5属于vlan 2)
2950(b)配置
vlan database
vtp domain cisco
vtp domain cisco
int f0/1
switchport mode trunk
int f0/5
switchport mode access
switchport access vlan 3
switchport mode trunk
int f0/5
switchport mode access
switchport access vlan 3
pc1
ip address:192.168.2.2/24
gateway:192.168.2.1
ip address:192.168.2.2/24
gateway:192.168.2.1
pc2
ip address:192.168.3.2/24
gateway:192.168.3.1
ip address:192.168.3.2/24
gateway:192.168.3.1
实验尝试过是成功的。
在交换机3550里show ip route能够看到192.168.2.0/24及192.168.3.0/24两条路由。pc1能够ping通pc2。
在交换机3550里show ip route能够看到192.168.2.0/24及192.168.3.0/24两条路由。pc1能够ping通pc2。
转载于:https://blog.51cto.com/cyangoog/554656