LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-12-2008, 02:40 AM   #1
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
DHCP overriding my static IP configuration


Hi everyone its been a long while since I have been on here, even though I am using Linux for 95% of the time (I guess its getting that good!)

I have a static IP configured I have put my config below:

Quote:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
#iface wlan0 inet dhcp

auto eth0

iface eth0 inet static
address 10.0.0.10
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
Every time I restart the computer or my router it gets a dhcp address, the only trick I have found is that if I stop
Quote:
/etc/init.d/networking stop
and
Quote:
/etc/init.d/networking start
I get my static ip back again until the next time I turn off either the router or the computer.

Could anyone give me any ideas whats overriding the static ip or if I have it badly configured?
 
Old 12-12-2008, 03:09 AM   #2
JosipBroz
Member
 
Registered: Nov 2008
Location: Ljubljana
Distribution: OpenSuSE
Posts: 56

Rep: Reputation: 18
Have you checked in your router that there is no overlapping between its DHCP range and your static IP?
 
Old 12-12-2008, 03:39 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Is it stacking resolv.conf's? If so, the running resolv.conf should contain the details of (the last program) that has stacked it.

Alternatively, are you running dhcpd/avahi or something?

Quote:
no overlapping between its DHCP range and your static IP?
I'm guessing, but I don't think that would do this; it would go wrong if/when two devices got the same ip, but I don't see how the router on its own can change your computer's IP (unless you are running some program which expects to pick up an ip from dhcp, of course).
 
Old 12-12-2008, 05:56 AM   #4
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Hi again,

@JosipBroz the ip addresses are not overlapping. The router is giving out addresses starting at 10.0.0.11 and my static ip is 10.0.0.10 (Which gets changed by dhcp all the time to 10.0.0.11)


Its interesting if I stop dhcdb which I understand is the client side DHCP demon:
Quote:
/etc/init.d/dhcdbd stop
When I reboot the router eth0 doesnt have ANY ip!

@salasi
I think that I have left all the networking configuration standard. I am not sure what you mean by stacking resolv.con but here are the contents of my resolv.conf

Quote:
debby:/home/adam# cat /etc/resolv.conf
### BEGIN INFO
#
# Modified_by: NetworkManager
# Process: /usr/bin/NetworkManager
# Process_id: 3696
#
### END INFO

nameserver 10.0.0.1
 
Old 12-13-2008, 07:16 AM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by jimdaworm View Post

@salasi
I think that I have left all the networking configuration standard. I am not sure what you mean by stacking resolv.con but here are the contents of my resolv.conf

Quote:
debby:/home/adam# cat /etc/resolv.conf
### BEGIN INFO
#
# Modified_by: NetworkManager
# Process: /usr/bin/NetworkManager
# Process_id: 3696
#
### END INFO

nameserver 10.0.0.1
this is exactly what I mean: whatever you set up as resolv.conf (prior to NM running), NetworkManager has been at it, via the OS call to do exactly this, pushed the pre-network-manager version onto the stack and run its own version for the duration. if you look at mine under similar circumstances (running kde and NM active):

Quote:
### BEGIN INFO
#
# Modified_by: NetworkManager
# Process: /usr/bin/NetworkManager
# Process_id: 2900
#
### END INFO



nameserver 192.168.1.34
nameserver 192.168.1.1
but is otherwise similar. However, if you open NM, you'll see it also takes control of IP, Netmask, broadcast address (err, and MAC address).

I think if you you want to run NM, you can set the static address in there and it'll work (until the next time you have a non-clean shutdown, and then you might have to re-write resolv.conf, so you might need want to take a backup copy when NM isn't running).
 
Old 12-13-2008, 10:36 AM   #6
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Hey salasi

Thanks for your help, it seems to be behaving its self now. I went into the network manager and even though it was already set to static IP I configured it again and applied the settings.

I have restarted my router and still have my static ip. I guess it could be some sort of a bug with the NM if you manually edit the settings and put a static IP.
 
Old 12-13-2008, 01:02 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I guess it could be some sort of a bug with the NM
NM was so buggy I uninstalled it.
If you'd like a NM that works look into wicd
http://www.wicd.net/
It is excellent.
 
Old 12-14-2008, 01:56 PM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
This is going back some years, but back in Sarge, if you allowed DHCP to set an address during install, then tried to configure a static afterwards, you would see exactly the problem you described. The installation would set up dhcp-client which would run on reboot even though you had set static. Since dhcp would run at boot, you'd lose your static.

The solution was to uninstall what was then dhcp-client, and now appears to be called dhclient3 on unstable. If you need the dhclient, then you need to edit your startup and make sure nothing uses dhclient.

Peace,
JimBass
 
Old 12-14-2008, 05:04 PM   #9
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Thumbs down

@tredegar thanks for the info although it seems to be behaving its self since I re-configured eth0 with the KDE NM.

@JimBass I did read something about what your describing but when I saw the dates (at least 2 years ago) I figured this issue must have been fixed. Anyway its keeping the static now

Last edited by jimdaworm; 12-14-2008 at 05:06 PM.
 
  


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
dhcp overriding my resolv.conf Eppo Linux - Networking 1 09-25-2008 10:15 AM
static or DHCP? penguinista Linux - Security 6 11-26-2007 12:54 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
dhcp -> static ip configuration. linux_faq Linux - Networking 1 07-04-2004 12:16 AM
DHCP to static IP ?? davepal Linux - Networking 1 04-21-2004 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:44 PM.

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