三层交换配置路由实现全网互通

我只是一个虾纸丫 提交于 2019-12-04 00:20:44

实验拓扑

 实验步骤

[sw1]vlan batch 2 3
[sw1]interface Ethernet 0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 2

 

[sw1]interface Ethernet0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2

 

[sw1]interface Ethernet0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3

 

[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all

 

[sw2]vlan batch 4 5
[sw2]interface Ethernet 0/0/1
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port default vlan 4

 

[sw2]interface Ethernet 0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 5

 

[sw2]interface GigabitEthernet 0/0/2
[sw2-GigabitEthernet0/0/2]port link-type trunk
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan all

 

[sw3]vlan batch 2 to 5
[sw3]interface GigabitEthernet 0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan all

 

[sw3]interface GigabitEthernet 0/0/2
[sw3-GigabitEthernet0/0/2]port link-type trunk
[sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan all

 

[sw3]interface Vlanif 2
[sw3-Vlanif2]ip address 192.168.1.254 24
[sw3-Vlanif2]undo shutdown

 

[sw3]interface Vlanif 3
[sw3-Vlanif3]ip address 192.168.2.254 24
[sw3-Vlanif3]undo shutdown

 

[sw3]interface Vlanif 4
[sw3-Vlanif4]ip address 192.168.3.254 24
[sw3-Vlanif4]undo shutdown

 

[sw3]interface Vlanif 5
[sw3-Vlanif5]ip address 192.168.4.254 24
[sw3-Vlanif5]undo shutdown

 


[sw3]vlan 6
[sw3]interface GigabitEthernet 0/0/3
[sw3-GigabitEthernet0/0/3]port link-type access
[sw3-GigabitEthernet0/0/3]port default vlan 6

 

[sw3]interface Vlanif 6
[sw3-Vlanif6]ip address 192.168.5.1 24
[sw3-Vlanif6]undo shutdown

 

[sw3]ip route-static 192.168.6.254 255.255.255.0 192.168.5.2

 

[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 192.168.5.2 24
[AR1-GigabitEthernet0/0/0]undo shutdown


[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 192.168.6.254 24
[AR1-GigabitEthernet0/0/1]undo shutdown
[AR1]ip route-static 0.0.0.0 0.0.0.0 192.168.5.1

 

 

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!