cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4023
Views
4
Helpful
5
Replies

DHCP & Default route

kwillacey
Level 3
Level 3

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?

1 Accepted Solution

Accepted Solutions

Joseph W. Doherty
Hall of Fame
Hall of Fame

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

View solution in original post

5 Replies 5

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

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.

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

Joseph W. Doherty
Hall of Fame
Hall of Fame

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

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: