#进入逻辑接口,配置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.1Ping 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) transmitted3 packet(s) received40.00% packet lossround-trip min/avg/max =0/78/78 ms
PC2
PC>ping 192.168.1.1Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max =63/75/94 ms
PC>ping 192.168.2.1Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max =0/94/94 ms
目录 定义接口隔离原则与单一职责原则示例 定义
接口隔离原则,全称为 Interface Segregation Principle,缩写ISP。
原始定义:Clients should not be forced to depend upon interfaces that they don’t use。 翻译: 不应该强行…