LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-15-2007, 08:32 AM   #1
wgbjr
LQ Newbie
 
Registered: Jul 2002
Posts: 29

Rep: Reputation: 15
Static IP


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?

Thanks!
 
Old 02-15-2007, 08:35 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Is it possible that dhclient was still running in the background to get IP addresses?
 
Old 02-15-2007, 08:42 AM   #3
wgbjr
LQ Newbie
 
Registered: Jul 2002
Posts: 29

Original Poster
Rep: Reputation: 15
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.
 
Old 02-15-2007, 09:48 AM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
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.
 
Old 02-15-2007, 10:05 AM   #5
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Chort is entirely correct. Usually one of the first steps I take when building a debian server with static IP is
Code:
apt-get remove  dhcp-client dhcpcd
Then your static address will stick, instead of dropping back to a dhcp address.

Peace,
JimBass
 
Old 02-15-2007, 10:07 AM   #6
wgbjr
LQ Newbie
 
Registered: Jul 2002
Posts: 29

Original Poster
Rep: Reputation: 15
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.

Last edited by wgbjr; 02-15-2007 at 10:10 AM.
 
Old 02-17-2007, 04:22 PM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
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?
That's correct.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
Java: non-static variable this cannot be referenced from a static context chief_officer Programming 4 05-29-2006 01:37 PM
C++: difference between static method variable and static class variable? Thinking Programming 3 01-16-2006 10:08 AM
Is there any static ARP for static IP network? linux_lover2005 Linux - Networking 2 05-18-2005 12:01 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration