interface Vlan10
ip address 1.1.1.254 255.255.255.0
ip access-group outbound in
ip access-group inbound out
ip access-list extended inbound
permit ip 2.2.2.0 0.0.0.255 1.1.1.0 0.0.0.255
evaluate DH
ip access-list extended outbound
permit ip 1.1.1.0 0.0.0.255 34.1.1.0 0.0.0.255 reflect DH
permit ip 1.1.1.0 0.0.0.255 2.2.2.0 0.0.0.255
注意:
(1)数据的通信是双向的;
(2)ACL最后隐藏deny any;
(3)在不同接口应用产生的结果不同,要注意;
(4)其实控制能不能访问还是ACL中deny的工作,reflect只是打个标记(记住数据的源端口号),让数据能返回。
SW#show ip access-lists
Reflexive IP access list DH
permit tcp host 34.1.1.4 eq telnet host 1.1.1.1 eq 26058 (16 matches) (time left 3)
Extended IP access list inbound
10 permit ip 2.2.2.0 0.0.0.255 1.1.1.0 0.0.0.255 (5 matches)
20 evaluate DH
Extended IP access list outbound
10 permit ip 1.1.1.0 0.0.0.255 34.1.1.0 0.0.0.255 reflect DH (12 matches)
20 permit ip 1.1.1.0 0.0.0.255 2.2.2.0 0.0.0.255 (5 matches)