Command Line Reference
Security Configuration
ACL Configuration
9 min
acl configuration show acl table \[command] show acl table \[ table name ] \[purpose] show existing acl tables \[parameter] parameter description table name specify acl group name \[view] system view \[use cases] sonic# show acl table name type binding description stage \ table 2 l3 ethernet8 table 2 ingress show acl rule \[command] show acl rule table name rule id \[purpose] show existing acl rules \[parameter] parameter description table name specify acl group name rule id specify the rule id \[view] system view \[use cases] sonic# show acl rule table rule priority action match \ dataacl rule 1 9999 drop src ip 10 0 0 2/32 dataacl rule 2 9998 drop dst ip 192 168 0 16/32 dataacl rule 3 9997 drop l4 src port 4661 dataacl rule 4 9996 drop ip protocol 126 dataacl rule 13 9987 drop ip protocol 1 sonic# show acl rule table 1 rule 1 table rule priority action match \ table 1 rule 1 100 drop src ip 200 0 0 2/24 show counters acl \[command] show counters acl acl table name rule id \[purpose] show acl hit count \[parameter] parameter description acl table name acl table name rule id rule id \[view] system view \[comment] allows multiple tables and rules to be entered, either as individual tables or as table + rule table and table are separated by ",", rule and rule are separated by ","; table and rule are separated by spaces \[use cases] sonic# show counters acl table 1,table 2 rule name table name prio packets count bytes count \ rule 1 table 1 100 n/a n/a rule 2 table 2 2 n/a n/a rule 1 table 2 1 n/a n/a clear counters acl \[command] clear counters acl \[purpose] clear acl hit count \[use cases] sonic# clear counters acl access list \[command] access list { table type } { table name } { table stage } no access list { table name } \[purpose] create acl table and enter acl view \[parameter] parameter description table type acl table type, optional l3, l3v6, ctrlplane table name acl table name table stage specify the inbound/outbound direction, ingress/egress \[view] system configuration view \[comment] acl table is for ports binding ports means that the acl table is effective for traffic on those ports an acl table can bind multiple ports, and multiple acl tab les can exist on a single port, i e , a "many to many" relationship \[use cases] sonic# configure terminal sonic(config)# access list l3 table 1 ingress rule \[command] rule {rule id rule id } \[{ packet action { deny | permit | trap to cpu | copy to cpu }| redirect action }] \[ src mac src mac ] \[ ethernet type ethernet type ] \[ vlan pri vlan pri ] \[ src ip src ip ] \[ dst ip dst ip ] \[ icmp type icmp type ] \[ icmp code i cmp code ] \[ icmp name icmp name ] \[ src port src port ] \[ dst port dst port ] \[ ip type ip type ] no rule { rule id } \[purpose] add acl rules \[parameter] parameter description rule id rule id, value range 0 500; simultaneously indicates rule priority (higher numbers indicate higher priority), values must be unique packet action packet processing actions for matched rules deny discard permit allow passage trap to cpu forward to cpu for processing copy to cpu allow passage while simultaneously copying the packet to the cpu for processing ethernet type ethertype, format hexadecimal number vlan pri vlan priority, value range 0 7 src ip source ip address, format a b c d/m dst ip destination ip address, format a b c d/m icmp type icmp message type, value range 0 16 icmp code icmp message code, value range 0 5 icmp name icmp message name src port source l4 port dst port destination l4 port ip type ip type \[view] acl view \[notes] multiple acl rules can exist per table rule id the higher the value, the higher the priority, the same table does not allow the configuration of the same priority rules \[use cases] sonic# configure terminal sonic(config)# access list l3 table 1 ingress sonic(config l3 acl table 1)# rule 1 source ip 10 0 0 3/24 packet action permit
