Operating System - Linux
1832542 Members
6068 Online
110043 Solutions
New Discussion

Re: dhcpc & default gateway

 
Tom Dawson
Regular Advisor

dhcpc & default gateway

I'm using RH 7.1 to connect to my ISP. The dhcp client is working. It gets the IP address and DNS server addresses. But the default gateway does not get updated, and, hence, I can not connect to the network. Any ideas on what configuration setting I might be missing?

TIA!
Tom
8 REPLIES 8
Eric Ladner
Trusted Contributor

Re: dhcpc & default gateway

Check the .info file created in /etc/dhcpdc and see it if has the gateway information in the file. This file is created by the dhcp daemon and should be sourced by the routines in /etc/sysconfig that crank up the interface.
Kodjo Agbenu
Honored Contributor

Re: dhcpc & default gateway

Hello,

Depending on the PPP version, you may add the "defaultroute" and possibly "replacedefaultroute" options in your /etc/ppp/options file (or in the pppd command line).

Good luck.

Kodjo
Learn and explain...
Tom Dawson
Regular Advisor

Re: dhcpc & default gateway

Kodjo,

This is an ethernet connection to a cable modem. So I am not using ppp. Thanks!

Eric,

I can see that the dhcpcd-eth0.info file is getting updated. Do you happen to know where that file should get sourced or where the routes should be built? I've added the info from dhcpcd-eth0.info to /etc/sysconfig/static-routes but that doesn't seem to help.

Thanks,
Tom
Stuart Browne
Honored Contributor

Re: dhcpc & default gateway

You say that you are connecting via Ethernet, what is then connecting to the Internet?

Are you connecting via an ADSL/Cable router, which is what is doing the IP serving? if so, that is where you should be looking for the default gateway assignment.

The DHCP server is what should spit out those details. If it was another linux box answering DHCP, it would be because the 'dhcpd.conf' doesn't have a valid 'option routers ;' line.

If using some kind of router, it will be very specific to that router.
One long-haired git at your service...
Jason B.
New Member

Re: dhcpc & default gateway

I don't know anything about how to setup dhcp... but I do know how to set the default gateway!

route add default gw 192.168.1.1

I know this doesn't answer you orig. question, but I hope it helps all the same : )

Jason B.
Eric Ladner
Trusted Contributor

Re: dhcpc & default gateway

That file is sourced in the files in the directory /etc/sysconfig/network-scripts (or something like that).

Look for the ifup script. It mentions DHCP a lot and I believe that's where the file is referenced. (don't have my Linux box in front of me at the moment).
Bernie Vande Griend
Respected Contributor

Re: dhcpc & default gateway

Tom, where is the DHCP server? Your ISP? The easiest way to resolve this is to change the DHCP server so that is includes the router so it automatically updates your default router setting. As was mentioned earlier, if the master DHCP server was Linux, this is done by including a "option routers 192.168.1.1;" (or whatever your router is) in /etc/dhcpd.conf.
Ye who thinks he has a lot to say, probably shouldn't.
Ron Kinner
Honored Contributor

Re: dhcpc & default gateway

Guys,

He got this fixed. His box was running a firewall which blocked him. See his other post called Routing Experts.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xea7850011d20d6118ff40090279cd0f9,00.html

Ron