# Network Adapters swap around after a reboot.

## D0zer

Hi All

I am having a networking issue after a reboot on a Gentoo box. The machine has 3 NIC, but only 2 are currently used. 

```
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet x.x.x.x  netmask 255.255.255.248  broadcast x.x.x.x

        inet6 fe80::21b:21ff:fe14:b346  prefixlen 64  scopeid 0x20<link>

        ether 00:1b:21:14:b3:46  txqueuelen 1000  (Ethernet)

        RX packets 10640035  bytes 10237088942 (9.5 GiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 9030419  bytes 1814659462 (1.6 GiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.15.254  netmask 255.255.255.0  broadcast 192.168.15.255

        inet6 fe80::92e2:baff:fe1a:d60  prefixlen 64  scopeid 0x20<link>

        ether 90:e2:ba:1a:0d:60  txqueuelen 1000  (Ethernet)

        RX packets 9522791  bytes 1761964059 (1.6 GiB)

        RX errors 8  dropped 18  overruns 0  frame 4

        TX packets 13206014  bytes 18539798930 (17.2 GiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

After a reboot, the network adapters change around. To resolve I unplug the LAN and WAN Cables from the Gentoo box. Start a ping to the router and plug the wan cable back in and swap ports till I get a reply and then do the same with the LAN part of the network.

There are 3 files under /etc/udev/rules.d

70-my-persistent-net.rules  

70-persistent-cd.rules  

70-persistent-net.rules

Thanks in Advance.

----------

## szczerb

What's in '70-my-persistent-net.rules' and '70-persistent-net.rules'? Why do you have two?

----------

## charles17

 *D0zer wrote:*   

> After a reboot, the network adapters change around. To resolve I unplug the LAN and WAN Cables from the Gentoo box. Start a ping to the router and plug the wan cable back in and swap ports till I get a reply and then do the same with the LAN part of the network.

 

Migrating from netifrc to using dhcpcd ans your network manager should help avoiding such problems, see https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD.

 *D0zer wrote:*   

> There are 3 files under /etc/udev/rules.d
> 
> 70-my-persistent-net.rules  
> 
> 70-persistent-cd.rules  
> ...

 Could you check your output of dmesg?  *Quote:*   

> $ dmesg | grep 'network interface'
> 
> (you should get something like:)
> 
> [    8.132263] systemd-udevd[268]: renamed network interface wlan0 to wlp8s0
> ...

 

Also, how do the network adapters show in lspci -k?

----------

## D0zer

szczerb -  *Quote:*   

> What's in '70-my-persistent-net.rules' and '70-persistent-net.rules'? Why do you have two?

  I don't know where there is 2 files there

"70-my-persistent-net.rules"

```
# PCI device 0x8086:0x107c (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:1a:0d:60", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x1503 (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:60:77:7c:76:03", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x107c (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:14:b3:46", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
```

"70-persistent-net.rules"

```
# PCI device 0x8086:0x107c (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:1a:0d:60", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x1503 (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:60:77:7c:76:03", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x107c (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:14:b3:46", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

```

They look identical to me.

----------

## D0zer

charles17 - 

```
dmesg | grep 'network interface' 
```

 didn't produce and output.

 *Quote:*   

> Also, how do the network adapters show in lspci -k?

 

```
02:01.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)

        Subsystem: Intel Corporation PRO/1000 GT Desktop Adapter

        Kernel driver in use: e1000

        Kernel modules: e1000

02:02.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)

        Subsystem: Intel Corporation PRO/1000 GT Desktop Adapter

        Kernel driver in use: e1000

        Kernel modules: e1000

00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)

        Subsystem: Intel Corporation Device 201c

        Kernel driver in use: e1000e

        Kernel modules: e1000e
```

2 of the NICS are PCIE cards and the one is the onboard.

I don't think udev has been updated to the latest version yet.

----------

## charles17

 *D0zer wrote:*   

> 
> 
> ```
> 02:01.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)
> 
> ...

 

What about  *Quote:*   

> # dmesg | '02:01.0\|02:02.0\|00:19.0'

 Last edited by charles17 on Fri Jan 16, 2015 3:22 pm; edited 1 time in total

----------

## digifuzzy

I've run into something similar with motherboard LAN and add-in cards.

If you don't use the lan on the MB (I'm assuming this  *Quote:*   

> 00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)

  is built into the MB)

- disable it in BIOS.

----------

## digifuzzy

 *Quote:*   

> 
> 
> "70-my-persistent-net.rules"
> 
> ```
> ...

 

This seems messy.

You have references to device 0x107c four times in two files with two different MAC addresses.

Clean up time? I would double check these MAC values.

----------

## D0zer

Thanks for help so far charles17 and digifuzzy

charles17

```
 # dmesg | '02:01.0\|02:02.0\|00:19.0'
```

Does not produce an output.

----------

## D0zer

digifuzzy

I will go through both files and clean them up. I think the hardrive has been swapped into a different box previsouly which could be part of the mess.

I was thinking of  teaming the 2 add-in Nics for the LAN, and use the Onboard NIC for the WAN. When I look at the network stats on the switch, on the port the gentoo box is connected to it shows :

```

Transmitted Pause Frames : 48655

Received Pause Frames : 824

```

Would teaming the 2 nics on the Lan side improve Network performance ?

Thanks again.

----------

## digifuzzy

 *D0zer wrote:*   

> digifuzzy
> 
> Would teaming the 2 nics on the Lan side improve Network performance ?
> 
> 

 

YMMV. But it could be messy in the routing if you're not careful.

I use shorewall (iptables front end/firewall) to help with managing that kind of stuff.

----------

## D0zer

I decided to remove one of the PCI Network cards that was not being used.

I deleted the net.eth2 from /etc/init.d/

I used ifconfig to get the MAC addresses of the 2 NICs that are being used. I checked in /etc/udev/rules.d/70-my-persistent-net.rules, I commented out eth2 which was a mac address no longer being used.

After a couple of reboots the system was stable and I did not have to change network cables between the router and LAN around.

----------

