Command Line Reference
Security Configuration
DHCP Snooping Configuration
15 min
show dhcp snooping config show dhcp snooping config \[command] show dhcp snooping config \[purpose] view dhcp snooping related configuration status \[view] system view \[use cases] sonic# show dhcp snooping config global mode v4 enable global mode v6 enable global snp max number global lease time 172800 + + + + + \| interface | dhcp snooping | trusted | snp max number | +=============+================+===========+==================+ \| ethernet50 | enable | true | | + + + + + \| vlan800 | enable | | | + + + + + \| vlan400 | enable | | | + + + + + \| ethernet49 | enable | true | | + + + + + show snooping table show snooping table \[command] show snooping table \[purpose] view all snooping table entry details \[view] system view \[notes] snooping table entries include those learned by dhcp snooping and nd snooping when this feature is enabled, the device can sync snooping table entries from other devices configured as neighbors, ensuring consistency across the network \[use cases] sonic# show snooping table + + + + + + + + + \| vlan | smac | sip | lease time | interface | time stamp | switch id | flag | +=========+====================+=============+============+===========+=================+=============+=======+ \| vlan400 | 3c 22\ fb 55\ a0 99 | 30 11 64 21 | 7200 | n/a | 1478434670738451| 30 11 0 89 | remote| + + + + + + + + + \| vlan400 | 72\ fe 15 7e 42 4f | 30 11 64 18 | 6000 | n/a | 1478433013541307| 30 11 0 84 | local | + + + + + + + + + description of the description of the show snooping table command output item description vlan vlan to which the entry belongs smac terminal mac address sip terminal ip address lease time aging time of the entry interface physical interface where the terminal is located time stamp timestamp when the entry was learned, for internal system use switch id ip address of the loopback interface of the device to which the terminal is currently connected flag identifier for the device to which the terminal is currently connected if it is the local device, it is labeled as local, and if it's another device within the cluster, it is labeled as remote show snooping count show snooping count \[command] show snooping count \[purpose] view the number of snooping table entries \[view] system view \[use cases] sonic# show snooping count total v4 counter=10 local v4 counter=3 remote v4 counter=7 total v6 counter=43 local v6 counter=10 remote v6 counter=33 show snooping status show snooping status \[command] show snooping status \[purpose] view snooping table entry synchronization status \[view] system view \[use cases] sonic# show snooping status switch id 30 11 0 84 source ip address 30 11 0 84 coherent status yes sequence number 1362 device mode client neighbors status summary \ neighbors switch id active sequence number connect active number 30 11 0 80 yes 1362 6 30 11 0 81 yes 1362 6 description of the description of the show snooping status command output item description coherent status whether the current table entry is the latest synchronization status yes synchronization completed no to be updated active connection status between device and neighbor yes connection is normal no connection exception sequence number number of table entry synchronization between device and neighbors connect active number number of clients that need to establish connections with neighbor devices snp sync enable {client|server} snp sync enable {client|server} \[command] snp sync enable {client|server} \[ switch id ] no snp sync enable \[purpose] configure the synchronization properties of the device and enable dhcp snooping synchronization function \[parameter] parameter description client the device directly connected to the dhcp client (client device) will synchronize all learned snooping entries to the server device, and also synchronize the snooping entries that other clients have synchronized to the server server non directly connected devices (to dhcp clients) receive all snooping entries synchronized from client devices switch id device ip, typically the loopback0 ip address of the device, used to uniquely identify a device \[view] system configuration view \[use cases] sonic# configure terminal sonic(config)# snp sync enable client 192 168 2 2 snp sync neighbor snp sync neighbor \[command] snp sync neighbor a b c d / a b no snp sync neighbor a b c d / a b \[purpose] add the ip address of the device that needs to synchronize snooping table entries \[parameter] parameter description a b c d / a b the configured switch id of the device to be connected \[view] system configuration view \[notes] for the server to establish connection with the client, please make sure that bgp neighbors have been established between the devices that need to synchronize snooping table entries, switch id three layers can be reached \[use cases] sonic(config)# snp sync neighbor 192 168 3 2 snp sync peer snp sync peer \[command] snp sync peer a b c d|a b no snp sync peer a b c d|a b \[purpose] add the ip address of the device that needs to synchronize snooping table entries \[parameter] parameter description a b c d / a b the configured switch id of the device to be connected \[view] system configuration view \[notes] configure this command on the server device to establish a connection between the server and the server make sure that bgp neighbors have been established between the devices that need to synchronize snooping table entries, switch id three layer reachable \[use cases] sonic(config)# snp sync peer 192 168 3 2 dhcp snooping enable {v4|v6} dhcp snooping enable {v4|v6} \[command] dhcp snooping enable {v4|v6} no dhcp snooping enable \[purpose] enable dhcp snooping function \[parameter] parameter description v4|v6 enable dhcp snooping function of ipv4 of ipv6 \[view] system configuration view \[notes] after enabling the global dhcp snooping function, user also need to enable the dhcp snooping function under the interface and vlan view this function should be used in combination with dhcp relay \[use cases] sonic(config)# dhcp snooping enable v4 sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping enable dhcp snooping trusted dhcp snooping trusted \[command] dhcp snooping trusted no dhcp snooping trusted \[purpose] configure the interface to a trusted state \[view] interface view, vlan view \[usage scenario] the trusted port forwards the received dhcp packets normally and learns the dhcp snooping table entries through the dhcp ack and dhcp offer packets responded by the dhcp server, usually the interface directly or indirectly connected to the dhcp server trusted by the administrator is set as the trusted port, and other port devices are untrusted ports physical ports, vlan interfaces, and link aggregation ports can all be configured in trust mode \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping trusted dhcp snooping enable dhcp snooping enable \[command] dhcp snooping enable no dhcp snooping enable \[purpose] enable the interface dhcp snooping function \[view] interface view, vlan view \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping enable
