NIC does not get ip address from ifcfg-ethx

Issues related to configuring your network
Post Reply
tripialos
Posts: 30
Joined: 2012/04/03 11:06:46

NIC does not get ip address from ifcfg-ethx

Post by tripialos » 2014/03/26 15:03:53

Greetings

I am facing a first time issue with a NIC card in a Centos 5.9 final system.

The ifcfg-eth0 script is as per below:

Code: Select all

$cat /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
TYPE=Ethernet
IPADDR=192.168.0.52
Unfortunately when i boot the system it simply wont get the ip address :

Code: Select all

eth2      Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet6 addr: XXXX<omitted>XXXXX   Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:594 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:54472 (53.1 KiB)  TX bytes:1275 (1.2 KiB)
          Interrupt:82 Base address:0x8000 

Any chance where to look and how to troubleshoot this?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: NIC does not get ip address from ifcfg-ethx

Post by gerald_clark » 2014/03/26 16:43:58

service NetworkManager stop
service network restart
chkconfig NetworkManager off
chkconfig network on

Hiding details on a private network only delays or denies assistance.
Show the output of 'ifconfig -a'.

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

Re: NIC does not get ip address from ifcfg-ethx

Post by TrevorH » 2014/03/26 16:49:33

Your ifcfg file should have a HWADDR= line in it with the MAC address from your ifconfig output in it
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

tripialos
Posts: 30
Joined: 2012/04/03 11:06:46

Re: NIC does not get ip address from ifcfg-ethx

Post by tripialos » 2014/03/27 09:42:54

gerald_clark wrote:service NetworkManager stop
service network restart
chkconfig NetworkManager off
chkconfig network on

Hiding details on a private network only delays or denies assistance.
Show the output of 'ifconfig -a'.
Hi gerald

NetworkManager is not running on the relevant system, it is a headless machine without any Desktop GUI
I cant restart the network because i will lose the ssh connection.
Nevertheless if i add the ip address "by hand" it works, meaning the interface gets the ip but if i restart the system it then fails to get the ip address.

I don`t really understand the "hidding detailsd on private networks" means but as you requested here is the output of ifconfig -a

Code: Select all


eth0      Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.33.102  Bcast:192.168.33.255  Mask:255.255.255.0
          inet6 addr: fe80::a298:5ff:fe01:c5b1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34366 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50019 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4395233 (4.1 MiB)  TX bytes:5627162 (5.3 MiB)
          Interrupt:66 

eth0:5    Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.33.254  Bcast:192.168.33.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:66 

eth1      Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:74 Base address:0x6000 

eth1:1    Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.159.1  Bcast:192.168.159.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:74 Base address:0x6000 

eth1:5    Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.2.254  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:74 Base address:0x6000 

eth2      Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet6 addr: fe80::a298:5ff:fe01:c5b3/64 Scope:Link           <-------------it should have an inet 192.168.0.52
          UP BROADCAST RUNNING MULTICAST  MTU:1360  Metric:1
          RX packets:38717 errors:0 dropped:0 overruns:0 frame:0
          TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4333446 (4.1 MiB)  TX bytes:8237 (8.0 KiB)
          Interrupt:82 Base address:0x8000 

eth2:5    Link encap:Ethernet  HWaddr XXXX<omitted>XXXXX  
          inet addr:192.168.0.254  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:82 Base address:0x8000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:34340 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34340 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3278762 (3.1 MiB)  TX bytes:3278762 (3.1 MiB)
The system has 3 NIC and i am using heartbeat hence the ip-aliases above. This was working fine for about a year up until yesterday. As you can see the alias ip does get assigned the designated ip but not the actual interface which is weird.


TrevorH wrote:Your ifcfg file should have a HWADDR= line in it with the MAC address from your ifconfig output in it
all other ifcfg-ethx files do not have the HWADDR parameter on their config files and working fine without any issues. Thing is that i dont have any indication on logs or messages in order to troubleshoot

:-S

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: NIC does not get ip address from ifcfg-ethx

Post by Super Jamie » 2014/03/27 09:53:08

HWADDR lines are how the udev companion tools persistently name network devices on EL5.

All your ifcfg-* files should have HWADDR in them, and you should add the HWADDR lines if they are not there.

tripialos
Posts: 30
Joined: 2012/04/03 11:06:46

Re: NIC does not get ip address from ifcfg-ethx

Post by tripialos » 2014/03/27 12:06:12

Super Jamie wrote:HWADDR lines are how the udev companion tools persistently name network devices on EL5.

All your ifcfg-* files should have HWADDR in them, and you should add the HWADDR lines if they are not there.
Added the HWADDR parameter but still no luck

dam this has started giving me headaches :-S

kquigley410
Posts: 1
Joined: 2016/05/26 18:52:01

Re: NIC does not get ip address from ifcfg-ethx

Post by kquigley410 » 2016/05/26 19:00:54

Has this been resolved? I am having the same problem with Centos 7 x86_64. The network addressing does not appear to pull from /etc/syslog/network-scripts/ifcfg-eth0 (config below):

cat ifcfg-eth0
TYPE=Ethernet
BOOTPROTO-none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=4a18ff6a-36de-4531-b9a0-9a166bcf114a
DEVICE=eth0
ONBOOT=yes
HWADDR=A4:BA:DB:E8:71:4E
IPADDR:172.20.21.189
PREFIX=24
GATEWAY=172.20.21.1
DNS1=172.20.18.13
IPV6_PEERDNS=no
IPV6_DEFROUTE=no
IPV6_PRIVACy=no

I have to load the IP and GW manually after every reboot. It's a pain in the....
Any help is appreciated.

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

Re: NIC does not get ip address from ifcfg-ethx

Post by TrevorH » 2016/05/26 20:39:04

BOOTPROTO-none
IPADDR:172.20.21.189
Look closely at those lines until you see the problem... both are wrong.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jaaywags
Posts: 6
Joined: 2017/04/10 22:42:06

Re: NIC does not get ip address from ifcfg-ethx

Post by jaaywags » 2017/04/11 20:14:22

gerald_clark wrote:service NetworkManager stop
service network restart
chkconfig NetworkManager off
chkconfig network on

Hiding details on a private network only delays or denies assistance.
Show the output of 'ifconfig -a'.
I know this is major late, but you saved my butt.

Post Reply