單臂路由實現不同vlan間通訊
阿新 • • 發佈:2021-01-20
單臂路由實現不同vlan間通訊
拓撲圖
PC配置
PC1 :192.168.1.1 vlan10 192.168.1.254
PC2 :192.168.2.1 vlan20 192.168.2.254
交換機配置
<Huawei>system-view [Huawei]vlan 10 [Huawei]vlan 20 [Huawei]interface Eth 0/0/2 [Huawei-Ethernet0/0/2]port link-type access [Huawei-Ethernet0/0/2]port default vlan 10 [Huawei-Ethernet0/0/2]quit [Huawei]interface Eth 0/0/3 [Huawei-Ethernet0/0/3]port link-type access [Huawei-Ethernet0/0/3]port default vlan 20 [Huawei-Ethernet0/0/3]quit [Huawei]interface Eth 0/0/1 [Huawei-Ethernet0/0/1]port link-type trunk [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all [Huawei-Ethernet0/0/1]quit
路由器配置
<Huawei>system-view [Huawei]interface Eth 0/0/0.10 [Huawei-Ethernet0/0/0.10]dot1q termination vid 10 [Huawei-Ethernet0/0/0.10]ip add 192.168.1.254 24 [Huawei-Ethernet0/0/0.10]arp broadcast enable [Huawei-Ethernet0/0/0.10]quit [Huawei]interface Eth 0/0/0.20 [Huawei-Ethernet0/0/0.20]dot1q termination vid 20 [Huawei-Ethernet0/0/0.20]ip add 192.168.2.254 24 [Huawei-Ethernet0/0/0.20]arp broadcast enable [Huawei-Ethernet0/0/0.20]quit
測試
PC>ping 192.168.2.1 Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break From 192.168.2.1: bytes=32 seq=1 ttl=127 time=172 ms From 192.168.2.1: bytes=32 seq=2 ttl=127 time=93 ms From 192.168.2.1: bytes=32 seq=3 ttl=127 time=94 ms From 192.168.2.1: bytes=32 seq=4 ttl=127 time=78 ms From 192.168.2.1: bytes=32 seq=5 ttl=127 time=78 ms --- 192.168.2.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 78/103/172 ms