Command Line Reference
Layer 3 Configuration
DHCP
56 min
dhcp relay dhcp relay dhcp relay view dhcp relay view table 1 dhcp relay view table 1 dhcp relay view true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type show dhcp relay show dhcp relay \[command] show dhcp relay \[purpose] display dhcp relay configuration \[view] privileged user view \[use cases] sonic# show dhcp relay + + + + + + + \| name | down link | up link | loopback | server | vrf | +==============================+=============+===========+============+==========+========+ \| test v4(v4) | na | na | na | na | na | + + + + + + + \| test dhcp over vxlan v4(v4) | vlan20 | 0/2 | na | 21 0 0 2 | vrf 123| + + + + + + + \| test dhcp over vxlan v6(v6) | vlan20 | 0/2 | na | 2123 2 | vrf 123| + + + + + + + dhcp relay config dhcp relay config table 2 dhcp relay config table 2 dhcp relay config true 322,339#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type feature dhcp state enable feature dhcp state enable \[command] feature dhcp state enable \[purpose] enable feature dhcp \[view] global configuration view \[notes] run command feature dhcp state disable to disable dhcp feature \[use cases] sonic# configure terminal sonic(config)# feature dhcp state enable dhcp relay dhcp relay name {v4|v6} \[vrf vrf name ] \[command] dhcp relay name { v4 | v6 } \[ vrf vrf name ] \[purpose] create an ipv4 or ipv6 dhcp relay instance \[parameters] true 101,560#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] global configuration view \[notes] please run feature dhcp state enable to enable dhcp before you configure dhcp relay \[use cases] sonic# configure terminal sonic(config)# dhcp relay test v4 downlink vlan downlink vlan vlan id \[giaddr a b c d | option82 sub5 a b c d ] \[command] downlink vlan vlan id \[ giaddr a b c d | option82 sub5 a b c d ] \[purpose] specify the vlan for dhcpv4 relay (on dhcp client side) \[parameters] true 160,501#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] dhcp relay instance configuration view \[use cases] sonic# configure terminal sonic(config)# dhcp relay test v4 sonic(config dhcp relay test)# downlink vlan 10 giaddr 10 0 0 1 downlink vlan downlink vlan vlan id \[option client linklayer addr] \[command] downlink vlan vlan id \[ option option client linklayer addr ] \[purpose] specify the vlan for dhcpv6 relay (on dhcp client side) \[parameters] true 148,513#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp relay instance configuration view \[use cases] sonic# configure terminal sonic(config)# dhcp relay test v6 sonic(config dhcp relay test)# downlink vlan 100 option client linklayer addr giaddr loopback giaddr loopback loopback id \[command] giaddr loopback loopback id \[purpose] specify the gateway ip address \[parameters] true 173,488#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp relay instance configuration view \[notes] by default, the switch will set the giaddr to the ip address of the host vlan interface when it receives a dhcp request \[use cases] sonic(config)# dhcp relay test v4 sonic(config dhcp relay test)# giaddr loopback 0 server server dhcp server ip \[command] server dhcp server ip \[purpose] set dhcp server ip \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp relay instance configuration view \[use cases] sonic(config)# dhcp relay test v4 sonic(config dhcp relay test)# server 10 248 0 1 uplink {ethernet|link aggregation|vlan} uplink {ethernet|link aggregation|vlan} interface name \[command] uplink { ethernet | link aggregation|vlan } interface name \[purpose] specify the uplink port ( on dhcp server side) of dhcp relay \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp relay instance configuration view \[use cases] sonic(config)# dhcp relay test v4 sonic(config dhcp relay test)# uplink ethernet 0/2 dhcp server dhcp server dhcp server view dhcp server view table 3 dhcp server view table 3 dhcp server view true 281,380#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type show dhcp pool info \[ip version {v4|v6}] show dhcp pool info \[ip version {v4|v6}] \[command] show dhcp pool info \[ ip version { v4 | v6 }] \[purpose] display dhcp server pool infomation \[view] privileged user view \[notes] when no ip address version is specified, default view of ipv4 version address pool information \[use cases] sonic# show dhcp pool info \ pool name t1 network 201 0 0 0 mask 255 255 255 0 lease 201 0 0 20 201 0 0 50 lease default time 600 lease max time 7200 used lease 0 total lease 72 show dhcp pool ip use \[ip version {v4|v6}] show dhcp pool ip use \[ip version {v4|v6}] \[command] show dhcp pool ip use \[ ip version { v4 | v6 }] \[purpose] display the addresses assigned to clients by dhcp server \[view] privileged user view \[notes] when no ip address version is specified, the default view is the ip address information assigned by the ipv4 version \[use cases] sonic# show dhcp pool ip in use ip version v4 reading leases from /var/lib/dhcp/dhcpd leases ip mac hostname binding state starts ends \================================================================================================================== total lease 0 show dhcp pool expired \[ip version {v4|v6}] show dhcp pool expired \[ip version {v4|v6}] \[command] show dhcp pool expired \[ ip version { v4 | v6 }] \[purpose] display dhcp server expired ip information \[view] privileged user view \[notes] when no ip address version is specified, the default view is the ip address information reclaimed by ipv4 version \[use cases] sonic# show dhcp pool expired reading leases from /var/lib/dhcp/dhcpd leases ip mac hostname binding state starts ends \================================================================================================================== 201 0 0 35 18 17 25 37 64 40 na free 2024 10 21 03 07 01 2024 10 21 03 09 07 total lease 1 show dhcp class show dhcp class \[command] show dhcp class \[purpose] display dhcp server user class configuration \[view] privileged user view \[use cases] sonic# show dhcp class ! dhcp class t1 ! dhcp class test1 if match rule 1 option 93 hex ffff show dhcp option group show dhcp option group \[command] show dhcp option group \[purpose] display dhcp server option group configuration \[view] privileged user view \[use cases] sonic# show dhcp option group ! dhcp option group 1 option43 hex 01 force dhcp server config dhcp server config table 4 dhcp server config table 4 dhcp server config true 308,353 true#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type dhcp server dhcp server \[command] dhcp server \[purpose] enable interface dhcp server function \[view] physical interface / vlanif configuration view \[notes] run command no dhcp server to disable interface dhcp server fuction \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 dhcp pool dhcp pool name \[v6] \[command] dhcp pool name \[ v6 ] \[purpose] create a dhcp server address pool and enter the dhcp pool configuration view \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] default creation of ipv4 type address pool, with v6 parameter, creates ipv6 type address pool run command no dhcp pool name \[ v6 ] to delete dhcp pool \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 dhcp class dhcp class name \[command] dhcp class name \[purpose] create dhcp server user class and enter dhcp user class configuration view \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no dhcp class name to delete dhcp class \[use cases] sonic# configure terminal sonic(config)# dhcp class t1 dhcp option group dhcp option group id \[command] dhcp option group id \[purpose] create a dhcp server option group and enter the option group configuration view \[parameters] true 190,471#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no dhcp option group id to delete dhcp option group \[use cases] sonic# configure terminal sonic(config)# dhcp option group 1 network { network { a b c d a b c d | a b a b } \[command] network { a b c d a b c d | a b a b } \[purpose] configure the network of the address pool \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# network 100 0 0 1 255 255 255 0 address pool address pool start ip end ip \[command] address pool start ip end ip \[purpose] configure address pool ip range \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view \[notes] the end ip address must be after the start ip address \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# address pool 100 0 0 10 100 0 0 100 lease time lease time default time max time \[command] lease time default time max time \[purpose] configure lease time \[parameters] true 156,505#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view \[notes] run command no lease time to restore lease time to default value \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# lease time 300 1000 bootfile bootfile name \[command] bootfile name \[purpose] configure bootfile option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp pool configuration view/dhcp option group configuration view \[notes] run command no bootfile to delete bootfile option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# bootfile name test txt dns { dns { a b c d | a b } \[command] dns { a b c d | a b } \[purpose] configure dns option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view/ dhcp option group configuration view \[notes] run command no dns to delete dns option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# dns 8 8 8 8 next server { next server { a b c d | a b } \[command] next server { a b c d | a b } \[purpose] configure next server option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view \[notes] run command no next server to delete next server option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# next server 1 1 1 1 tftp server { tftp server { a b c d | a b } \[command] tftp server { a b c d | a b } \[purpose] configure tftp server option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view/dhcp option group configuration view \[notes] run command no tftp server to delete tftp server option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# tftp server 2 2 2 2 capwap ac capwap ac a b c d \[command] capwap ac a b c d \[purpose] configure capwap ac option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp pool configuration view/dhcp option group configuration view \[notes] run command no capwap ac to delete capwap ac option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# capwap ac 3 3 3 3 routers routers a b c d \[command] routers a b c d \[purpose] configure routers option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp pool configuration view/dhcp option group configuration view \[notes] only supports ipv4 addresses run command no routers to delete routers option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# routers 100 0 0 1 option43 hex option43 hex value force \[command] option43 hex value force \[purpose] configure option43 option \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp pool configuration view/dhcp option group configuration view \[notes] run command no option43 to delete routers option \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# option43 hex 10 force class class name address pool start ip end ip \[command] class name address pool start ip end ip \[purpose] configure dhcp user class ip range \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] dhcp pool configuration view \[notes] run command no class name address pool to delete dhcp user class ip range \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# class test1 address pool 100 0 0 110 100 0 0 150 class class name option group id \[command] class name option group id \[purpose] bind class and option group \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp pool configuration view \[notes] run command no class name option group to unbind class and option group \[use cases] sonic# configure terminal sonic(config)# dhcp pool test1 sonic(config dhcp pool t1)# class test1 option group 1 if match rule if match rule rule id option option id \[command] if match rule rule id option option id \[purpose] create user class matching rule \[parameters] true 169,492#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] dhcp class configuration view \[notes] run command no if match rule rule id to delete user class matching rule \[use cases] sonic# configure terminal sonic(config)# dhcp class test1 sonic(config dhcp class test1)# if match rule 1 option 93 hex ffff dhcp failover dhcp failover name \[command] dhcp failover name \[purpose] enable dhcp server failover \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no dhcp failover name to disable dhcp server failover \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 a a dddress { dddress { a b c d |loopback 0} \[command] adddress { a b c d | loopback 0 } \[purpose] configure local ip \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp failover configuration view \[notes] run command no address to delete local ip \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 sonic(config dhcp failover t456)# address 20 0 0 1 peer address peer address a b c d \[command] peer address a b c d \[purpose] configure peer ip \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp failover configuration view \[notes] run command no peer address to delete peer ip \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 sonic(config dhcp failover t456)# peer address 20 0 0 2 auto partner down auto partner down time \[command] auto partner down time \[purpose] configure peer offline time \[parameters] true 201,460#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp failover configuration view \[notes] run command auto partner down to disable peer offline function \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 sonic(config dhcp failover t456)# auto partner down 100 max response delay max response delay time \[command] max response delay time \[purpose] configure maximum communication interruption time \[parameters] true 110,551#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp failover configuration view \[notes] run command nomax response delay to restore maximum communication time to default value \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 sonic(config dhcp failover t456)# max response delay 100 role {primary|secondary} role {primary|secondary} \[command] role { primary|secondary } \[purpose] configure primary and secondary roles \[parameters] true 330,331#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] dhcp failover configuration view \[use cases] sonic# configure terminal sonic(config)# dhcp failover t456 sonic(config dhcp failover t456)# role primary
