Eth0 Config Keeps Changing!

Issues related to configuring your network
Post Reply
smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/24 20:21:37

Centos 6 on a new Dell Poweredge. I had earlier tested this on our local network, worked fine, connected to the Internet, I could SSH into it, and etc. But now that I'm ready to go live with this new server, it's about to drive me crazy.

In a nutshell: I removed Network Manager (following the instructions in a Web search, "yum remove NetworkManager"). I edited my /etc/sysconfig/network-scripts/ifcfg-eth0 file to add the line "NM_CONTROLLED=no." Using the system-config-network-tui program, I've set (and reset) the DNS info, the IP address, netmask and gateway info repeatedly. Each time I reboot, something changes.

Someone or something is altering my settings.

This most recent attempt: system-config-network-tui clearly shows that the netmask is set to 255.255.255.248, but I can't get onto the Internet, and an "ifconfig" at the prompt shows a network mask of 255.0.0.0! Earlier, my resolv.conf file kept being ovewritten by "NetworkManager," even though network manager has been uninstalled. (How can that be???!)

Here is the content of my ifcfg-eth0 file.

GATEWAY=173.8.230.38
IPV6INIT=no
NM_CONTROLLED=no
HWADDR=78:2b:cb:51:7a:05
DNS2=68.87.69.146
BROADCAST=173.8.230.39
USERCTL=no
DNS1=68.87.85.98
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
PREFIX=8
NETMASK=255.255.255.248
DEFROUTE=yes
IPADDR=173.8.230.34
NETWORK=173.8.230.32
IPV4_FAILURE_FATAL=yes
ONBOOT=yes

And to prove I ain't making this up, here's an ifconfig:

eth0 Link encap:Ethernet HWaddr 78:2B:CB:51:7A:05
inet addr:173.8.230.34 Bcast:173.8.230.39 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2933 errors:0 dropped:0 overruns:0 frame:0
TX packets:2039 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2033705 (1.9 MiB) TX bytes:209949 (205.0 KiB)
Interrupt:36 Memory:d6000000-d6012800

How can this be???

smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Re: Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/24 21:00:31

By the way, just to clarify, the "ifconfig" shown above was right after a full reboot. The problem, obviously, is that with that wide-opened netmask, all IP addresses in the 173.0.0.0 network are being ARP'd instead of routed through the gateway. So, when I try (for example) to go to Google.com, which returns a 173 address in colorado (where this server is located), I get "network unreachable." ARP tries to find the google IP address, but it's remote and should be routed through the gateway.

I can get into the server with SSH, so my statement that "I can't get onto the Internet" wasn't strictly accurate. Sorry about that.

I had Webmin on there, but I uninstalled it. I wonder if he left something in there that's messing with me?

smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Re: Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/25 02:00:41

OK, here's another clue. I left the FTP server and moved over to a (virtually identical) new Web server, also a Dell Poweredge with CentOS 6 on it. Every time I restart the network, resolv.conf looks like this:

# Generated by NetworkManager
search loc


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 68.87.85.98
nameserver 68.87.69.146

I can edit out everything but the two nameserver lines, but as soon as I do a "service network restart," what you see above reappears. Something is overwriting my work, and it's beginning to frustrate me.

NetworkManager has been uninstalled on this machine as well, with yum remove NetworkManager. I did a great big honkin' "grep -r" search for NetworkManager and (of course) found the resolv.conf file in /etc/sysconfig/networking/default. I have edited that, too, but to no avail. As soon as I restart the network, the crap you see above reappears in resolv.conf.

How in the world can this still be happening???

I've about decided that the Network Manager is one of the most evil pieces of software ever inflicted on the computing community. It looks like my problem is that it leaves artifacts hidden all over the system EVEN AFTER IT HAS BEEN UNINSTALLED, so I've got to find and snuff them all. Sigh.

For those who are wondering: I don't want Network Manager because (A), once these servers are up and running, there will be no GUI. It'll be runlevel 3 all the time. (B), I administer them by SSH and you can't easily get at Network Manager that way.

If I'm being a dunderhead, and someone knows of a way to get at Network Manager via a SSH terminal, I'm all ears. I'll surrender and use it. :)

smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Re: Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/25 02:06:21

ROFL!!!! HA HA!! Not trying to be a pest, but this has actually become amusing. I'll leave you with this snippet, then I think I need to run over to TUV and file a bug report. (I've seen some over there about NetworkManager being enabled even on a machine with no GUI, but I feel like waving my arms and screaming a little, anyway. It'll do me good.) :)

Here you go:

[root@www etc]# nano resolv.conf (this is where I edit resolv.conf to eliminate the garbage ...)
[root@www etc]# chmod ugo-w resolv.conf (make it READ ONLY for EVERYONE)
[root@www etc]# ls -al resolv.conf (sure enough ...)
-r--r--r-- 1 root root 68 Oct 24 20:02 resolv.conf
[root@www etc]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@www etc]# cat resolv.conf
# Generated by NetworkManager
search loc


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 68.87.85.98
nameserver 68.87.69.146
[

HAH! HAHAHAH!

smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Re: Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/25 20:28:20

OK, final post. Don't know whether to call this a bug or a feature. On the upstream's bugzilla, several people reported that, if you're trying to install a text-only system, Network Manager seemed to be enabled by default (which was problematic, to say the least). I solved by problem by re-installing with text-only. No Gnome, no KDE. I then went into ifcfg-eth0 (and others) and made sure the line "NM_CONTROLLED=no" was in there. (This has been reported to TUV as a bug, and it seems to be true.)

Now system-config-network-tui seems to set things up and it works nicely. No more magical resolv.conf and ifcfg-eth0 changes. Whew.

What I had wanted was to give the folks out there in Denver, where the server is physically located, some GUI tools in case they needed to add a user or make other minor changes. I would do most administration remotely via SSH, and I didn't want Network Manager arguing with my changes.

Someone here who actually knows some people at the Upstream Vendor needs to point out that most servers are going to use straight-up Ethernet, so the Network Manager (which was supposedly developed to handle many more connection options) isn't needed, certainly not on a headless or text-only server. The fact that they've been removing text-based config tools (like Linuxconf) for years is annoying enough.

Thanks for listening. I wanted to report this one SOLVED (or at least, "worked around") in case someone hit this in a Web search.

User avatar
TrevorH
Site Admin
Posts: 33225
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Eth0 Config Keeps Changing!

Post by TrevorH » 2011/10/25 22:41:22

It's possible to have a GUI system without Network Manager. I just built (am building) an xbmc system and used CentOS 6 for it. It has gnome running with xbmc on top and I have no Network Manager installed.

smpoole7
Posts: 85
Joined: 2009/01/16 17:08:46
Contact:

Re: Eth0 Config Keeps Changing!

Post by smpoole7 » 2011/10/27 16:53:01

Trevor,

Apparently, the problem is if you installed Network Manager initially and then try to uninstall it. I followed the precise instructions that I found in multiple Web searches: yum remove NetworkManager, then confirm that "NM_CONTROLLED=no" in the ifcfg files. But it seems that if you've ever had Network Manager activated, it does things to the system that just can't be easily undone.

It's possible that having Webmin installed on there might have done something, too. I uninstalled that, though, and it didn't seem to make a difference. We finally just reinstalled the OS with the "simple server" text only settings.

Also, just for the record, I did figure out one problem in the ifcfg-eth0 file above: you can't have prefix=8 and netmask=255.255.255.248. The "prefix" was apparently overriding the netmask specification. Apparently, though, when I used system-config-network-tui to set up the network, it didn't delete or correct that prefix= setting.

Post Reply