{"id":514,"date":"2020-10-18T22:36:46","date_gmt":"2020-10-18T22:36:46","guid":{"rendered":"https:\/\/dft.wiki\/?p=514"},"modified":"2026-06-09T13:32:01","modified_gmt":"2026-06-09T17:32:01","slug":"working-with-acls-in-cisco-devices","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=514","title":{"rendered":"Working with ACLs on Cisco Devices"},"content":{"rendered":"<p style=\"text-align: left;\">An ACL is a list of rules applied to an interface to control traffic policy.<\/p>\n<p>There are two main types of ACL:<\/p>\n<p><strong>Standard<\/strong>: Usually applied to the outbound interface because it only inspects the source address of the packet. Identified by numbers between 1 and 99. Named ACLs are also supported but use a different syntax.<\/p>\n<p><strong>Extended<\/strong>: Usually applied to the inbound interface because it inspects both source and destination IPs, preventing unnecessary traffic from traversing the network. It also filters by port to restrict or allow specific services. Can be identified by numbers (100\u2013199) or names, making them easier to manage.<\/p>\n<p><strong>Standard<\/strong> ACL syntax:<\/p>\n<pre>access-list <strong>10\r\n<\/strong>access-list <strong>10<\/strong> allow 192.168.1.9\r\naccess-list <strong>10<\/strong> deny 10.0.0.0 <strong>0.0.0.255<\/strong><\/pre>\n<p>Note: <strong>10<\/strong> is the ACL identifier, <strong>0.0.0.255<\/strong> is the wildcard mask for network <strong>10.0.0.0<\/strong>. For a single host, no wildcard is needed.<\/p>\n<p>Applying to an interface:<\/p>\n<pre>interface g0\/0\r\nip access-group <strong>10<\/strong> out<\/pre>\n<p><strong>Extended<\/strong> ACL syntax:<\/p>\n<pre>access-list <strong>100<\/strong> remark Allow HTTP+SSH\r\naccess-list 100 permit tcp host 192.168.10.3 <strong>host<\/strong> 10.2.2.1 <strong>eq<\/strong> 22\r\naccess-list 100 permit tcp any any <strong>eq<\/strong> 80\r\n\r\nip access-list extended <strong>WEB-POLICY<\/strong>\r\npermit tcp 192.168.30.0 0.0.0.255 <strong>host<\/strong> 10.1.1.1 <strong>eq<\/strong> 80\r\npermit tcp 192.168.30.0 0.0.0.255 209.165.200.224 0.0.0.31 <strong>eq<\/strong> 80<\/pre>\n<p>Note: <strong>100<\/strong> and <strong>WEB-POLICY<\/strong> are the ACL identifiers. Using the <strong>host<\/strong> keyword removes the need for a wildcard mask, and <strong>eq<\/strong> stands for &#8220;equal to,&#8221; followed by the port number the rule applies to.<\/p>\n<p>Applying to an interface:<\/p>\n<pre>interface g0\/0\r\nip access-group 100 <strong>out<\/strong>\r\n\r\ninterface g0\/1\r\nip access-group WEB-POLICY <strong>in<\/strong><\/pre>\n<p>Editing a rule in an Extended ACL:<\/p>\n<pre>ip access-list extended 100\r\n<strong>30<\/strong> permit ip 192.168.10.0 0.0.0.255 192.168.30.0 0.0.0.255<\/pre>\n<p>Remember: ACLs always have an implicit final rule that denies all traffic from any source to any destination. To permit everything else, add this at the end:<\/p>\n<pre>access-list 100 deny icmp any any echo\r\naccess-list 100 deny icmp any any echo-reply\r\naccess-list 100 permit ip any any<\/pre>\n<p>To allow already-established traffic (i.e., <strong>responses to outgoing requests<\/strong>), add &#8220;established&#8221; at the end of the rule:<\/p>\n<pre>access-list 100 permit <strong>tcp<\/strong> any any <strong>established<\/strong><\/pre>\n<p>Note: <strong>established<\/strong> can only be used with <strong>tcp<\/strong>, not with <strong>udp<\/strong> or <strong>ip<\/strong>.<\/p>\n<p>Useful commands to view ACLs:<\/p>\n<pre>show access-lists\r\nshow access-list <strong>100<\/strong><\/pre>\n<p>Removing or modifying a rule:<\/p>\n<pre>ip access-list extended <strong>100\r\n<\/strong>do show access-list <strong>100\r\n<\/strong>no <strong>30\r\n20<\/strong> xxxxx<\/pre>\n<p>Note: <strong>100<\/strong> is the ACL identifier, and <strong>30<\/strong> and <strong>20<\/strong> are the line numbers shown by the second command.<\/p>\n<p>A common mistake when creating ACL rules is accidentally blocking return traffic. Double-check your rules to avoid this.<\/p>\n<p>The following example shows how to allow traffic for already-established TCP connections:<\/p>\n<pre>access-list 100 permit tcp any any established\r\naccess-list 100 deny tcp any any eq telnet<\/pre>\n<p>In the example above, ACL 100 is applied inbound on a WAN interface. It blocks incoming Telnet connections but allows incoming TCP traffic that belongs to an already-established session, which could itself be a Telnet connection initiated from the inside.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An ACL is a list of rules applied to an interface to control traffic policy. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-514","post","type-post","status-publish","format-standard","hentry","category-ccna"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=514"}],"version-history":[{"count":15,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":5817,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions\/5817"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}