# Network on eth1 instead of eth0

## stewie63

I'm new to Gentoo and linux and am confused as to why my network is being defaulted to eth1 instead of eth0. It's working, just kind of annoying. Thanks for your help.

Here is my output from ifconfig eth0

```
 # ifconfig eth0

eth0      Link encap:UNSPEC  HWaddr 08-00-46-03-02-39-73-36-00-00-00-00-00-00-00-00  

          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)

```

----------

## mudrii

What do you mean default ethX ?

you have tow eth so one is connected to net and another not ?

Just change the cable

----------

## stewie63

sorry, should have specified...i only have one ethernet port and wireless...(Sony Vaio laptop)

lspci output

```
# lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8036 PCI-E Fast Ethernet Controller (rev 13)

06:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

0a:03.0 CardBus bridge: Texas Instruments Unknown device 8039

0a:03.1 FireWire (IEEE 1394): Texas Instruments Unknown device 803a

0a:03.2 Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)

```

----------

## PaulBredbury

Rename them to lan & inet. ethX is a meaningless name.

----------

## wynn

 *stewie63 wrote:*   

> I'm new to Gentoo and linux and am confused as to why my network is being defaulted to eth1 instead of eth0. It's working, just kind of annoying. Thanks for your help.
> 
> Here is my output from ifconfig eth0
> 
> ```
> ...

 See Phantom interface?: NeddySeagoon suggests using udev rules there but in NeddySeagoons' Rough guide to Fixing Networking he suggests just deleting the module.

Your choice   :Smile: 

----------

## stewie63

Thanks for the help fellas. I removed the module but my network did not move from eth1. ifconfig eth0 no longer reveals some phantom device, but nothing at all. I'm a noob at this and am probly just missing some simple step to keep eth0 from loading at bootup. Thanks for any help you can offer again!

```
# ifconfig eth0

eth0: error fetching interface information: Device not found

```

----------

## wynn

You can do two things (1) redo your kernel configuration removing Firewire support altogether

```
-> Device Drivers

IEEE 1394 (FireWire) support  --->

< > IEEE 1394 (FireWire) support
```

or, if you want to use Firewire, just remove Ethernet over Firewire

```
-> Device Drivers

IEEE 1394 (FireWire) support  --->

<M> IEEE 1394 (FireWire) support

< >   Ethernet over 1394
```

recompile your kernel and modules and install it or

(2) Use eth1 instead of eth0: change RC_PLUG_SERVICES in /etc/conf.d/rc to

```
RC_PLUG_SERVICES="!net.eth0"
```

"dhcpcd eth1" should work now without any changes anyway.

----------

## tnt

I've spoted that recent kernels (or it's udev) name my ethernet cards in some strange way.

I've always had eth0 if that's one and only NIC in my box, but now, if I change NIC (I had 100mbps one and put 1gbps NIC) my new NIC is named eth1 no metter I've removed old 100mbps card.

Is there any way to "tell" my system to "forget" about old cards and not to increment ethX every time I change the NIC ?

----------

## wynn

Could you post the output of "lspci", please? And

```
lsmod | grep eth1394
```

as well?

----------

## tnt

```
tnt ~ # lsmod | grep eth1394

tnt ~ # lspci

00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4)

00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP]

00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40)

00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16)

00:07.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16)

00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40)

00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 50)

00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

00:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

00:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

00:0c.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)

01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1)

tnt ~ # lspci -v

00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4)

        Flags: bus master, medium devsel, latency 0

        Memory at d0000000 (32-bit, prefetchable) [size=128M]

        Capabilities: [a0] AGP version 2.0

        Capabilities: [c0] Power Management version 2

00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] (prog-if 00 [Normal decode])

        Flags: bus master, 66MHz, medium devsel, latency 0

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

        Memory behind bridge: e0000000-e1ffffff

        Prefetchable memory behind bridge: d8000000-dfffffff

        Capabilities: [80] Power Management version 2

00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40)

        Subsystem: VIA Technologies, Inc. VT82C686/A PCI to ISA Bridge

        Flags: bus master, stepping, medium devsel, latency 0

        Capabilities: [c0] Power Management version 2

