#进入逻辑接口,配置IP地址[R1]int GigabitEthernet 0/0/0.10
[R1-GigabitEthernet0/0/0.10]ip address 192.168.1.254 24#去掉数据包的VLAN10标签,数据出去打上TAG10标签[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10#开启ARP广播[R1-GigabitEthernet0/0/0.10]arp broadcast enable[R1-GigabitEthernet0/0/0.10]int g0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20[R1-GigabitEthernet0/0/0.20]arp broadcast enable
测试:
PC1
PC>ping 192.168.2.1
Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
From 192.168.2.1: bytes=32seq=3ttl=127time=78 ms
From 192.168.2.1: bytes=32seq=4ttl=127time=78 ms
From 192.168.2.1: bytes=32seq=5ttl=127time=78 ms
--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max =0/78/78 ms
PC2
PC>ping 192.168.1.1
Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: bytes=32seq=1ttl=127time=63 ms
From 192.168.1.1: bytes=32seq=2ttl=127time=94 ms
From 192.168.1.1: bytes=32seq=3ttl=127time=78 ms
From 192.168.1.1: bytes=32seq=4ttl=127time=63 ms
From 192.168.1.1: bytes=32seq=5ttl=127time=78 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max =63/75/94 ms
PC>ping 192.168.2.1
Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.1: bytes=32seq=2ttl=127time=94 ms
From 192.168.2.1: bytes=32seq=3ttl=127time=94 ms
From 192.168.2.1: bytes=32seq=4ttl=127time=94 ms
From 192.168.2.1: bytes=32seq=5ttl=127time=94 ms
--- 192.168.2.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max =0/94/94 ms