[arch-general] Why does network interface sometimes change name?
I am running Arch as a guest in VMware Player on Win7X64. On every odd boot, the name of the network interface changes. Sometimes it is: eno16777736 Sometimes it is: eth0 This makes it really hard to configure a fixed IP, which I do by having in `/etc/dhcpcd.conf`: interface eno16777736 static ip_address=192.168.101.10/24 static routers=192.168.101.2 static domain_name_servers=192.168.101.2 I have to change back and forth the interface name in that configuration file.
On Mon, Apr 6, 2015 at 5:36 PM, Felix E. Klee <felix.klee@inka.de> wrote:
I am running Arch as a guest in VMware Player on Win7X64. On every odd boot, the name of the network interface changes. Sometimes it is:
eno16777736
Sometimes it is:
eth0
This makes it really hard to configure a fixed IP, which I do by having in `/etc/dhcpcd.conf`:
interface eno16777736 static ip_address=192.168.101.10/24 static routers=192.168.101.2 static domain_name_servers=192.168.101.2
I have to change back and forth the interface name in that configuration file.
It is probably caused by those fancy Predictable Network Interface Names [1], that in your case become unpredictable. Just do: # ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules And you will get the good old "eth0" every time. Unless you have more than one network interface, of course... If that is the case you can use the MAC address to build the interface name, but I forgot the details... [1]: http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterface...
On Mon, Apr 6, 2015 at 1:01 PM, Rodrigo Rivas <rodrigorivascosta@gmail.com> wrote:
On Mon, Apr 6, 2015 at 5:36 PM, Felix E. Klee <felix.klee@inka.de> wrote:
I have to change back and forth the interface name in that configuration file.
It is probably caused by those fancy Predictable Network Interface Names [1], that in your case become unpredictable.
You can also disable both of them on the kernel commandline, which is handy when you have thousands of servers and can't afford to deal with the names changing (think mass automation) if a PCI card is plugged into slot6 when you thought it was in slot5 or whatnot. net.ifnames=0 This will stop systemd ("enp0s25" etc.) biosdevname=0 This will stop udev ("em1" etc.) Add those to your GRUB_CMDLINE_LINUX_DEFAULT (or GRUB_CMDLINE_LINUX) in /etc/default/grub and rebuild your grub config file (grub-mkconfig). This is a portable solution that should work on any distro, not just Arch. hth, -te
Op 6 apr. 2015 17:37 schreef "Felix E. Klee" <felix.klee@inka.de>:
I am running Arch as a guest in VMware Player on Win7X64. On every odd boot, the name of the network interface changes.
First make sure that vmware always uses the same mac address for this vm. When done, check archwiki for persists nic names. The second step is easy, but gets frustrated when the mac address changes randomly (which is not unusual with virtualization). Mvg, Guus
On Mon, Apr 6, 2015 at 7:34 PM, Guus Snijders <gsnijders@gmail.com> wrote:
First make sure that vmware always uses the same mac address for this vm.
If the MAC address changes, I would expect the name to change from `eno16777736` to something like `eno52423433`. I wouldn’t expect it to change to `eth0`. Anyhow, it could be interesting to watch for changes. Currently the interface is named `eth0` with `00:0c:29:12:0e:9e` as MAC address: $ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.101.10 netmask 255.255.255.0 broadcast 192.168.101.255 inet6 fe80::7e13:1a20:5a2a:75b8 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:12:0e:9e txqueuelen 1000 (Ethernet) RX packets 75773 bytes 81703677 (77.9 MiB) RX errors 1 dropped 0 overruns 0 frame 0 TX packets 33366 bytes 2056250 (1.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 19 base 0x2000 Perhaps someone can tell from the above output what’s happening.
After a reboot (due to BSOD in the Windows host - faulty RAM) the interface name changed from eth0 to eno16777736: $ ifconfig eno16777736 eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.101.129 netmask 255.255.255.0 broadcast 192.168.101.255 inet6 fe80::7e13:1a20:5a2a:75b8 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:12:0e:9e txqueuelen 1000 (Ethernet) RX packets 98 bytes 13331 (13.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 82 bytes 17412 (17.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 19 base 0x2000 Note that the MAC address stayed the same: 00:0c:29:12:0e:9e So I don’t understand at all why the interface changes it’s name.
On Mon, Apr 6, 2015 at 4:36 PM, Felix E. Klee <felix.klee@inka.de> wrote:
I am running Arch as a guest in VMware Player on Win7X64. On every odd boot, the name of the network interface changes. Sometimes it is:
eno16777736
Sometimes it is:
eth0
I had the corresponding issue on a machine with two nics (not vm though), and what fixed it for me was to add a udev rule (though it does depend on having consistent mac address for each nic): # cat /etc/udev/rules.d/10-network.rules SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="4c:72:b9:32:45:30", NAME="eno1" SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="4c:72:b9:32:45:32", NAME="eno2" If you want to associate a specific nic to a name chosen by you then this may help. -- mike c
participants (5)
-
Felix E. Klee
-
Guus Snijders
-
Mike Cloaked
-
Rodrigo Rivas
-
Troy Engel