多交换机实现全网互通
实验目的
理解交换机接口的使用
理解三层交换机和二层交换机的数据转发
理解三层交换机的路由功能
理解VLAN的划分
如何实现不同VLAN之间互通
利用OSPF实现两个区域互通
实验拓扑
二层交换机与PC相连使用access接口
二层交换机与三层交换机相连使用trunk接口
三层交换机与三层交换机相连使用trunk接口
该实验核心层也可以使用rip路由协议,感兴趣的小伙伴可以试一试,我们此次实验使用的是OSPF路由协议
SW1-2:
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW2-2:
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW3-2:
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
ip address 192.168.20.254 255.255.255.0
#
interface Vlanif100
ip address 192.168.12.1 255.255.255.252
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW1-1-1:
interface Ethernet0/0/1
port link-type access
port default vlan 30
#
interface Ethernet0/0/2
port link-type access
port default vlan 40
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW2-1-1:
interface Ethernet0/0/1
port link-type access
port default vlan 40
#
interface Ethernet0/0/2
port link-type access
port default vlan 50
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW3-1-1:
interface Vlanif30
ip address 192.168.30.254 255.255.255.0
#
interface Vlanif40
ip address 192.168.40.254 255.255.255.0
#
interface Vlanif50
ip address 192.168.50.254 255.255.255.0
#
interface Vlanif200
ip address 192.168.13.1 255.255.255.252
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
SW4-1:
interface Vlanif100
ip address 192.168.12.2 255.255.255.252
#
interface Vlanif200
ip address 192.168.13.2 255.255.255.252
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
交换机配置OSPF:设备名称与拓扑图一样,路由表中设备名称与拓扑图名称不一致,但是同一设备
SW3-2:
ospf 1
area 0.0.0.0
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 192.168.12.0 0.0.0.3
SW3-1-1:
ospf 1
area 0.0.0.0
network 192.168.13.0 0.0.0.3
network 192.168.30.0 0.0.0.255
network 192.168.40.0 0.0.0.255
network 192.168.50.0 0.0.0.255
SW4-1:
ospf 1
area 0.0.0.0
network 192.168.12.0 0.0.0.3
network 192.168.13.0 0.0.0.3
都配置完成后,ping一下
可以看到,实现了全网互通
实验结束
备注:如有错误,请谅解!
此文章为本人学习笔记,仅供参考!如有重复!!!请联系本人!