Command Line Reference
Layer 2 Configuration
MAC
12 min
mac view mac view table 1 mac view table 1 mac view command purpose purpose show mac address \[{ ethernet|link aggregation } interface name|all ] display mac address table clear mac address \[{ ethernet|link aggregation } interface name|vlan vlan id ] { static|dynamic|all } clear mac entries show mac limit display mac limit configuration show mac address \[{ethernet|link aggregation} show mac address \[{ethernet|link aggregation} interface name |all] \[command] show mac address \[{ ethernet | link aggregation } interface name | all ] \[purpose] display mac address table \[parameters] parameter description interface name interface name (eg 0/1) \[view] privileged user view \[use cases] sonic# show mac address no vlan macaddress port type \ 1 100 e2 8c 56 85 4a 11 0/0 static total number of entries 1 sonic# show mac address all no vlan macaddress port type \ 1 200 aa\ bb\ cc 11 22 33 0/129 dynamic total number of entries 1 + + + + + + \| vlan | mac | remotevtep | vni | type | +========+===================+==============+=======+========+ \| 200 | 60\ eb 5a 01 10\ b1 | 10 193 2 102 | 200 | static | + + + + + + total count 1 aging time for switch is 1800 seconds clear mac address \[{ethernet|link aggregation} clear mac address \[{ethernet|link aggregation} interface name |vlan vlan id ] {static|dynamic|all} \[command] clear mac address \[{ ethernet | link aggregation } interface name | vlan vlan id ] { static | dynamic | all } \[purpose] clear mac entries \[parameters] parameter description interface name interface name (eg 0/1) vlan id vlan id, the range is \[1,4094] \[view] privileged user view \[use cases] sonic# clear mac address dynamic show mac limit show mac limit \[command] show mac limit \[purpose] display mac limit configuration \[view] privileged user view \[use cases] sonic# show mac limit interface mac limit \ 0/1 100 0/2 200 mac config mac config table 2 mac config table 2 mac config command purpose mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id {ethernet|link aggregation} interface name configure a static mac entry mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id blackhole configure a blackhole mac entry mac address timer { aging aging time|no aging } set mac aging time mac limit dynamic mac limit value set a limit to the number of dynamic mac table entries mac address static mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id {ethernet|link aggregation} interface name \[command] mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id { ethernet | link aggregation } interface name \[purpose] configure a static mac entry \[parameters] parameter description hh\ hh\ hh\ hh\ hh\ hh mac address vlan id vlan id, the range is \[1,4094] interface name interface name (eg 0/1) \[view] global configuration view \[notes] run command no mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id to delete a static mac entry \[use cases] sonic# configure terminal sonic(config)# mac address static aa\ aa\ aa\ aa\ aa\ aa vlan 4 ethernet 0/4 mac address static mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id blackhole \[command] mac addressstatic hh\ hh\ hh\ hh\ hh\ hh vlan vlan id blackhole \[purpose] configure a blackhole mac entry \[parameters] parameter description hh\ hh\ hh\ hh\ hh\ hh mac address vlan id vlan id, the range is \[1,4094] \[view] global configuration view \[notes] run command no mac address static hh\ hh\ hh\ hh\ hh\ hh vlan vlan id to delete a blackhole mac entry \[use cases] sonic# configure terminal sonic(config)# mac address aa\ bb\ bb\ bb\ bb\ bb vlan 5 blackhole mac address timer {aging mac address timer {aging aging time |no aging} \[command] mac address timer { aging aging time | no aging } \[purpose] set mac aging time \[parameters] parameter description aging time specify the aging time in seconds, the default is 1800, and the range is from 30 to 7200 \[view] global configuration view \[notes] mac aging time is a parameter that affects mac self learning on the switch dynamic mac entries will be automatically discarded after aging; and static mac entries are not affected by mac aging time run command mac address timer no aging to disable mac aging \[use cases] sonic# configure terminal sonic(config)# mac address timer aging 3600 sonic(config)# mac address timer no aging mac limit dynamic mac limit dynamic mac limit value \[command] mac limit dynamic mac limit value \[purpose] set a limit to the number of dynamic mac table entries \[parameters] parameter description mac limit value the range is from 1 to 131072 \[view] vlan configuration view/physical interface configuration view \[notes] only cx308p 48y n v2 and cx532p n v2 support this feature only vlan or vlan member ports are allowed to configure the mac number limit run command no mac limit dynamic to delete mac limit configuration \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/0 sonic(config if 0/0)# mac limit dynamic 1000 sonic(config if 0/0)# exit sonic(config)# vlan 30 sonic(config vlan 30)# mac limit dynamic 2000
