Redhat – RHEL6 “/etc/sysconfig/networking” is missing, can’t configure any devices through system-config-network

networkingredhatrhel6

I'm having an issue configuring networking for my RHEL6 box.

Whenever I run "system-config-network" -> "Device configuration" I get nothing there, like I dont have any ethernet devices, when I look for my eth* through dmesg I dont see anything there either… BUT! if I do

ifconfig eth0 up
ifconfig eth1 up

all of the sudden I have these two interfaces up and running, I did noticed that my /etc/sysconfig/networking/ is empty though, so I think it has something to do with that, but how do I tell RHEL6 to recreate those files?

any ideas?

Best Answer

That happened to me a while ago. Just do this as root: (This is CentOS 6)

1) Get the MAC Address of the desired device: ip link show <device_name> (Thanks to @Mike Pennington for pointing out this command).

2) nano /etc/sysconfig/network-scripts/ifcfg-eth0 (if it doesn't exist, it doesn't matter, continue because nano will let you create the file)

3) Insert the next lines:

DEVICE="eth0"
HWADDR="**YOUR_MAC_ADDRESS**"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO="dhcp"

4) Save and exit nano

5) ifdown <device_name> (e.g. ifdown eth3)

6) ifup <device_name> (e.g. ifup eth3)

7) Check that an IP Address has been assigned to your device by issuing the command ip addr

Now you should have everything working. In any case run the command lspci in order to look all the devices and the ethernet should appear correctly.

If you want, run the command system-config-network to setup the new device, but if you do this go a check the file /etc/sysconfig/network-scripts/ifcfg-eth0 again and see that the format is correct, something like this:

DEVICE=eth0
NM_CONTROLLED=no
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
UUID=2gb02bd0-0bb0-8fgb-40f2-d6edd65f3e03
ONBOOT=yes
HWADDR=03:90:17:c0:41:34
PEERROUTES=yes

If you have any errors post them here and we'll check.