DHCP & Default route

Answered Question
Jun 22nd, 2009
User Badges:
  • Bronze, 100 points or more

Hi,


If I have an Ethernet interface, that connects to the Internet and acquires its IP address via DHCP, is it possible to have the router set its default route via DHCP?

Correct Answer by Joseph W. Doherty about 8 years 2 days ago

Within later IOSs, there's "ip route 0.0.0.0 0.0.0.0 dhcp", but don't recall caveats using it.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Giuseppe Larosa Mon, 06/22/2009 - 10:15
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Kelvin,

in this case you can try to use


ip route 0.0.0.0 0.0.0.0 fasx/y


where fasx/y is the "WAN" interface that gets an ip address via DHCP.


This can work if the ISP gateway has IP proxy ARP enabled


Hope to help

Giuseppe


kwillacey Mon, 06/22/2009 - 10:30
User Badges:
  • Bronze, 100 points or more

I know I can set it using the interface or by using a laptop to find what it is and set it to that, I'm just curious if there is anyway the router can do it.

Giuseppe Larosa Mon, 06/22/2009 - 10:36
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Kelvin,

you may be interested in the following commands

router(config-if)#ip dhcp client request static-route ?

dns-nameserver DNS nameserver (6)

domain-name Domain name (15)

netbios-nameserver NETBIOS nameserver (44)

router Default router option (3)

tftp-server-address TFTP server address (150)

vendor-specific Vendor specific option (43)


this should allow to ask for a default route or gateway in DHCP.


edit:


this is from a C2800


with

c2800nm-spservicesk9-mz.124-3i.bin



Hope to help

Giuseppe


Correct Answer
Joseph W. Doherty Mon, 06/22/2009 - 10:39
User Badges:
  • Super Bronze, 10000 points or more

Within later IOSs, there's "ip route 0.0.0.0 0.0.0.0 dhcp", but don't recall caveats using it.

kwillacey Mon, 06/22/2009 - 10:47
User Badges:
  • Bronze, 100 points or more

unfortunately c1841-advsecurityk9-mz.124-3i.bin does not support but it does support the option for ip route. that was so simple thanks Joseph and Giuseppe.

Actions

This Discussion