[SOLVED] Disable dhcp polling for eth0 at boot up?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
During installation I set eth0 to use dhcp to get an IP address. I then installed gnome and networkmanger which handles my interfaces and works fine. But during bootup the system pauses for 5 seconds or so while it polls for dhcp. It then times out and gives me a 169.254.xx which is then replaced when networkmanager starts up at the end of bootup.
How do I stop the polling to cut out the 5 seconds?
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
Quote:
How do I stop the polling to cut out the 5 seconds?
I you want to stop polling for dhcp on boot you need to change USE_DHCP[0]="yes" to USE_DHCP[0]="" in /etc/rc.d/rc.inet1.conf. This will stop dhcpcd running.
I you want to stop polling for dhcp on boot you need to change USE_DHCP[0]="yes" to USE_DHCP[0]="" in /etc/rc.d/rc.inet1.conf. This will stop dhcpcd running.
Very nice! The polling must have been taking longer to timeout than I noticed because that reboot was probably half of all the previous boots.
Thank you.
EDIT: That's also a nice file to know about. The init scripts have always made me a little nervous. It's probably time I start poking around to see what's going on in there.
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
Quote:
EDIT: That's also a nice file to know about. The init scripts have always made me a little nervous. It's probably time I start poking around to see what's going on in there.
Yes - the init scripts are useful. If you wanted a dialogue driven script to do the same you can always run netconfig as root which is the same as what the installer does however editing the configuration file gives more control. Glad you got it worked out so quickly.
I did not set eth0 to use dhcp to get an IP address during installation, but after I change my mind.
But I didnt know about USE_DHCP[0]="" in /etc/rc.d/rc.inet1.conf so I put in /etc/rc.d/rc.local a link of this script
Code:
#!/bin/bash
echo "Starting internet conection...";
ifconfig eth0 up && dhclient eth0
ifconfig eth0
I am wondering, if there is any problem with that?
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
That's OK - but not really the Slackware default way of doing this. The Slackware scripts look at rc.inet1.conf for their configurations and it's here you make your settings. Slackware by default uses dhcpcd as it's dhcp client rather than dhclient. Also the included scripts have facilites to up or down interfaces from the command line.
So in a nutshell I would advise you to either run netconfig or manually change /etc/rc.d/rc.inet1.conf and disable you changes to rc.local. This will be more compliant with a stock Slackware setup.
That's OK - but not really the Slackware default way of doing this. The Slackware scripts look at rc.inet1.conf for their configurations and it's here you make your settings. Slackware by default uses dhcpcd as it's dhcp client rather than dhclient. Also the included scripts have facilites to up or down interfaces from the command line.
So in a nutshell I would advise you to either run netconfig or manually change /etc/rc.d/rc.inet1.conf and disable you changes to rc.local. This will be more compliant with a stock Slackware setup.
dhcpcd does not work for me, I have no idea why. dhclient using wicd DOES work. What effect would it have on my networking if I disable dhcpcd for ALL network devices (includng wireless) in rc.inet1 and just use dhclent in wicd to connect each time?
Bob
Last edited by BobNutfield; 04-21-2010 at 04:12 PM.
dhcpcd does not work for me, I have no idea why. dhclient using wicd DOES work. What effect would it have on my networking if I disable dhcpcd for ALL network devices (includng wireless) in rc.inet1 and just use dhclent in wicd to connect each time?
Bob
You will not be able to automatically mount remote drives (NFS, CIFS, or SMB) listed in /etc/fstab as part of startup. The services started in rc.inet2 may not be able to start or will not start correctly if none of your network connections are up.
Thank you, hope I am not hijacking the thread. But I did not mean no networking at all. I get connected just fine to both my home network and the net, but dhcpcd will not give ne an IP address. I DO get a DHCP address when I use dhclient with wicd. dchpcd is started automatically at boot, but just results in errors. Once the boot process is complete, I just connect with wicd with dhclient. My question was about just disabling dhcpcd, not networking all together. I am getting SMB connections to other computers on my home network using the method I am using.
In other words, your gateway has given you an IP address but you aren't getting it.
What is the result of...
Code:
ls -lart /etc/dhcpc
...?
No, the gateway is not giving me an address using dhcpcd. It results in:
Code:
err, wlan0: Option 43 has zero length
err, wlan0: could not parse packet
It repaeats that several times, then times out. However, when I reach the desktop, disconnect from the failed address of 169.254..15.XX, then reconnect using wicd, which I have configured to use dhclient instead of dhcpcd, it does in fact give me the address of 192.168.1.40, which connects me to my home network and the net. I could be wrong, but I do not think this problem can be solved. I am not worried as long as I can connect. What I was asking is what the effect would be of disabling dhcpcd since I am not using it.
Thank you for your assistance, but I am not sure I am being clear. I DO get an IP address, but only when using wicd with dhclient, and not dhcpcd. Slackware defaults inet1 to using dhcpcd when the opetion USE_DHCP="yes" is used. It is when inet1 broadcasts for a lease that I get this error message and it times out to an "unconnected" IP address of 169.XXX.XXX.XX. I do not have to query the gateway (my router) to confirm whether I have an IP addrress. I am given 192.168.1.40, but ONLY when I connect with dhclient through wicd. In short, if dhcpcd broadcasts for a lease, it does not obtain one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.