目的:PC1 连通三层交换机LSW1
LSW1配置
bash
[Huawei]vlan batch 10
[Huawei]interface Vlanif 10
[Huawei-Vlanif10]ip address 10.10.10.10 24
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
LSW2配置
bash
[Huawei]vlan batch 10
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 10
PC1
bash
10.10.10.1
255.255.255.0
10.10.10.10
bash
PC>ping 10.10.10.10
Ping 10.10.10.10: 32 data bytes, Press Ctrl_C to break
From 10.10.10.10: bytes=32 seq=1 ttl=255 time=62 ms
From 10.10.10.10: bytes=32 seq=2 ttl=255 time=63 ms
From 10.10.10.10: bytes=32 seq=3 ttl=255 time=31 ms
From 10.10.10.10: bytes=32 seq=4 ttl=255 time=63 ms
From 10.10.10.10: bytes=32 seq=5 ttl=255 time=46 ms
--- 10.10.10.10 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/53/63 ms