Operating System - Linux
1819500 Members
3130 Online
109603 Solutions
New Discussion

network-scripts/ifcfg-eth# and ifconfig output are different

 
Michael Steele_2
Honored Contributor

network-scripts/ifcfg-eth# and ifconfig output are different

Hi

My ifconfig displays these nics:
_tmp83838383838 - buzilla bug 224662 & 9
Has a hwaddress.

eth0 - primary - up
eth1 - no ifgcfg-eth1
eth2 - no ifgcfg-eth2
sit0 - not in network-scripts
lo0 - N/A

/proc/net/dev matches up with ifconfig as it should.

/etc/modprobe.conf displays:
alias eth0 e1000
alias eth1 e1000
alias eth2 tg3
alias eth3 tg3

a) looking for patch to _tmp83838 bug 224662 & 9

b) Why doesn't ifconfig match up with network-scripts?

Followup to :

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1459973
Support Fatherhood - Stop Family Law
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: network-scripts/ifcfg-eth# and ifconfig output are different

> eth1 - no ifgcfg-eth1
> eth2 - no ifgcfg-eth2

I guess you've probably disabled kudzu, then. (It would auto-generate those files when seeing unconfigured NICs.)

Create ifcfg- files for _all_ your 4 Ethernet NICs, even if their content will be only:

DEVICE=
BOOTPROTO=none
ONBOOT=no
HWADDR=

Also make sure the interface name in the filename matches the name declared in the DEVICE variable. When the system executes /etc/init.d/network start, all the ifcfg files will be read, and if the current interface MAC addresses don't match the configured ones, the ifup scripts will attempt to rename the interfaces to correct order.

But if you have specified only some of the interfaces, you'll get temporary names.
For example: assume you have two NICs, both using the same driver.
When the driver starts up, it finds the devices in such an order that eth0 gets MAC B, and eth1 gets MAC A.

But if ifcfg-eth0 specifies the HWADDR as MAC A, then the script sees it must rename eth1 to eth0. But there's already an eth0 (MAC B) in the way, so the script makes up a temporary name and renames the NIC with MAC B to temporary name.

Now, if the corresponding ifcfg-eth1 does not exist, or does not specify that eth1 should have MAC B, the network start-up script assumes its job is done, and the NIC with MAC B will remain assigned to a temporary name.

(If ifcfg-eth1 exists but does not contain the HWADDR= line, the script will attempt to use a NIC named "eth1". But because of the previous rename operation, no NIC with that name exists.)

"sit0" is a IPv6-in-IPv4 tunnel device; it doesn't need an ifcfg file unless you're going to use it.

MK
MK