LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Obtain IP when DHCP is down (https://www.linuxquestions.org/questions/linux-networking-3/obtain-ip-when-dhcp-is-down-17784/)

joadoor 04-05-2002 09:22 AM

Obtain IP when DHCP is down
 
Hope someone can help.

When a DHCP server is down, is it possible for a client machine to bypass the LONG delay in waiting for an IP and carry on and boot up. It currently takes about 2-3 minutes for it to work out that the DHCP server is not available.

I have a PC that has a DHCP server running that I sometimes don't want to turn on (it's upstairs), but just want to just go into my PC downstairs.

Sorry if this doesn't make sense, its a bit hard to explain.

acid_kewpie 04-05-2002 10:00 AM

well it naturally depends which dhcp client you are using. if you're on pump, you should edit (or create) an /etc/pump.conf containing a suitable timeout= line. check the manpage for more info. I've been trying to suss out quickly how to do it with dhcpcd, but the manpage doesn't mention a config file to edit. you can specify a timeout on a command line iwth the -t option. you might want to look at the /sbin/ifup script to find out what's going on. (the dhcp client will be called from inside there. in there there are options to use the dhcpcd timeout from a preset environment varible, but i'm not really sure where that's meant to have come from. you could always just hardcode the value inside that script, or i guess you could add it to /etc/rc.sysinit or something...

tarballedtux 04-05-2002 08:48 PM

Whats funny is by default Windows does a better job at downed DHCP servers by giving out it s -->RESERVED!<-- ip address 169.x.x.x

Strange ehh.

finegan 04-06-2002 05:27 AM

Yeah, but the DOS based windows have to be rebooted to configure it with a static as its not really compliant with the RFC for dhcp, but really runs off of BOOTP. Also, you might want to change your /etc/sysconfig/network-scripts/ifcg-eth0 file and take it off dhcp. You can invoke the client from the command line easily enough with dhcpcd, or put that in rc.local, which runs last, and if you check the man page on dhcpcd, I'm pretty certain there's an option you can pass it to shorten the time-out wait period to something reasonable like 10 seconds instead of the default... 60 I think?

Cheers,

Finegan

acid_kewpie 04-06-2002 06:00 AM

i guess that'd be where the DHCP_TIMEOUT values go then, that are checked for by ifup.

finegan 04-06-2002 06:05 AM

Quote:

Originally posted by acid_kewpie
i guess that'd be where the DHCP_TIMEOUT values go then, that are checked for by ifup.
<Begin Homer Slap>
Doh!
</End Homer Slap>

I knew there was a cute /etc/sysconfig script for it. I always duck using those. I gotta stop posting mixtures of the two.

Cheers,

Finegan

joadoor 04-12-2002 10:46 AM

sorry, been away this week.

thanks everyone ... i'll try tinkering with a few settings this weekend (if i get chance) and let you know.
:rolleyes:

joadoor 04-15-2002 06:50 AM

I first tried putting DHCP_TIMEOUT=10 in the ifcfg.eth0 file, but it had no effect.

I then had a browse at the /etc/rc.sysinit file (which I think is similar to the autoexec.bat / config.sys files), and I noticed a section dealing with DHCP. One line seemed to have options that are passed to the called DHCPCD command, so I added:

-t 10

to set a time-out of 10 seconds, and hey-presto it worked !!
Cool.

One quick ?, is there a similar command like WINIPCFG or IPCONFIG that I can run to check out the IP address in RHLinux?

Once again, thanks for all your help.
Andy

Mik 04-15-2002 07:02 AM

Try ifconfig.

If you want to see all the information retrieved by the dhcpc then there should be a file in the /etc/dhcpc directory called dhcpcd-<interface>.info
The name depends on how things are configured but just look around and I'm sure you'll find it.

L33t_H4x0R 04-15-2002 07:04 AM

ifconfig does a similar job to WINIPCFG or IPCONFIG on windows.

You can normally only run it as root though, and it does a load more stuff than either of the windows utils - so be careful!

Running it without command line arguments should be safe enough - it brings up a list of all your network adaptors, so on a typical machine it would bring up eth0, ppp0 (if you're dialed up to the net) and lo0 (the loopback adaptor) - and along with the list - you get all the info about each adaptor, including the IP address.

Enjoy!

Bry

joadoor 04-16-2002 03:25 AM

Cheers guys.


All times are GMT -5. The time now is 01:21 AM.