FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-28-2010, 08:09 PM
Stephen Powell
 
Default eth0 or eth1

On Thu, 28 Jan 2010 15:37:47 -0500, T o n g wrote:
> Hi,
>
> One of My Debian has eth1 as the Ethernet card, while all others use
> eth0. There are only one Ethernet card in each system. Why the different?
>
> How can I have consistent 'eth0' throughout all systems?
>
> Thanks
>

By default, ifconfig only shows active interfaces. Issue "ifconfig -a"
to show *all* interfaces. (You have to be root of course.) You may
discover that there is a "hidden" interface that Linux recognizes.
Maybe there is a device built-in to the motherboard and you're using
an ethernet adapter in a bus slot.

If there is no other interface shown, look for a file in /etc/udev/rules.d
that has "persistent-net.rules" in it. The actual file name is
dependent on the architecture and the release of Debian. Look in this
file. You should see information for both interfaces in it, including
the MAC addresses. This can happen, for example, if a motherboard
containing a built-in ethernet adapter goes bad and has to be replaced.
The new motherboard has an ethernet adapter with a different MAC
address than the old one.

If this is the case, and the machine really has only one ethernet
adapter, erase the file, shutdown and reboot. The file will be
recreated upon reboot and eth0 will be assigned to the one and only
MAC address that can be found during boot.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 08:15 PM
"Boyd Stephen Smith Jr."
 
Default eth0 or eth1

On Thursday 28 January 2010 14:53:47 T o n g wrote:
> One of My Debian has eth1 as the Ethernet card, while all others use
> eth0. There are only one Ethernet card in each system. Why the different?

Network device names are controlled by the kernel, in cooperation with udev.

I suggest looking at /etc/udev/rule.d/70-persistent-net.rules or something
like that. You can freely adjust the names of most devices.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
 
Old 01-28-2010, 08:15 PM
Olaf Reitmaier Veracierta
 
Default eth0 or eth1

Read my replay complete before go to the links.

On 28/01/10 16:23, T o n g wrote:

Hi,

One of My Debian has eth1 as the Ethernet card, while all others use
eth0. There are only one Ethernet card in each system. Why the different?

"An explanation I saw in another post explained that with newer kernels
in Debian hardware is initialized asynchronously so you never know which
card will become eth0 and which eth1 and this matches what I experienced
with my cards."


A solution (Map to MAC):
http://lists.debian.org/debian-user/2006/01/msg00075.html


If the card it not integrated in the motherboard changing the slot
change ethX enumeration.


You can try to change /etc/udev/rules.d/70-persistent-net.rules as show
here:


Another solution: http://ubuntuforums.org/showthread.php?t=1007285


How can I have consistent 'eth0' throughout all systems?


If there are other Ethernet interfaces (WiFi, Firewire 1394, even a
bluetooh) also is posible the module load order is the reason.



Thanks




--
---------------------------------------------------------------------
"You don't know where your shadow will fall",
Somebody.-
---------------------------------------------------------------------
Ing. Olaf Reitmaier Veracierta<olafrv@gmail.com>
---------------------------------------------------------------------
Personal Web Page -- http://olafrv.com -- info@olafrv.com
---------------------------------------------------------------------


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 08:17 PM
Chance Platt
 
Default eth0 or eth1

T o n g wrote:

Hi,

One of My Debian has eth1 as the Ethernet card, while all others use
eth0. There are only one Ethernet card in each system. Why the different?


How can I have consistent 'eth0' throughout all systems?

Thanks



Is there more than one NIC in your system? If not, delete the rules
associated with your network card in
/etc/udev/rules.d/70-persistent-net.rules and reboot.


I'm guessing udev has for whatever reason identified more than one
network card installed in your system. It can be caused by changing
network cards, the kernel identifying your card differently at some
point (maybe kernel upgrades or bug, changed MAC address..)




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 08:27 PM
Celejar
 
Default eth0 or eth1

On Thu, 28 Jan 2010 16:09:11 -0500 (EST)
Stephen Powell <zlinuxman@wowway.com> wrote:

...

> If there is no other interface shown, look for a file in /etc/udev/rules.d
> that has "persistent-net.rules" in it. The actual file name is
> dependent on the architecture and the release of Debian. Look in this
> file. You should see information for both interfaces in it, including
> the MAC addresses. This can happen, for example, if a motherboard
> containing a built-in ethernet adapter goes bad and has to be replaced.
> The new motherboard has an ethernet adapter with a different MAC
> address than the old one.
>
> If this is the case, and the machine really has only one ethernet
> adapter, erase the file, shutdown and reboot. The file will be
> recreated upon reboot and eth0 will be assigned to the one and only
> MAC address that can be found during boot.

