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.
Ok, I am working this problem backwards. I have actually fixed it, but I am not sure what went wrong. In the interest of the learning process, I am hoping someone can explain it.
Last night I loaded Ubuntu Server on a PC I have. It's version 6.06 of the server. I loaded the server, then assigned a static IP address via the "interfaces" file. I then brought eth0 down and back up. All went well. It had the new static IP.
Around 5 minutes later, I couldn't SSH into the box. I looked, and it had set its IP back to a DHCP assigned address from my router. After checking all the settings and verifying, I decided to reboot the server.
Upon rebooting, all has been fine ever since. The interfaces file had not changed, and is still the same.
Any ideas why it kept using a DHCP address, even after it was initially working with the static IP address?
It's possible. The initial setup did not give the option of configuring the network card during the install, so it just grabbed an address from my router. I would have thought assigning a static IP, then cycling the interface would have stopped any IP address seeking but I am not sure.
I have dabbled with Linux for years, but have never dug deep into the processes and so forth. I am hoping to get that experience with this server.
Thanks for the reply! That gives me something to look into.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
dhclient is a runs as a process in the background, so simply doing if-down/if-up on the interface isn't going to stop it from running. It's not the interface itself that is looking for a DHCP lease, there's a program that's sending DHCP discovery requests across the network and happens to assign those values to the interface if it discovers them.
Thanks chort. So when I changed the interfaces file and specified static instead of DHCP, I should have killed the dhclient process as well it appears.
I assume the static line in the interfaces file told the system that dhclient wasn't needed upon reboot then?
Thanks again!
edit: Thanks Jim! One final question above... on the interfaces file. The static notation in the interfaces file is what told the server not to start the process seeking a DHCP address I assume? After the reboot it ran fine, and I obviously didn't do anything with the DHCP process as I didn't know it existed. The only thing I changed was the interfaces file.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by wgbjr
Thanks chort. So when I changed the interfaces file and specified static instead of DHCP, I should have killed the dhclient process as well it appears.
I assume the static line in the interfaces file told the system that dhclient wasn't needed upon reboot then?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.