Command Line Reference
Security Configuration
9-1-acl-configuration
7 min
acl configuration show acl table \[ table name ] \[command] show acl table \[ table name ] \[purpose] show existing acl tables \[parameter] table name specify the table 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 \[ table name ] \[ rule id ] \[command] show acl rule \[ table name ] \[ rule id ] \[purpose] show existing acl rules \[parameter] table name specify the table name rule id specify the rule name \[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 src ip 10 0 0 2/32 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 \[ acl table name ] \[ rule id ] \[command] show counters acl \[ acl table name ] \[ rule id ] \[purpose] show acl hit count \[parameter] acl table name acl table name rule id rule id \[view] system view \[notes] 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 table type table name table stage \[command] access list table type table name table stage no access list table name \[purpose] create acl table and enter acl view \[parameter] 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 \[notes] 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 tables 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 \[{packet action {deny|permit|trap to cpu|no nat}}] \[src mac mac address ] \[src ip ip address ] \[dst ip ip address ] \[src port port ] \[dst port port ] \[ip protocol protocol ] no rule rule id \[purpose] add acl rules \[parameter] rule id rule id, the range of values 0 500; also indicates the rule priority, the larger the number the higher the priority, not repeatable packet action packet processing actions for hit rules deny drop permit allowed to pass trap to cpu upload to cpu for processing no nat not using the nat function src ip source ip address, format a b c d/m dst ip destination ip address, format a b c d/m \[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 src ip 10 0 0 3/24 packet action permit