00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])

        Subsystem: VIA Technologies, Inc. VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE

        Flags: bus master, medium devsel, latency 32

        [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]

        [virtual] Memory at 000003f0 (type 3, non-prefetchable) [size=1]

        [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]

        [virtual] Memory at 00000370 (type 3, non-prefetchable) [size=1]

        I/O ports at d000 [size=16]

        Capabilities: [c0] Power Management version 2

00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16) (prog-if 00 [UHCI])

        Subsystem: VIA Technologies, Inc. (Wrong ID) USB Controller

        Flags: bus master, medium devsel, latency 32, IRQ 11

        I/O ports at d400 [size=32]

        Capabilities: [80] Power Management version 2

00:07.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 16) (prog-if 00 [UHCI])

        Subsystem: VIA Technologies, Inc. (Wrong ID) USB Controller

        Flags: bus master, medium devsel, latency 32, IRQ 11

        I/O ports at d800 [size=32]

        Capabilities: [80] Power Management version 2

00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40)

        Subsystem: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI]

        Flags: medium devsel, IRQ 7

        Capabilities: [68] Power Management version 2

00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 50)

        Subsystem: Micro-Star International Co., Ltd. Unknown device 3620

        Flags: medium devsel, IRQ 12

        I/O ports at dc00 [size=256]

        I/O ports at e000 [size=4]

        I/O ports at e400 [size=4]

        Capabilities: [c0] Power Management version 2

00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

        Subsystem: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet

        Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16

        I/O ports at e800 [size=256]

        Memory at e3000000 (32-bit, non-prefetchable) [size=256]

        [virtual] Expansion ROM at 60000000 [disabled] [size=128K]

        Capabilities: [dc] Power Management version 2

00:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

        Subsystem: Pinnacle Systems Inc. PCTV pro (TV + FM stereo receiver)

        Flags: bus master, medium devsel, latency 32, IRQ 17

        Memory at e3001000 (32-bit, prefetchable) [size=4K]

        Capabilities: [44] Vital Product Data

        Capabilities: [4c] Power Management version 2

00:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

        Subsystem: Pinnacle Systems Inc. PCTV pro (TV + FM stereo receiver, audio section)

        Flags: bus master, medium devsel, latency 32, IRQ 12

        Memory at e3002000 (32-bit, prefetchable) [size=4K]

        Capabilities: [44] Vital Product Data

        Capabilities: [4c] Power Management version 2

00:0c.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)

        Subsystem: C-Media Electronics Inc CMI8738/C3DX PCI Audio Device

        Flags: bus master, medium devsel, latency 32, IRQ 18

        I/O ports at ec00 [size=256]

        Capabilities: [c0] Power Management version 2

01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1) (prog-if 00 [VGA])

        Flags: bus master, 66MHz, medium devsel, latency 248, IRQ 19

        Memory at e0000000 (32-bit, non-prefetchable) [size=16M]

        Memory at d8000000 (32-bit, prefetchable) [size=128M]

        [virtual] Expansion ROM at e1000000 [disabled] [size=128K]

        Capabilities: [60] Power Management version 2

        Capabilities: [44] AGP version 3.0

tnt ~ # 
```

----------

## wynn

I was just guessing that you had Ethernet over Firewire enabled in your kernel and this was causing a phantom eth0 pushing your real NIC to eth1. No.

What it probably is is /etc/udev/rules.d/70-persistent-net.rules. If you look at this file it will show something like this

```
# PCI device 0x168c:0x0013 (ath_pci)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0f:3d:ae:c4:e7", ATTRS{type}=="1", NAME="ath0"

# PCI device 0x10ec:0x8169 (r8169)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:8d:ed:9f:96", NAME="eth0"

# Firewire device 00508d0000ec9f96)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:8d:00:00:ec:9f:96", NAME="eth0"
```

which udev uses to name the Ethernet devices. You will probably have an entry there for an eth0 which doesn't exist. You can edit this to remove the old entry and change the name on the existing entry from eth1 to eth0. On reboot it should give you back your eth0 again.

[Edit] You can also just delete it and it will be recreated on the next boot â hopefully with the right name   :Smile: 

----------

