实现PC2 可以ping PC5 但是不能ping PC2
PC3可以ping PC4 但是不能ping PC5
PC2 IP:1.1.1.10
GW:1.1.1.1
PC3 IP:1.1.1.20
GW:1.1.1.1
PC4 IP:2.2.2.10
GW:2.2.2.2
PC5 IP:2.2.2.20
GW:2.2.2.2
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 1.1.1.1 255.0.0.0
Router(config-if)#no sh
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#ip add 2.2.2.2 255.0.0.0
Router(config-if)#no sh
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#access-list 100 deny ip host 1.1.1.10 host 2.2.2.10
Router(config)#access-list 100 deny ip host 1.1.1.20 host 2.2.2.20
Router(config)#access-list 100 deny ip host 2.2.2.10 host 1.1.1.10
Router(config)#access-list 100 deny ip host 2.2.2.20 host 1.1.1.20
Router(config)#access-list 100 permit ip any any
//启用ACL
Int f0/0
Ip access-group 100 in
来源:CSDN
作者:研途路
链接:https://blog.csdn.net/LPVeneno/article/details/53728596