Command Line Reference
Security Configuration
DHCP Snooping Configuration
9 min
dhcp snooping configuration show dhcp snooping config \[command] show dhcp snooping config \[purpose] view dhcp snooping related configuration status \[view] system view 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 \[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 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 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 \[command] show snooping count \[purpose] view the number of snooping table entries \[view] system view sonic# show snooping count + + + + + + + |total v4 counter|local v4 counter|remote v4 counter|total v6 counter|local v6 counter|remote v6 counter| +============+============+===============+===============+=================+==================+ \| 0 | 0 | 0 | 0 | 0 | 0 | + + + + + + + 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 sonic(config)# dhcp snooping enable v4 sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping enable dhcp snooping autosave \[command] dhcp snooping autosave no dhcp snooping autosave \[purpose] enable dhcp snooping autosave feature \[view] system configuration view \[usage scenario] after enabling the global dhcp snooping autosave feature, the snooping table entries will retain their pre reboot count without needing to relearn after a device reboot if an entry reaches its aging time during the reboot, it will be aged out immediately upon device restart dhcp snooping autosave entries are stored in the /etc/sonic/snp json file under the device's linux view sonic(config)# dhcp snooping autosave sonic(config)# 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 sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping trusted dhcp snooping enable \[command] dhcp snooping enable no dhcp snooping enable \[purpose] enable the interface dhcp snooping function \[view] interface view, vlan view sonic(config)# interface ethernet 1 sonic(config if 1)# dhcp snooping enable
