SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: predictable interface names failing in Stretch

Sat Sep 09, 2017 7:38 pm

I think I'll stick to the not-so-new unpredictable eth0 interface name, at least for now. The wifi interfaces seem to have the correct wlan0/wlan1 interface names. I'll test it for a while and see how it does.

User avatar
DougieLawson
Posts: 36557
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: predictable interface names failing in Stretch

Sat Sep 09, 2017 9:20 pm

SurferTim wrote:
Sat Sep 09, 2017 4:01 pm

Maybe I misunderstood. Is the predictable interface name eth0?
No. Because it depends what order the kernel sees the interfaces when it's enumerating them. If you have two ethernets or two WiFi dongles it will get confused (it could be down to which USB ports they're plugged in).

Predictable uses the device MAC address (which is usually burned in to the hardware) so it doesn't matter when the kernel sees it the name is always predictable (albeit that it's obscure).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: predictable interface names failing in Stretch

Sat Sep 09, 2017 9:31 pm

DougieLawson wrote:
SurferTim wrote:
Sat Sep 09, 2017 4:01 pm

Maybe I misunderstood. Is the predictable interface name eth0?
No. Because it depends what order the kernel sees the interfaces when it's enumerating them. If you have two ethernets or two WiFi dongles it will get confused (it could be down to which USB ports they're plugged in).

Predictable uses the device MAC address (which is usually burned in to the hardware) so it doesn't matter when the kernel sees it the name is always predictable (albeit that it's obscure).
That is exactly what used to happen in Stretch prior to the 2017-09-07 release. I have not had that problem with this release with wlan0 and wlan1. They have always come up with the onboard wifi being wlan0 and the usb wifi as wlan1. Just saying. I didn't mind "the new, MAC-address-based, naming convention". It was a bit clumsy setting up iptables and dhcpcd.conf. I can adapt either way.

emw
Posts: 47
Joined: Tue Apr 12, 2016 2:53 pm

Re: predictable interface names failing in Stretch

Thu Nov 30, 2017 5:44 pm

My experience with post 2017-09-07 release has been different. Things work on nicely with both predictable on or off if you do a power on reset (onboard = wlan0) however if you do a soft reset (sudo reboot) the interfaces sometimes come up reversed (onboard = wlan1). This happens even with predictable names (i.e onboard = wlan1, usb = wlx... rather than onboard =wlan0, usb = wlx...).

I've also found that if you have predictable names enabled then down/up a usb wifi adapter (edimax in my case) it will not (usually) reconnect to the router. The on board or the usb if predictable names are disable are able to (usually) reconnect to the router. I have indicated (usually) because I believe I have had the opposite case happen a few times while I was playing around. I am currently trying to check this one way or the other.

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: predictable interface names failing in Stretch

Thu Nov 30, 2017 7:10 pm

emw wrote:
Thu Nov 30, 2017 5:44 pm
This happens even with predictable names (i.e onboard = wlan1, usb = wlx... rather than onboard =wlan0, usb = wlx...).
Interesting. I had wondered whether that was possible.

In this case you may need to enable MAC address naming for the onboard interface as well. You can do that by deleting /etc/systemd/network/99-default.link if it is a symlink, and creating it to include the "mac" policy:

Code: Select all

[Link]
NamePolicy=kernel database onboard slot path mac
MACAddressPolicy=persistent

sparkie777
Posts: 121
Joined: Tue Nov 27, 2012 4:37 am

Re: predictable interface names failing in Stretch

Thu Nov 30, 2017 8:09 pm

emw wrote:
Thu Nov 30, 2017 5:44 pm
however if you do a soft reset (sudo reboot) the interfaces sometimes come up reversed (onboard = wlan1). This happens even with predictable names (i.e onboard = wlan1, usb = wlx... rather than onboard =wlan0, usb = wlx...).
1. just switch off (if not done already) the so called 'predictable' stuff. You do not want this.

Code: Select all

ln -s /dev/null /etc/systemd/network/99-default.link
2. create a file :
/etc/udev/rules.d/72-static-name.rules

Code: Select all

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="brcmfmac", NAME="wlan1"
and you will get true predictable behavior with convenient device names. Onboard wlan gets assigned wlan1 always. Your USB dongle (if applicable) gains wlan0. Fiddling with clumsy MAC addresses is no longer required.

please see also
How do you force a wifi interface to be a certain wlanX?
Last edited by sparkie777 on Sat Dec 02, 2017 5:45 am, edited 1 time in total.

sparkie777
Posts: 121
Joined: Tue Nov 27, 2012 4:37 am

Re: predictable interface names failing in Stretch

Fri Dec 01, 2017 3:01 pm

inspired by this thread (and because I had similar problems in the past myself) I now dug deeper into this.

What came out is this more general approach: [HOWTO] assign predictable WLAN device names without fiddling with MAC addrs - Raspberry Pi Forums

pierrecabral
Posts: 1
Joined: Thu Sep 07, 2017 11:24 pm

Re: predictable interface names failing in Stretch

Mon Feb 26, 2018 12:01 am

sparkie777, you are a legend! Fix the network name by driver name was the best one.

Thank you very much!

Return to “Troubleshooting”