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

实验拓扑

三层交换配置路由实现全网互通_第1张图片

 实验步骤

[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

 

 

 

 

你可能感兴趣的:(华为网络设备配置技术)