The ip route dhcp command configures a routing entry delivered by the DHCP server to a DHCP client.
The undo ip route dhcp command cancels the configuration.
By default, no routing entry is delivered by the DHCP server to a DHCP client.
ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ]
undo ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ]
Parameter |
Description |
Value |
---|---|---|
ip-address |
Specifies the destination IP address. |
The value is in dotted decimal notation. |
mask |
Specifies the mask of the IP address. |
The value is in dotted decimal notation. |
mask-length |
Specifies the mask length. The 32-bit mask is represented by consecutive 1s, and the mask in dotted decimal notation can be replaced by the mask length. |
The value is an integer that ranges from 0 to 32. |
interface-type interface-number |
Specifies the type and number of the interface that forwards packets. |
- |
dhcp |
Indicates that the DHCP client obtains routing entries using DHCP. |
- |
preference-value |
Specifies the priority of the routing protocol. |
The value is an integer that ranges from 1 to 255. |
The ip route dhcp command is used on DHCP clients. After the ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ] command is run, a route with the gateway address as the next-hop IP address is automatically generated when a DHCP client obtains an IP address from the DHCP server through a DHCP request.