DHCP-based static routes

If you have configured your router as a DHCP client, you can use the default router option received in a DHCP reply as the next-hop for a static route. For example:
ip route 10.0.0.0 255.0.0.0 dhcp
You could use this functionality in scenarios where your core network uses DHCP (for example, in metropolitan networks using layer-2 Ethernet transport from an ISP), but your router needs a different default route.

You can also use this feature to change the administrative distance of the DHCP-based default route (or you could use the ip dhcp-client default-router distance value configuration command that one of the readers described in a comment to a previous DHCP-related post).

Any other good ideas where this might come handy? Post them as comments ...

4 comments:

  1. I hope IOS 12.4 should be able to support?
  2. According to CCO available in IOS release 12.3(8)T and 12.3(9).
  3. This is great option to have but the problem for me is after a DHCP address renew event. IOS doesn't seems to use the newly assigned gateway (my ISP use /30 address so the gateway always changes depending which /30 block you get from DHCP).
  4. Hi everyone,

    If I have two ISP with DHCP(that means two default routes) and I want to make one of those the Active ISP and another being the backup ISP, how can I achive that?

    Because "ip dhcp-client default-router distance value" changes the metric of ALL dhcp routes, so they both have the same metric, additionally using route-maps you cannot use "set ip next-hop verify-availability" because it is dynamic so you have to use set interface, and there is no Verify-availability for that.

    Any ideas?
Add comment
Sidebar