【实验拓扑】
【实验要求】
实现跨网段互通
【实验配置】
SW1:system-view
[SW1]vlan batch 100 200
[SW1]interface Ethernet0/0/2
hxdqc/0/2]port link-type access
hxdqc/0/2]port default vlan 100
hxdqc/0/2]quit
[SW1]interface Ethernet0/0/3
hxdqc/0/3]port link-type access
hxdqc/0/3]port default vlan 100
hxdqc/0/3]quit
[SW1]interface Ethernet0/0/4
hxdqc/0/4]port link-type access
hxdqc/0/4]port default vlan 200
hxdqc/0/4]quit
[SW1]interface Ethernet0/0/5
hxdqc/0/5]port link-type access
hxdqc/0/5]port default vlan 200
hxdqc/0/5]quit
[SW1]interface Ethernet0/0/6
hxdqc/0/6]port link-type trunk
hxdqc/0/6]port trunk allow-pass vlan all
hxdqc/0/6]quit
[SW2]vlan batch 100 200
[SW2]interface Ethernet0/0/2
淡然的小白菜/0/2]port link-type access
淡然的小白菜/0/2]port default vlan 100
淡然的小白菜/0/2]quit
[SW2]interface Ethernet0/0/3
淡然的小白菜/0/3]port link-type access
淡然的小白菜/0/3]port default vlan 200
淡然的小白菜/0/3]quit
[SW2]interface Ethernet0/0/1
淡然的小白菜/0/1]port link-type trunk
淡然的小白菜/0/1]port trunk allow-pass vlan all
淡然的小白菜/0/1]quit
SW3-3L:system-view
[SW3-3L]vlan batch 10 20 30
[SW3-3L]interface GigabitEthernet 0/0/1
[SW3-3L-GigabitEthernet0/0/1]port link-type access
[SW3-3L-GigabitEthernet0/0/1]port default vlan 30
[SW3-3L-GigabitEthernet0/0/1]quit
[SW3-3L]interface GigabitEthernet 0/0/2
[SW3-3L-GigabitEthernet0/0/2]port link-type access
[SW3-3L-GigabitEthernet0/0/2]port default vlan 10
[SW3-3L-GigabitEthernet0/0/2]quit
[SW3-3L]interface GigabitEthernet 0/0/3
[SW3-3L-GigabitEthernet0/0/3]port link-type access
[SW3-3L-GigabitEthernet0/0/3]port default vlan 20
[SW3-3L-GigabitEthernet0/0/3]quit[SW3-3L]interface vlanif 10
[SW3-3L-Vlanif10]ip address 192.168.10.254 255.255.255.0
[SW3-3L-Vlanif10]undo shutdown
[SW3-3L-Vlanif10]quit
[SW3-3L]interface vlanif 20
[SW3-3L-Vlanif20]ip address 192.168.20.254 255.255.255.0
[SW3-3L-Vlanif20]undo shutdown
[SW3-3L-Vlanif20]quit
[SW3-3L]interface vlanif 30
[SW3-3L-Vlanif30]ip address 192.168.30.254 255.255.255.0
[SW3-3L-Vlanif30]undo shutdown
[SW3-3L-Vlanif30]quit
[SW3-3L]ip route-static 192.168.100.0 255.255.255.0 192.168.30.01
[SW3-3L]ip route-static 192.168.200.0 255.255.255.0 192.168.30.01R1:system-view
[R1]interface GigabitEthernet 0/0/0.1
[R1]interface GigabitEthernet 0/0/0.2
[R1]interface GigabitEthernet 0/0/1
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.30.254
【验证】PC8pingPC1