【network实践】扩展ACL(一)

与标准ACL不同,扩展ACL可以进行对送信元IP地址、宛先IP地址、プロトコル、送信元ポート、宛先ポート的控制来进行针对性的访问控制。

演习1

条件

  1. 整个网络要能互相ping通
  2. 设置番号为100的扩展ACL,从PC A1到PC B1的数据包全部拒绝,其余都许可通信。

首先配置路由器让其互相ping通

1
2
3
4
5
6
7
Router(config)#interface fastethernet 0
Router(config)#ip address 192.168.1.254 255.255.255.0
Router(config)#no shutdown
Router(config)#interface fastethernet 1
Router(config)#ip address 192.168.2.254 255.255.255.0
Router(config)#no shutdown
Router#show interface 确认端口是否配置成功

配置ACL

1
2
3
4
5
Router(config)#access-list 100 deny ip host 192.168.1.1 host 192.168.2.1
Router(config)#access-list 100 permit ip any any
Router(config)#show access-lists 确认ACL是否建立成功
Router(config)#interface fastethernet 0
Router(config)#ip access-group 100 in

如果想设置Fa 1端口,就用

1
2
Router(config)#interface fastethernet 1  
Router(config)#ip access-group 100 out

结果

最后检查结果时,会出现PCA1到PCB1到达不能,PCB1到PCA1出现timeout,这是正常结果,因为tcp/ip的三次握手中,当PCA1到PCB1通路阻断时,PCA1不能回应PCB1发出的“问候”,从而出现timeout。


【network实践】扩展ACL(一)
http://liuminxuan.github.io/2018/12/03/network实践笔记:扩展ACL(一)/
发布于
2018年12月3日
许可协议