LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2012, 11:16 PM   #1
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
how does rc.inet.conf relate to eth number and nic?


My system has two NICs, but I've only ever used one up until now. I'd like to start using the second one with a unique static IP address assigned to it. I don't understand how the eth/n interfaces get numbered, or how they relate to the IPADDR[n] and similar statements in rc.inet1.conf.

This is a Slackware system. My rc.inet1.conf resides in /etc/rc.d, and currently has the following IPADDR and NETMASK statements. (I've omitted configuration statements that are not relevant to my questions.)

Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""

# Config information for eth1:
IPADDR[1]="192.168.1.15"
NETMASK[1]="255.255.255.0"

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""

# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
Since I have two NICs, I'd expect one of them to be named eth0 and the other eth1. But the output from an ifconfig shows that they are named eth1 and eth2.

Code:
root@ixian1:/etc/rc.d# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:23:18:77:0C:E1  
          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::222:15ff:fe77:bd1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:108065471 errors:0 dropped:67 overruns:0 frame:0
          TX packets:103365115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3811807073 (3635.2 Mb)  TX bytes:1292149471 (1232.2 Mb)
          Interrupt:18 

eth2      Link encap:Ethernet  HWaddr 00:23:18:76:F4:B8  
          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:17
Why aren't they named eth0 and eth1? I haven't tested this consciously, but I'm pretty sure everything works fine with my current rc.inet1.conf definition regardless of which of the two NIC RJ45 connectors I plug my (one and only up until now) ethernet cable into.

If I want to have two active and unique IP addresses for this system and I define the second one in rc.inet1.conf to eth00 (the first is already defined to eth1), will this affect the eth/n number assigned to each NIC? Will it map the same way on each reboot?
 
Old 12-21-2012, 03:19 AM   #2
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 186

Rep: Reputation: 31
It's udev doing the numbering.
In Slackware it should be /etc/udev/rules.d/70-persistent-net.rules
which holds the numbering. You'll find the NIC's MAC address and a NAME given to it.

If you want to re-number the interfaces, just rename the file, as it should be generated again on next boot

Last edited by heinblöd; 12-21-2012 at 03:20 AM. Reason: typo
 
1 members found this post helpful.
Old 12-21-2012, 10:46 PM   #3
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Original Poster
Rep: Reputation: 174Reputation: 174
Thank you, heinblöd. Is there any rhyme or reason to how udev goes about assigning the numbers? There must be some sort of predictability to it, or else one might boot and find that the eth number configured in rc.inet1.conf no longer matches what udev assigned.
 
Old 12-21-2012, 11:02 PM   #4
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Original Poster
Rep: Reputation: 174Reputation: 174
lspci shows:

Code:
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)
05:02.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 14)
/etc/udev/rules.d/70-persistent-net.rules shows:

Code:
# PCI device 0x11ab:0x4320 (skge)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:18:77:0c:e1", ATTR{type}=="1", NAME="eth1"

# PCI device 0x11ab:0x4364 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:18:76:f4:b8", ATTR{type}=="1", NAME="eth2"
This is interesting. udev is renaming my ethernet interfaces sometime during the boot process:

Code:
dmesg | grep eth
[   20.356639] skge 0000:05:02.0: eth0: addr 00:23:18:77:0C:E1
[   20.400073] sky2 0000:02:00.0: eth1: addr 00:23:18:76:F4:B8
[   20.759119] udev[1370]: renamed network interface eth0 to eth0-eth1
[   20.762041] udev[1347]: renamed network interface eth1 to eth2
[   20.814181] udev[1370]: renamed network interface eth0-eth1 to eth1
[   51.608433] skge 0000:05:02.0: eth1: enabling interface
[   52.845952] ADDRCONF(NETDEV_UP): eth1: link is not ready
[   53.988677] skge 0000:05:02.0: eth1: Link is up at 1000 Mbps, full duplex, flow control both
[   53.988677] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   64.226005] eth1: no IPv6 routers present
[1213532.878825] skge 0000:05:02.0: eth1: Link is down
[1213541.497318] skge 0000:05:02.0: eth1: Link is up at 100 Mbps, full duplex, flow control none
[1213545.724858] skge 0000:05:02.0: eth1: Link is down
[1213548.016377] skge 0000:05:02.0: eth1: Link is up at 1000 Mbps, full duplex, flow control both
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] my eth number keep changing after follow -current el_jauzaa Slackware 10 04-09-2011 03:16 AM
Eth-number is increasing by one when every reboot happywei Linux - Software 1 02-23-2010 01:41 PM
Missing /etc/inet/resolv.conf and /etc/defaultrouter files fresh Solaris 8 install mwx Linux - Networking 4 01-27-2009 01:39 AM
Assigning eth number for 2 identical network card pii.ajah Linux - Networking 1 12-10-2008 12:47 AM
x11vnc as a inet.conf service vic102482 Solaris / OpenSolaris 4 05-04-2005 02:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration