DHCP Response Sets the Default Route

It makes perfect sense in hindsight, but I was nonetheless pleasantly surprised: when the router acting as a DHCP client (configured with the ip address dhcp interface configuration command) receives the DHCP reply packet containing the default gateway option (option #3), it installs a static default route toward that next-hop.

Even better, the default route is installed with the administrative distance 254 (floating static route), making sure that the default route you’ve configured manually or the default route received via a routing protocol are not overwritten.

To add icing on the cake, starting with IOS release 12.3(8)T you can disable this behavior with the no ip dhcp client request router interface-configuration command.

The following listing contains a sample debugging session documenting this behavior:

DHCP: Received a BOOTREP pkt
DHCP: Scan: Message type: DHCP Ack
DHCP: Scan: Server ID Option: = C0A80001
DHCP: Scan: Lease Time: 86400
DHCP: Scan: Renewal time: 43200
DHCP: Scan: Rebind time: 75600
DHCP: Scan: Host Name: r4.company.com.
DHCP: Scan: Subnet Address Option:
DHCP: Scan: Router Option:

... deleted ...

DHCP: Server ID Option:
DHCP Host Name Option: r4.company.com.
DHCP: Releasing ipl options:
DHCP: Applying DHCP options:
  Setting default_gateway to
  Adding default route
Allocated IP address =

%DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address, mask, hostname r4

r4#show ip route
Routing entry for, supernet
  Known via "static", distance 254, metric 0, candidate default path
  Routing Descriptor Blocks:
      Route metric is 0, traffic share count is 1


  1. Is there any way to change the metric on a dhcp assigned route?
  2. To fix the metric do this on the interface that the dhcp assignment is coming from:
    interface Vlan2
    ip dhcp client default-router distance 200
  3. this solves my problem when having multiple interfaces configured as dhcp clients on different subnet.
    on the other hand, is there anyway to set hdcp server side NOT to push default-gateway?

    1. Sure. Don't specify the default gateway option in the DHCP server configuration. How to do that depends on the DHCP server you use.
Add comment