Configuration Guide
ACL Configuration Guide
24 min
introduction introduction communication between information points and internal and external networks are essential business requirements in enterprise network in order to ensure the security of the intranet, security policy is needed to ensure that unauthorized users can only access specific network resources acl (access control list) is packet processing policy consisting of a series of rules, which are generally judgment statements describing the matching conditions of packets, such as the source mac, destination mac, source ip, destination ip, source port number, destination port number, etc the switch filters packets based on these rules after configuring acl rules, the switch will allow certain packets to pass and block certain packets to achieve the purpose of access control and traffic filtering in short, acl as a network technology means to control access, improve the security of the network environment and the reliability of network transmission basic concepts basic concepts acl table acl table acl table is port specific binding ports means that the acl table is valid for traffic on those ports a single acl table can bind multiple ports, and multiple acl tables can exist on a single port, i e a "many to many" relationship acl table naming rule acl table naming rule the acl tables’ name is supposed to be different acl table type acl table type acl table type affects the match fields of the acl, in other words, determines which characteristics are used to match traffic acl table type is available as l2, l3, l3v6, mirror, mirrorv6, flow control in particular, flow control is used as a special acl table type in combination with the traffic behavior module for the speed limiting of specific flows acl table direction acl table direction the acl table stage indicates the direction, optionally ingress and egress, which corresponds to whether the acl table is applied to the ingress or egress direction respectively if stage is not specified, the default is ingress currently, the same acl table does not support matching in both the ingress and egress directions for the cx family, the matches available in different directions are different the acl match fields in the ingress direction are not available in the egress direction, and there are fewer types of match fields for egress than for ingress see docid\ qi bda9yfylodx8 2smwz for a detailed description of the match fields acl rule acl rule acl rule is table specific rule that defines the priority of the rule, the matching conditions and the action to be taken if the match is successful an acl rule can only be added to one table, but a table can have multiple rules, i e the rule and the table are in a "many to one" relationship the match field of an acl rule must match the match field of the table in which it is located, and cannot exceed the match field defined by the table acl rule naming rule acl rule naming rule the acl rules’ name is supposed to be different acl rule priority acl rule priority priority indicates the priority of rule, the higher the value, the higher the priority, and is specified to be less than 500 priority is used to match the highest priority rule when there are multiple rules to match the same table does not allow rules of the same priority to be configured acl rule action acl rule action ingress table 1 acl rule ingress action table 1 acl rule ingress action true 96,88 98076923076923,421 0192307692308 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type egress table 2 acl rule egress action table 2 acl rule egress action true 108,108 78350515463917,389 21649484536084left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type acl rule match fields acl rule match fields the supported match fields for different types of acl tables vary, and the specific match fields for each type of acl table are described below l2 match fields note l2 acl is only supported on cx308p 48y n v2 and cx532p n v2 table 3 l2 keywords table 3 l2 keywords true 99,365 66112574535737,141 33887425464263 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type l3 match fields table 4 l3 keywords table 4 l3 keywords true 110,281 86345381526104,214 13654618473896 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type l3v6 match fields table 5 l3v6 keywords table 5 l3v6 keywords true 122,262,222 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type mirror match fields table 6 mirror keywords table 6 mirror keywords true 118,312 2842942345925,175 7157057654075 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type mirrorv6 match fields table 7 mirrorv6 keywords table 7 mirrorv6 keywords true 115,249 3968253968254,241 6031746031746 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type flow control match fields table 8 flow control keywords table 8 flow control keywords true 101,350 5,154 5 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type acl configuration acl configuration configure l2 acl table configure l2 acl table note l2 acl is only supported on cx308p 48y n v2 and cx532p n v2 table 9 configure l2 acl table table 9 configure l2 acl table true 165,206 2872340425532,234 7127659574468 trueleft #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure l3 acl table configure l3 acl table table 10 configure l3 acl table table 10 configure l3 acl table true 165,204 5,236 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure l3v6 acl table configure l3v6 acl table table 11 configure l3v6 acl table table 11 configure l3v6 acl table true 157,215 5,233 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure acl redirection configure acl redirection acl redirection can be configured to a specified interface, next hop, or next hop group table 12 configure acl redirection table 12 configure acl redirection true 164,207,235left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure acl redirection next hop group configure acl redirection next hop group acl redirection can be configured to a specified interface, next hop, or next hop group table 13 configure acl redirection next hop group table 13 configure acl redirection next hop group true 161,202 5,242 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure acl based complex traffic behavior configure acl based complex traffic behavior please refer to configure acl based complex traffic behavior in docid 1ai9lr9pg ajax0zgqojr for details configure user defined acl configure user defined acl table 14 configure user defined acl type table 14 configure user defined acl type true 157,213 5,235 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type use user defined acl type to configure the acl table table 15 configure acl table table 15 configure acl table true 167,198 5,240 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure control plane acl configure control plane acl table 16 configure acl table table 16 configure acl table true 165,257 5,183 5left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type configure packet remarking configure packet remarking please refer to configure packet remarking in docid\ qi bda9yfylodx8 2smwz for details display and maintenance display and maintenance table 17 acl display and maintenance table 17 acl display and maintenance true 190,230 2135922330097,185 7864077669903left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type typical configuration example typical configuration example l3 ipv4 acl configuration example l3 ipv4 acl configuration example networking requirements a company interconnects its departments via the switch the server stores confidential technical information about the company and also backs it up to the cloud to ensure information security, it is required that acl rules are correctly configured to achieve prohibit department a from accessing resources on the server or in the cloud department b is prohibited from accessing the server resources directly, but can access the information by accessing the cloud topology procedure \#configure the ip of each port of the switch sonic# configure terminal sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# ip address 192 168 4 1/24 sonic(config if 0/0)# ex sonic# configure terminal sonic(config)# interface ethernet 0/1 sonic(config if 0/1)# ip address 192 168 5 1/24 sonic(config if 0/1)# ex sonic# configure terminal sonic(config)# interface ethernet 0/48 sonic(config if 0/48)# ip address 192 168 10 1/24 sonic(config if 0/48)# ex sonic# configure terminal sonic(config)# interface ethernet 0/52 sonic(config if 0/52)# ip address 192 168 10 2/24 sonic(config if 0/52)# ex \#configure acl rules ethernet0 ingress direction packets with destination ip 192 168 20 2 received are discarded sonic# configure terminal sonic(config)# access list table a l3 ingress sonic(config l3 acl table a)# bind interface ethernet 0/0 sonic(config l3 acl table a)# rule 100 destination ip 192 168 20 2 packet action deny sonic(config l3 acl table a)# ex \#ethernet1 ingress direction received packet with destination ip 192 168 20 2 redirected to ethernet48 sonic# configure terminal sonic(config)# access list table b l3 ingress sonic(config l3 acl table b)# bind interface ethernet 0/1 sonic(config l3 acl table b)# rule 200 destination ip 192 168 20 2 redirect action 192 168 10 2 sonic(config l3 acl table b)# ex verify the configuration verify that the acl rule is configured successfully sonic# show acl table name type binding description stage \ table b l3 0/1 table b ingress table a l3 0/0 table a ingress sonic# show acl rule table rule priority action match \ table b rule 200 200 drop dst ip 192 168 20 2 table a rule 100 100 drop dst ip 192 168 20 2 table a rule 101 101 drop dst ip 192 168 10 2 a pc pinging the server from department a does not work, and when pinging the server from a pc in department b the packets go to ethernet48
