Linux network interface enumeration incrementing on boot

I am working with a MC7350 on Centos6.6 using the GobiNet and GobiSerial driver.

When I reboot my PC the MC7350 MAC address changes and the ethernet interface associated increments as well.

When I started the MC7350 was assigned eth2. On the first reboot it became eth3 and after rebooting again eth4.

Not sure if the issue lays with the MC7350, the drivers or the centos udev config.

Some relevant information:

[centos6.6] #ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1F:F2:0D:F3:B1
inet addr:192.168.1.47 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21f:f2ff:fe0d:f3b1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1144 errors:0 dropped:0 overruns:0 frame:0
TX packets:439 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:82657 (80.7 KiB) TX bytes:49575 (48.4 KiB)

eth1 Link encap:Ethernet HWaddr 00:1F:F2:0D:F3:B0
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::21f:f2ff:fe0d:f3b0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:130018 errors:0 dropped:0 overruns:0 frame:0
TX packets:188 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:189550441 (180.7 MiB) TX bytes:17475 (17.0 KiB)

eth4 Link encap:Ethernet HWaddr D6:F9:D8:F0:82:08
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)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:204 errors:0 dropped:0 overruns:0 frame:0
TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9300 (9.0 KiB) TX bytes:9300 (9.0 KiB)

[centos6.6] #cat /etc/udev/rules.d/70-persistent-net.rules

This file was automatically generated by the /lib/udev/write_net_rules

program, run by the persistent-net-generator.rules rules file.

You can modify it, as long as you keep each rule on a single

line, and change only the value of the NAME= key.

PCI device 0x10ec:0x8168 (r8169)

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“00:1f:f2:0d:f3:b1”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth0”

PCI device 0x10ec:0x8168 (r8169)

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“00:1f:f2:0d:f3:b0”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth1”

USB device 0x1199:0x68c0 (usb)

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“3a:9f:da:33:bd:08”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth2”

USB device 0x1199:0x68c0 (usb)

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“d2:3b:d8:6b:0a:08”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth3”

USB device 0x1199:0x68c0 (usb)

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“d6:f9:d8:f0:82:08”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth4”

[centos6.6] #lsmod
Module Size Used by
ipv6 270937 24
GobiSerial 9204 0
usbserial 30493 1 GobiSerial
GobiNet 50901 0
usbnet 30456 1 GobiNet
serio_raw 3530 0
sg 24006 0
snd_hda_codec_hdmi 40044 1
r8169 63274 0
snd_hda_codec_via 17812 1
mii 4476 2 usbnet,r8169
snd_hda_codec_generic 54394 1 snd_hda_codec_via
snd_hda_intel 45473 0
snd_hda_codec 114217 4 snd_hda_codec_hdmi,snd_hda_codec_via,snd_hda_codec_generic,snd_hda_intel
snd_hwdep 5474 1 snd_hda_codec
snd_seq 49055 0
snd_seq_device 5689 1 snd_seq
snd_pcm 73758 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer 17504 2 snd_seq,snd_pcm
snd 55156 10 snd_hda_codec_hdmi,snd_hda_codec_via,snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer
soundcore 6390 2 snd_hda_codec,snd
snd_page_alloc 7236 2 snd_hda_intel,snd_pcm
ext4 339812 5
jbd2 75927 1 ext4
mbcache 6017 1 ext4
sd_mod 33249 3
crc_t10dif 836 1 sd_mod
xhci_hcd 162628 0
ahci 36204 2
video 17202 0
output 1741 1 video
dm_mirror 11969 0
dm_region_hash 9644 1 dm_mirror
dm_log 8322 2 dm_mirror,dm_region_hash
dm_mod 84711 17 dm_mirror,dm_log

The MAC address comes from the “usbnet” framework, and is auto generated every time usbnet.ko is reloaded (whcih typically only happens on reboot). It’s an arbitrary value with no meaning whatsoever.

The centos udev config appears to be buggy. The auto-generated addresses have the “local” bit set and should definitely not be used as keys for static device names.

Notice how all those MC7750 addresses have the local bit set (the bit masked by 02:00:00:00:00:00). The persistent-net-generator.rules should really ignore any interface with such an address. My Debian system has a rule like this implementing that:

ENV{MATCHADDR}=="?[2367abef]:*",        ENV{MATCHADDR}=""