{"id":874,"date":"2011-09-07T21:48:00","date_gmt":"2011-09-07T13:48:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=874"},"modified":"2023-11-07T21:53:19","modified_gmt":"2023-11-07T13:53:19","slug":"cisco-vlan-acl","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/874","title":{"rendered":"Cisco Vlan ACL"},"content":{"rendered":"\n<p>VLAN access lists (VACL)<br>VACL are filters that directly can affect how packets are handled within a VLAN<br>mitigating MAC address flooding attacks<\/p>\n\n\n\n<p><strong>VACL\u898f\u5247<\/strong><br>1\u8207ACL\u76843\u500b\u898f\u5247\u4e00\u6a23<br>2\u6c92\u6709in-bound\u548cout-bound\u7684\u5206\u5225<br>3\u4f5c\u7528\u5728ACL\u548cNAT\u4e4b\u524d<br>ps:<br>acl\u6aa2\u67e5\u512a\u5148\u9806\u5e8f\u70baPACL &gt; VACL &gt; RACL<br>ps:<br>PACL(port acl)<br>\u70baL2 ACL,\u53ea\u770bInbound,\u53ef\u9069\u7528\u65bcIP-ACL\u548cMAC-ACL<br>apply a port ACL to a trunk port, the ACL filters traffic on all VLANs present on the trunk port.<br>apply a port ACL to a port with voice VLAN, the ACL filters traffic on both data and voice VLANs.<br>\u4e0d\u652f\u63f4etherchannel<\/p>\n\n\n\n<p>VACL vs RACLs(route acl)\/traditional ACLs<br><strong>not same:<\/strong><br>1. VACL can permit, deny, or redirect packets as they are matched , even if they are not routed to another Layer 3 interface<br>2. VLAN maps can not be applied to a VLAN interface,\u56e0\u70bavacl\u6c92\u6709inbound\u548coutbound\u7684\u5206\u5225,\u56e0\u6b64acl\u8a2d\u5b9a\u6642\u8981\u7279\u5225\u6ce8\u610f<br>3. RACL\u53ea\u7528\u65bcIP ACL<br><strong>same:<\/strong><br>1. VACLs are merged into the TCAM<br>2. VACLs are configured in a route map fashion, with a series of matching conditions and actions to take<br>ps:<br>VACLs are configured as a VLAN access map in much the same format as a route map<br>ps:<br>VLAN maps and router ACLs can be used in combination.<\/p>\n\n\n\n<p>define the VACL<br>1<br>\u81ea\u8a02\u4e00\u500bvacl\u540d\u7a31<br><strong>(config)# vlan access-map &lt; map-name &gt; [sequence-number]<\/strong><br>\u53c3\u6578\u8aaa\u660e\u5982\u4e0b<br>&lt; map-name &gt; \u81ea\u8a02\u4e00\u500baccess-map\u540d\u7a31<br>[sequence-number] Access map statements are evaluated in sequence<br>2<br>define the access-map matching conditions<br><strong>(config-access-map)# match &lt; ip | ipx | mac &gt; address &lt; acl&gt;<\/strong><br>\u53c3\u6578\u8aaa\u660e\u5982\u4e0b<br>&lt; acl &gt; \u4ee5\u4e4b\u524d\u5b9a\u7fa9\u7684access-list,\u505a\u70ba\u6bd4\u5c0d\u7684\u4f9d\u64da,\u53ef\u4ee5\u662facl-number\u6216acl-name<br>Matching is performed by access lists (IP, IPX, or MAC address ACLs), which you must configure independently<br>ps:You can repeat these commands to define several matching conditions<br>ex:<br>match ip address acl_info<br>match ip address 105<br>match ipx address acl_office<br>match mac address acl_school<br>3<br>Define the access-map action<br><strong>(config-access-map)# action &lt; drop | forward [capture] | redirect &lt; interface &gt;&gt;<\/strong><br>ps:<br>The TCAM performs the entire VACL match and action as packets are switched or bridged<br>within a VLAN or routed into or out of a VLAN.<br><br>apply the VACL to a VLAN<br><strong>(config)# vlan filter &lt; map-name &gt; vlan-list &lt; vlan-list&gt;<\/strong><br>&lt; map-name &gt; \u5b9a\u7fa9\u597d\u7684access-map<br>&lt; vlan-list &gt; \u6307\u5b9avlan,\u800c\u4e0d\u662fSVI<br>ps:<br>The SVI is the point where packets enter or leave a VLAN, so it does not make sense to apply a VACL there<br>the VACL needs to function within the VLAN itself, where there is no inbound or outbound direction<\/p>\n\n\n\n<p>ex:<br>to filter traffic within VLAN 99 so that host 192.168.99.17 is not allowed to any host on its local subnet , otherwise, the packet is forwarded<br>Switch(config)# ip access-list extended local-17<br>Switch(config-acl)# permit ip host 192.168.99.17 192.168.99.0 0.0.0.255<br>Switch(config-acl)# exit<br>Switch(config)# vlan access-map mapblock 10<br>Switch(config-access-map)# match ip address local-17<br>Switch(config-access-map)# action drop<br>Switch(config-access-map)# vlan access-map mapblock 20<br>Switch(config-access-map)# action forward<br>Switch(config-access-map)# exit<br>Switch(config)# vlan filter mapblock vlan-list 99<\/p>\n\n\n\n<p><br>ps:<br>Switch(config-access-map)#?<br>Vlan access-map configuration commands:<br>\u3000action Take the action<br>\u3000\u3000drop Drop packets<br>\u3000\u3000forward Forward packets<br>\u3000default Set a command to its defaults<br>\u3000exit Exit from vlan access-map configuration mode<br>\u3000match Match values.<br>\u3000\u3000ip address<br>\u3000\u3000mac address<br>\u3000no Negate a command or set its defaults<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VLAN access lists (VACL)VACL a &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[31],"tags":[],"class_list":["post-874","post","type-post","status-publish","format-standard","hentry","category-cisco-security"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}