Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a linux server (centos 5) which for the past 2-3 weeks has been resetting it's ip config information to a local ip (192.168.x.x). In /etc/network/interfaces I have:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 172.20.10.10
netmask 255.255.255.0
gateway 172.20.10.1

So, i would have thought this would sort the problem. I have also tried running a reset of the details at 7am each morning with a cron:

0 7 * * * route add default gw 172.20.10.1 eth0
0 7 * * * ifconfig eth0 172.20.10.10 netmask 255.255.255.0

But that doesn't seem to work either.

cat /etc/sysconfig/network:

NETWORKING_IPV6=no
NETWORKING=yes
HOSTNAME=localhost.localdomain

cat /etc/sysconfig/network-scripts/ifcfg-eth0:

TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=172.20.10.10
HWADDR=00:16:17:d6:31:f9
GATEWAY=172.20.10.1
DHCP=no
PROBE=no

The server is on a managed VPN (i think) inside a building of offices. We aren't aware of any DHCP servers and it's only been happening for 2-3 weeks. The building's network admins say they haven't changed anything that would affect it and we can't think of anything we have done either.

Any help would be much appreciated as I'm really stuck!

UPDATE 1

Noticed this in boot.log:

May 17 02:02:43 localhost NET[30723]: /sbin/dhclient-script : updated /etc/resolv.conf

So, i've had a look at /etc/resolv.conf and I get this:

; generated by /sbin/dhclient-script
nameserver 192.168.1.1

UPDATE 2

If read a little more about dhclient-script and it's called by dhclient which references dhclient.conf. I think it looks for it in /etc/. The only one i can find on our serve is at /etc/dhcp/dhclient.conf and it contains:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 172.20.10.10
netmask 255.255.255.0
gateway 172.20.10.1
share|improve this question
    
Any related information from system logs? –  Khaled May 17 '12 at 9:26
    
@Khaled Interstingling, we have this in boot.log: May 17 02:02:43 localhost NET[30723]: /sbin/dhclient-script : updated /etc/resolv.conf –  David May 17 '12 at 9:28
    
Is this server rebooted every night? –  Sirch May 17 '12 at 11:23
    
@Sirch no, the server is left on –  David May 17 '12 at 11:35
    
Maybe centos has the same bug as some debian releases: if you change an interface from dhcp to static and restart networking or ifdown & ifup, the dhcp client is left running until killed and will reset things when you least need it. –  rackandboneman May 17 '12 at 14:13

1 Answer 1

up vote 1 down vote accepted

The fact that dhclient-script is being called makes me think that NetworkManager service is running, /etc/network/interface's DHCP=no is keeping the iface scripts from being rewritten the way that resolv.conf is, but it isn't preventing dhclient-script from running ifconfig commands and getting at the actual interface configuration.

Here is a CentOS mailing list link about such a thing: http://lists.centos.org/pipermail/centos/2009-November/086566.html and what the author would have you do, if I am correct.

/sbin/service NetworkManager stop

chkconfig NetworkManager off

share|improve this answer
    
Well, I killed the dhclient process and that seems to have done the trick. I tried running those commands but there isn't a service by that name. So, whatever it is, its dhclient and i image its getting started on bootup. –  David May 18 '12 at 8:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.