Router(config-ext-nacl)#deny ip any any //拒绝所有包通过
Router(config-ext-nacl)#exit
Router(config)#int s 0/0 //路由器的内网接口
Router(config-if)#ip access-group to_out in//将to_out应用在该接口上,in方向[或者应用到ser 0/1的out方向上也行]
Router(config-if)#ex
Router(config)#int ser 0/1//路由器的外网接口
Router(config-if)#ip access-group to_in in//将to_in应用在该接口上,in方向
四、测试
PC1上测试结果:
自反列表创建生效后
Router#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
telnet登录PC2
Router#telnet 192.168.2.2
Trying 192.168.2.2 ... Open
User Access Verification
Password:
Router>
PC2上测试结果:
自反列表创建生效后,无法ping通PC1
Router#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
U.U.U
本文出自 “贾亮的博客” 博客