DHCP & Default route

Answered Question
Jun 22nd, 2009

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 7 years 8 months 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

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

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

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

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

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