Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Where I work, we're starting to investigate using Linux as a desktop platform (at the moment we're testing using Ubuntu), instead of Windows. However, a lot of our users have laptops, and we're having a strange problem with DCHP.
We have our lan split into different subnets; so for example, our finance department might have have IP addresses in the x.x.160.x range, while our IT department might have addresses in the x.x.64.x range, etc..
If a laptop is connected to the network when it boots up, it'll pick up an appropriate address via DHCP just fine. If you pull out the network cable, the machine detects that it's disconnected (verified by the Network Monitor panel applet). However, if we then take that laptop and reconnect it to the network from a connection in a different subnet, while the machine detects that it's reconnected, it doesn't automatically renegotiate a new address via DHCP, and attempts to use the old one.
If we do a manual release/renew using 'sudo ifdown eth0' followed by a 'sudo ifup eth0', then we get a valid new address fine; but the machine won't do this automatically.
I've had a look around via Google, but haven't found anything useful. Is there any way to set this up?
dhclient eth0
should grab an address automatically from your subnet's DHCP server. Thats a one step process. Otherwise you could put that into a shell script if you wanted to clickety-click.
Regards
Chris
Is there any way to get Linux to automate this though? I mean, for example under Windows, if a network connection has been disconnected, and then reconnected, Windows will go and contact the DHCP server to request a new address automatically - the user doesn't have to do anything, and after a few seconds their computer is up and working again, regardless of what subnet they're now connected to.
Thats odd, I have a dhcp server set up on my RedHat 9 box. It seems to be reassigned IP information whenever its disconncted(same goes for my WinXp computer). Maybe double check your dhcpd.conf file?
stakhous: Well in our case we're not running DHCP servers directly on the client machines - this problem is definitly something in the local Linux setup on each laptop.
homey: Thanks a million! Just downloaded and installed ifplugd, worked like a charm! If anyone else is having the same problem we are having, I recommend giving ifplugd a go, worked flawlessly here
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.