千家信息网

ACL列表编辑:

发表于:2025-02-02 作者:千家信息网编辑
千家信息网最后更新 2025年02月02日,ACL列表编辑:1、建立ACL列表R1(config)#access-list 101 deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq 23R
千家信息网最后更新 2025年02月02日ACL列表编辑:

ACL列表编辑:
1、建立ACL列表
R1(config)#access-list 101 deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq 23
R1(config)#access-list 101 deny icmp 11.1.1.3 0.0.0.0 host 192.168.1.1
R1(config)#access-list 101 deny icmp 11.1.1.1 0.0.0.0 host 172.16.1.1
R1(config)#access-list 101 permit ip any any

2、ACL列表应用到端口
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip access-group 101 in

3、显示ACL列表
R1#show access-list //show R1所有访问列表
Extended IP access list 101
10 deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq telnet
20 deny icmp host 11.1.1.3 host 192.168.1.1
30 deny icmp host 11.1.1.1 host 172.16.1.1
40 permit ip any any (40 matches)

R1#show access-list 101 //show R1编号为101 的列表

4、编辑ACL列表
R1(config)#ip access-list extended 101
//删除10、20、30号列表
R1(config-ext-nacl)#no 10
R1(config-ext-nacl)#no 20
R1(config-ext-nacl)#no 30

//添加列表
R1(config-ext-nacl)#deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq 23
R1(config-ext-nacl)#deny icmp 11.1.1.3 0.0.0.0 host 192.168.1.1
R1(config-ext-nacl)#deny icmp 11.1.1.1 0.0.0.0 host 172.16.1.1

R1#show access-list //show R1所有访问列表
Extended IP access list 101
10 deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq telnet
20 deny icmp host 11.1.1.3 host 192.168.1.1
30 deny icmp host 11.1.1.1 host 172.16.1.1
40 permit ip any any (40 matches)

//插入列表
R1(config-ext-nacl)#25 deny icmp host 11.1.1.2 host 192.168.1.1

R1#show ip access-lists
Extended IP access list 101
10 deny tcp 11.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255 eq telnet
20 deny icmp host 11.1.1.3 host 192.168.1.1
25 deny icmp host 11.1.1.2 host 192.168.1.1 //插入的新策略
30 deny icmp host 11.1.1.1 host 172.16.1.1
40 permit ip any any (40 matches)

0