Users Guide

Table Of Contents
724 Access Control Lists
Complete ACL Example
The following example is a complete inbound ACL that allows access for
hosts connected to gi1/0/1 with IP address in 10.1.1.x range to send IP packets
to 192.168.0.X hosts on gi1/0/2. IP packets not from 10.1.1.x addresses or not
addressed to 192.168.0.x hosts are dropped. Packets with protocols other than
IP, DNS, ARP, or ICMP are dropped. Allowing ICMP supports the 10.1.1.x
hosts in reliably receiving and initiating TCP connections and pinging
through the switch. This example also allows ARP and DNS packets to any
destination and is suitable for a Layer-2 switch. Both administrator-specified
and automatic sequence numbering of the ACLs is demonstrated.
console#config
console(config)#mac access-list extended Allow-ARP
console(config-mac-access-list)#permit any any arp
console(config-mac-access-list)#exit
console(config)#ip access-list Allow-10-1-1-x
console(config-ip-acl)#10 permit ip 10.1.1.0 0.0.0.255 any
console(config-ip-acl)#20 permit ip any 192.168.0.0 0.0.0.255
console(config-ip-acl)#30 permit icmp 10.1.1.0 0.0.0.255 any
console(config-ip-acl)#40 permit ip 0.0.0.0 255.255.255.255 any
console(config-ip-acl)#50 permit udp any any eq domain
console(config-ip-acl)#exit
console(config)#interface gi1/0/1
console(config-if-gi1/0/1)#mac access-group Allow-ARP in 10
console(config-if-gi1/0/1)#ip access-group Allow-10-1-1-x in 20
console(config-if-gi1/0/1)#exit
Another list on the 192.168.0.x network attached port (gi1/0/2) is configured
for this example. Because the two access lists are complementary/end-to-end,
it is necessary to allow ICMP packets to travel between the attached hosts.
Specific sequence numbering of the ACLs rules is shown here.
console(config)#ip access-list Allow-192-168-0-x
console(config-ip-acl)#10 permit ip 192.168.0.0 0.0.0.255 10.1.1.0
0.0.0.255
console(config-ip-acl)#20 permit icmp 192.168.0.0 0.0.0.255 any
console(config-ip-acl)#30 permit udp any any eq domain
console(config-ip-acl)#exit
console(config)#interface gi1/0/2
console(config-if-gi1/0/2)#mac access-group Allow-ARP in 10
console(config-if-gi1/0/2)#ip access-group Allow-192-168-0-x in 20