You are not logged in.

#1 2015-07-09 21:37:32

m01
Member
Registered: 2015-06-25
Posts: 8

eth0 AND enpXXX on the same machine without any naming config?

I'm really confused. I installed a new NIC a few days ago, and now I have an inconsistent NIC naming scheme - one device is called eth0, and one enp3s0. How can I make both use the new naming scheme?

% ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether bc:5f:f4:dc:f8:43 brd ff:ff:ff:ff:ff:ff
3: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 68:05:ca:38:fd:08 brd ff:ff:ff:ff:ff:ff
... (some virtual devices)
% ls /sys/class/net
enp3s0  eth0  lo  virbr0  virbr0-nic  virbr10  virbr10-nic

Note there's both an eth0 interface (old onboard NIC), as well as an enp3s0 (the new NIC).

Here's my kernel command line - no net.ifnames=0 to be seen:

% cat /proc/cmdline
initrd=\EFI\intel-ucode\intel-ucode.img initrd=\EFI\arch\initramfs-arch.img root=PARTUUID=9129da77-eb6a-47b5-9c17-d73d6257b23a rw

I don't have any custom udev rules for NICs:

% ls /etc/udev/rules.d
49-spark-stm32dfu.rules  81-canonij_prn.rules
80-canon_mfp.rules       99_smfpautoconf.rules

Nothing here either:

% ls /etc/systemd/network 
%

This looks fine as well I think..

