Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev-197-r4: renamed eth0 to enp1s4 and enp0s4 [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 443

PostPosted: Wed Jan 30, 2013 9:33 pm    Post subject: udev-197-r4: renamed eth0 to enp1s4 and enp0s4 [solved] Reply with quote

Hi,

I've updated udev-197-r4. Now I have problems with my network interface.

/etc/init.d/net.enp0s4 and /etc/init.d/net.enp1s4 are added to the default runlevel
Code:
# rc-update show | grep net.enp
           net.enp0s4 |      default                                 
           net.enp1s4 |      default

The dmesg output looks interesting:
Code:
skge: 1.14 addr 0xec000000 irq 17 chip Yukon-Lite rev 7
skge 0000:01:04.0: eth0: addr 00:11:2f:d5:ff:75
systemd-udevd[710]: renamed network interface eth0 to enp1s4
forcedeth 0000:00:04.0: ifname eth0, PHY OUI 0x732 @ 1, addr 00:11:2f:d5:e4:b3
systemd-udevd[708]: renamed network interface eth0 to enp0s4
forcedeth 0000:00:04.0: enp0s4: no link during initialization
skge 0000:01:04.0: enp1s4: enabling interface
skge 0000:01:04.0: enp1s4: Link is up at 100 Mbps, full duplex, flow control both

I have two network cards. Only one is connected. I wonder why eth0 is renamed twice. I think with udev-197 the network names should be persistent.
ifconfig looks good:
Code:
# ifconfig
enp0s4: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.178.20  netmask 255.255.255.0  broadcast 192.168.178.255
        ether 00:11:2f:d5:e4:b3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp1s4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.21  netmask 255.255.255.0  broadcast 192.168.178.255
        ether 00:11:2f:d5:ff:75  txqueuelen 1000  (Ethernet)
        RX packets 37  bytes 2670 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17  bytes 1166 (1.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Lokale Schleife)
        RX packets 1  bytes 80 (80.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1  bytes 80 (80.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But e.g. ping does not work.

Only after stopping net.enp0s4 and net.enp1s4 and restart of net.enp1s4 it works

/etc/conf.d/net looks like this:
Code:
modules="wpa_supplicant"
wpa_supplicant_wlan0="-Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log -dd"
wpa_timeout_wlan0=60

config_enp0s4="192.168.178.20 netmask 255.255.255.0 broadcast 192.168.178.255"
config_enp1s4="192.168.178.21 netmask 255.255.255.0 broadcast 192.168.178.255"
config_wlan0="192.168.178.22/24"

routes_enp0s4="default via 192.168.178.1"
routes_enp1s4="default via 192.168.178.1"
routes_wlan0="default via 192.168.178.1"

dns_servers_enp0s4="208.67.222.222"
dns_servers_enp1s4="208.67.222.222"
dns_servers_wlan0="208.67.222.222"

rate_wlan0="5.5M auto"

Does anybody knows how to configure the network card correctly? is there anywhere a good tutorial for setting up network cards with the new udev version?


Last edited by samo on Sat Feb 02, 2013 9:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8592

PostPosted: Thu Jan 31, 2013 2:53 am    Post subject: Reply with quote

This looks like a fundamental misconfiguration of your network setup, not related to the udev names. You have three different devices all assigned addresses in the same subnet, and all of them set to be the default route. This might work if you take care never to have more than one of them started at any given time.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 396
Location: San Diego, California USA

PostPosted: Thu Jan 31, 2013 4:31 am    Post subject: Reply with quote

I agree. What is it you are trying to achieve by having 3 network interfaces all on the same subnet?
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 443

PostPosted: Thu Jan 31, 2013 5:42 am    Post subject: Reply with quote

I would like to use lan or wlan alternatively. Normally I want to be connected via wlan. lan is only used when wlan is not available or in case of problems with wlan.

Is it necessary to remove the configuration of the unused device in /etc/conf.d/net? Or is it sufficient to remove the init script /etc/init.d/net.enp0s4 from the default runlevel?

Removing the init script is not sufficient. The output of dmesg and ifconfig looks same like before. eth0 is still renamed twice.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 443

PostPosted: Thu Jan 31, 2013 8:11 pm    Post subject: Reply with quote

Now I have removed the configuration of the unused device. But eth0 is still renamed twice.

rc.log gives following info now:
Code:
 * Bringing up interface enp0s4
 *   No configuration specified; defaulting to DHCP
 *   dhcp ...
 *     Running udhcpc ...
 *     start-stop-daemon: failed to start `/bin/busybox'
 [ !! ]
 [ !! ]
 * ERROR: net.enp0s4 failed to start
 * Bringing up interface enp1s4
 *   192.168.178.21 ... [ ok ]
 *   Adding routes
 *     default via 192.168.178.1 ... [ ok ]

I wonder why dhcp is starting. I didn't configure it because I would like to use static addresses. Is this done automatically by udev? Can I change this behaviour?
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8592

PostPosted: Thu Jan 31, 2013 11:22 pm    Post subject: Reply with quote

According to the upstream udev maintainers, eth0 is supposed to be renamed twice. Under their latest naming scheme, your kernel always names the Ethernet card ethN, then udev races in and renames it to something else. Sometimes, udev arrives fast enough to free up the name eth0 before the next card is discovered and named. Sometimes, it may not. Either way, it is normal for all your other applications to see the card appear under one name, then change names a moment later. It is strange that enp0s4 is brought up on DHCP, assuming that the network configuration you pasted earlier is still accurate.
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 443

PostPosted: Fri Feb 01, 2013 5:12 am    Post subject: Reply with quote

Not exactly. According the hints above I've removed the configuration for the unused enp0s4 device. Additionally I've renamed the wlan device according the new udev name. Now /etc/conf.d/net looks as follows:
Code:
modules="wpa_supplicant"
wpa_supplicant_wlp0s2f2u5="-Dwext -iwlp0s2f2u5 -c/etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log -dd"
wpa_timeout_wlp0s2f2u5=60

config_enp1s4="192.168.178.21 netmask 255.255.255.0 broadcast 192.168.178.255"
config_wlp0s2f2u5="192.168.178.22/24"

routes_enp1s4="default via 192.168.178.1"
routes_wlp0s2f2u5="default via 192.168.178.1"

dns_servers_enp1s4="208.67.222.222"
dns_servers_wlp0s2f2u5="208.67.222.222"

rate_wlp0s2f2u5="5.5M auto"


Following scripts are started in the default runlevel:
Code:
           net.enp1s4 |      default                                 
       net.wlp0s2f2u5 |      default

net.enp0s4 is not started.

Is there a way to check the dhcp configuration?
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 443

PostPosted: Sat Feb 02, 2013 9:16 pm    Post subject: Reply with quote

I've got a solution here
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum