路由器ACL实验详细过程讲解( 二 )


1、在R1上配置访问控制列表:
R1(config)#access-list 105 deny icmp host 192.168.1.2 host 192.168.1.1 echo-reply
R1(config)#access-list 105 permit ip any any
2、将访问控制列表应用到R1的S1/2接口:
R1(config)#int s1/2
R1(config-if)#ip access-group 105 in下面我们验证一下,先从R1上ping R2,结果如下:
R1#ping 192.168.1.2Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.....
SUCcess rate is 0 percent (0/5)
上面的结果显示,R1是ping不通R2的,现在我们再来看看R1上的访问控制列表是否有拒绝的匹配数据:
R1#show access-list
Extended IP access list 105
10 deny icmp host 192.168.1.2 host 192.168.1.1 echo-reply (15 matches)
20 permit ip any any
看到了吧,实验完成!

推荐阅读