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?

    ReplyDelete
  2. According to CCO available in IOS release 12.3(8)T and 12.3(9).

    ReplyDelete
  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).

    ReplyDelete
  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?

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.