No need to erase the whole file, or to shutdown / reboot (assuming the
relevant driver is built as a module). As I note here, just comment out
the relevant line, and then unload and reload the relevant kernel
module.

http://lists.debian.org/debian-user/2009/01/msg01486.html

Celejar
--
foffl.sourceforge.net - Feeds OFFLine, an offline RSS/Atom aggregator
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 09:29 PM
Stephen Powell
 
Default eth0 or eth1

On Thu, 28 Jan 2010 16:27:47 -0500, Celejar wrote:
> No need to erase the whole file, or to shutdown / reboot (assuming the
> relevant driver is built as a module). As I note here, just comment out
> the relevant line, and then unload and reload the relevant kernel
> module.

I figured there was probably a less disruptive way, but I knew that erase /
reboot would work, assuming only one NIC. But since we're on the subject,
just what would the "relevant kernel module" be? The device-specific
driver for the NIC, such as xirc2ps_cs, for example? Or a more general
networking module? What would be the exact procedure? I'm guessing
something like:

[edit rules file]
ifdown eth1
modprobe -r xirc2ps_cs
modprobe xirc2ps_cs
ifup eth0 [if needed]


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 11:01 PM
T o n g
 
Default eth0 or eth1

On Thu, 28 Jan 2010 15:17:21 -0600, Chance Platt wrote:

>> One of My Debian has eth1 as the Ethernet card, while all others use
>> eth0. There are only one Ethernet card in each system. Why the
>> different?
>>
> Is there more than one NIC in your system?

No, there is only one NIC in my system.

> I'm guessing udev has for whatever reason identified more than one
> network card installed in your system. It can be caused by changing
> network cards, the kernel identifying your card differently at some
> point (maybe kernel upgrades or bug, changed MAC address..)

Yes, I think that explains well. This is the system that I been kept
upgrading for years. The card changed from eth0 to eth1 during one system
upgrade (and stays that way) -- maybe during hal to udev upgrading.

> If not, delete the rules
> associated with your network card in
> /etc/udev/rules.d/70-persistent-net.rules and reboot.

Thanks to Celejar & Stephen's help. I get it corrected without rebooting.
Here is my detailed steps:

$ dmesg | grep 'ethernet driver'
[1795967.314420] forcedeth: Reverse Engineered nForce ethernet driver...

rm /etc/udev/rules.d/70-persistent-net.rules
ifdown eth1
modprobe -r forcedeth
modprobe forcedeth

$ dir /etc/udev/rules.d/70-persistent-net.rules
-rw-r--r-- 1 root root 424 2010-01-28 18:45 /etc/udev/rules.d/70-
persistent-net.rules

ifup eth0

AOK!

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 11:11 PM
Vincent Lefevre
 
Default eth0 or eth1

On 2010-01-28 16:09:11 -0500, Stephen Powell wrote:
> By default, ifconfig only shows active interfaces. Issue "ifconfig -a"
> to show *all* interfaces. (You have to be root of course.)

No need to be root!

--
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 11:45 PM
Stephen Powell
 
Default eth0 or eth1

On Thu, 28 Jan 2010 19:01:46 -0500, T o n g wrote:
> Thanks to Celejar & Stephen's help. I get it corrected without rebooting.
> Here is my detailed steps:
>
> $ dmesg | grep 'ethernet driver'
> [1795967.314420] forcedeth: Reverse Engineered nForce ethernet driver...
>
> rm /etc/udev/rules.d/70-persistent-net.rules
> ifdown eth1
> modprobe -r forcedeth
> modprobe forcedeth
>
> $ dir /etc/udev/rules.d/70-persistent-net.rules
> -rw-r--r-- 1 root root 424 2010-01-28 18:45 /etc/udev/rules.d/70-
> persistent-net.rules
>
> ifup eth0
>
> AOK!

I'm glad you got it working. And I'm glad to know that my guessed
procedure worked. Thanks for the feedback.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-28-2010, 11:57 PM
Stephen Powell
 
Default eth0 or eth1

On Thu, 28 Jan 2010 19:11:29 -0500, Vincent Lefevre wrote:
> On 2010-01-28 16:09:11 -0500, Stephen Powell wrote:
> > By default, ifconfig only shows active interfaces. Issue "ifconfig -a"
> > to show *all* interfaces. (You have to be root of course.)
>
> No need to be root!

On my system you *do* need to be root.

$ ifconfig
-bash: ifconfig: command not found
$ su
Password: [enter root password]
# ifconfig
.
. (expected output from ifconfig
.

The problem is that, by default, ordinary users don't have
/sbin in their PATH variable. Not on a plain-vanilla
Debian system. But it's true that an ordinary user can
run ifconfig by issuing

$ /sbin/ifconfig

or by modifying the PATH variable to include /sbin.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 04:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org