% ls /usr/lib/systemd/network/                                    
80-container-host0.network  80-container-ve.network  99-default.link
% cat /usr/lib/systemd/network/*                                  
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
[Match]
Virtualization=container
Name=host0
[Network]
DHCP=yes
LinkLocalAddressing=yes
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Match]
Name=ve-*
Driver=veth

[Network]
# Default to using a /28 prefix, giving up to 13 addresses per container.
Address=0.0.0.0/28
LinkLocalAddressing=yes
DHCPServer=yes
IPMasquerade=yes
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
michiel@r2d2:~% 

According to udevadm the new name generation seems to work..

% udevadm test-builtin net_id /sys/class/net/eth0
calling: test-builtin
=== trie on-disk ===
tool version:          221
file size:         6995971 bytes
header size             80 bytes
strings            1753491 bytes
nodes              5242400 bytes
Load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/usr/lib/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context.
ID_NET_NAME_MAC=enxbc5ff4dcf843
ID_OUI_FROM_DATABASE=ASRock Incorporation
ID_NET_NAME_PATH=enp0s25
Unload module index
Unloaded link configuration context.

I've got a recent version of systemd, too..

% pacman -Q systemd
systemd 221-2

Any idea what could be causing my on-board NIC to be called eth0 and how I can get it to adopt the new naming scheme? I've read the device name section on the network config wiki page but that didn't bring me further, and I've tried searching around on Google, above is a list of the things I've looked at to try to figure this out.

Last edited by m01 (2015-07-09 21:38:45)

Offline

#2 2015-07-09 21:39:55

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,781
Website

Re: eth0 AND enpXXX on the same machine without any naming config?

What is the output of:

journalctl -b|egrep 'eth|enp'

Jin, Jîyan, Azadî

Offline

#3 2015-07-10 11:44:04

m01
Member
Registered: 2015-06-25
Posts: 8

Re: eth0 AND enpXXX on the same machine without any naming config?

So earlier today both NICs had the correct naming scheme, but one reboot later I've got eth0 back. Here's the output:

% journalctl -b|egrep 'eth|enp'
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:00:19.0 eth0: registered PHC clock
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) bc:5f:f4:dc:f8:43
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:00:19.0 eth0: MAC: 11, PHY: 12, PBA No: FFFFFF-0FF
Jul 10 12:37:09 r2d2.m01.eu dhcpcd[554]: eth0: adding address fe80::ad3f:963a:dd89:8c7e
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:03:00.0 eth1: registered PHC clock
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:03:00.0 eth1: (PCI Express:2.5GT/s:Width x1) 68:05:ca:38:fd:08
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:03:00.0 eth1: Intel(R) PRO/1000 Network Connection
Jul 10 12:37:09 r2d2.m01.eu kernel: e1000e 0000:03:00.0 eth1: MAC: 3, PHY: 8, PBA No: E46981-008
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth0: waiting for carrier
Jul 10 12:37:10 r2d2.m01.eu systemd-udevd[233]: Error changing net interface name 'eth0' to 'enp0s25': Device or resource busy
Jul 10 12:37:10 r2d2.m01.eu systemd-udevd[233]: could not rename interface '2' from 'eth0' to 'enp0s25': Device or resource busy
Jul 10 12:37:10 r2d2.m01.eu kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Jul 10 12:37:10 r2d2.m01.eu kernel: e1000e 0000:03:00.0 enp3s0: renamed from eth1
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth1: adding address fe80::820e:bb77:4018:8b85
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth1: if_up: No such device
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth1: waiting for carrier
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth1: removing interface
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: eth1: deleting address fe80::820e:bb77:4018:8b85
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: adding address fe80::820e:bb77:4018:8b85
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: waiting for carrier
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: carrier acquired
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: adding address fe80::820e:bb77:4018:8b85
Jul 10 12:37:10 r2d2.m01.eu kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: IAID ca:38:fd:08
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: soliciting a DHCP lease
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: soliciting an IPv6 router
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: carrier lost
Jul 10 12:37:10 r2d2.m01.eu dhcpcd[554]: enp3s0: deleting address fe80::820e:bb77:4018:8b85
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: carrier acquired
Jul 10 12:37:13 r2d2.m01.eu kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Jul 10 12:37:13 r2d2.m01.eu kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: IAID f4:dc:f8:43
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: soliciting an IPv6 router
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: rebinding lease of 192.168.X.X
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: leased 192.168.X.X for 86400 seconds
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: adding route to 192.168.X.0/24
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: adding default route via 192.168.X.1
Jul 10 12:37:13 r2d2.m01.eu avahi-daemon[625]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.X.X.
Jul 10 12:37:13 r2d2.m01.eu avahi-daemon[625]: New relevant interface eth0.IPv4 for mDNS.
Jul 10 12:37:13 r2d2.m01.eu avahi-daemon[625]: Registering new address record for 192.168.X.X on eth0.IPv4.
Jul 10 12:37:13 r2d2.m01.eu dhcpcd[554]: eth0: removing route to 192.168.X.0/24
Jul 10 12:37:14 r2d2.m01.eu ntpd[796]: Listen normally on 4 eth0 192.168.X.X:123
Jul 10 12:37:14 r2d2.m01.eu ntpd[796]: unable to create socket on eth0 (5) for fe80::ad3f:963a:dd89:8c7e%2#123
Jul 10 12:37:15 r2d2.m01.eu avahi-daemon[625]: Registering new address record for fe80::ad3f:963a:dd89:8c7e on eth0.*.
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: Router Advertisement from fe80::1
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: adding address YYYY/64
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: adding route to YY::/64
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: adding default route via fe80::1
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: confirming prior DHCPv6 lease
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: REPLY6 received from fe80::1
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: adding address YYYY/128
Jul 10 12:37:15 r2d2.m01.eu dhcpcd[554]: eth0: renew in 43200 seconds, rebind in 69120 seconds
Jul 10 12:37:16 r2d2.m01.eu avahi-daemon[625]: Registering new address record for YYYY on eth0.*.
Jul 10 12:37:16 r2d2.m01.eu avahi-daemon[625]: Withdrawing address record for fe80::ad3f:963a:dd89:8c7e on eth0.
Jul 10 12:37:17 r2d2.m01.eu avahi-daemon[625]: Registering new address record for YYYY on eth0.*.
Jul 10 12:37:18 r2d2.m01.eu ntpd[796]: Listen normally on 6 eth0 [YYYY]:123
Jul 10 12:37:18 r2d2.m01.eu ntpd[796]: Listen normally on 7 eth0 [YYYY2]:123
Jul 10 12:37:18 r2d2.m01.eu ntpd[796]: Listen normally on 8 eth0 [fe80::ad3f:963a:dd89:8c7e%2]:123

I've got dhcpcd running on all interfaces:

% systemctl list-units|grep dhcp
dhcpcd.service                                                                            loaded active running   dhcpcd on all interfaces

Shouldn't dhcpcd be waiting for the rename to have gone through?

% cat /usr/lib/systemd/system/dhcpcd.service
[Unit]
Description=dhcpcd on all interfaces
Wants=network.target
Before=network.target

[Service]
Type=forking
PIDFile=/run/dhcpcd.pid
ExecStart=/usr/bin/dhcpcd -q -b
ExecStop=/usr/bin/dhcpcd -x

[Install]
WantedBy=multi-user.target

Offline

#4 2015-07-10 12:39:27

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: eth0 AND enpXXX on the same machine without any naming config?

I think you should prevent dhcpcd from binding to the old names with denyinterfaces in dhcpcd.conf

denyinterfaces wlan[0-9]* eth[0-9]* ppp[0-9]*

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2015-07-10 18:28:07

m01
Member
Registered: 2015-06-25
Posts: 8

Re: eth0 AND enpXXX on the same machine without any naming config?

Thank you for the idea.

That looks better:

 % journalctl -b -u dhcpcd
-- Logs begin at Thu 2013-12-19 23:42:24 GMT, end at Fri 2015-07-10 19:25:25 BST. --
Jul 10 19:25:02 r2d2.m01.eu systemd[1]: Starting dhcpcd on all interfaces...
Jul 10 19:25:02 r2d2.m01.eu dhcpcd[573]: no valid interfaces found
Jul 10 19:25:02 r2d2.m01.eu systemd[1]: Started dhcpcd on all interfaces.
Jul 10 19:25:02 r2d2.m01.eu dhcpcd[587]: enp0s25: adding address fe80::ad3f:963a:dd89:8c7e
Jul 10 19:25:03 r2d2.m01.eu dhcpcd[587]: enp0s25: waiting for carrier
Jul 10 19:25:03 r2d2.m01.eu dhcpcd[587]: enp3s0: adding address fe80::820e:bb77:4018:8b85
Jul 10 19:25:03 r2d2.m01.eu dhcpcd[587]: enp3s0: waiting for carrier
Jul 10 19:25:03 r2d2.m01.eu dhcpcd[587]: enp3s0: carrier acquired
...

Notice the first error message. It then goes on to find my 2 NICs.

Thank you very much!

I guess another way to fix this would be to only enable dhcpcd on the one interface I need it on (enp0s25); I think that would have the same effect.

Last edited by m01 (2015-07-10 18:29:06)

Offline

#6 2015-07-10 18:59:02

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: eth0 AND enpXXX on the same machine without any naming config?

m01 wrote:

I guess another way to fix this would be to only enable dhcpcd on the one interface I need it on (enp0s25); I think that would have the same effect.

Yes, that is possible, too.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB