Page 1 of 1

WLANx Assignment based on MAC address

Posted: Sun Nov 12, 2017 9:34 pm
by Paul01
Hey out there,

I am using a RPI3b with Raspbian kernel version: 4.9.61-v7+
This was obtained via rpi-upgrade (required for getting my Wifi USB stick Edimax EW-7811UTC going).

What I am trying to reach:
I making use of 2 WIFI's.
1) The native onboard one - Wireless N
2) USB stick EdiMax EW-7811UTC Wireless AC

The USB stick I want to use for connecting via Wifi to an available Wifi router to be able to access the internet.
The Native one I want to setup as a Wifi Access Point for setting up a local network, such I can connect with my phone or tablet via VNC, such I can use it as my screen.

I was able to get the Edimax running (quite some work, but it worked out).

After that while trying to setup the native onboard Wifi as Wifi access point I am running from one issue in the other. Fighting my way true it, I ran into the issue that both WIFI's each time swap interface name.
Once in a while the native onboard one appears as wlan0 and the other one as wlan1. So I realized I have to tackle that issue first.
I need to ensure that both Wifi's each have a consistent interface assignment.

Searching the internet I found my pointers, but each time slightly different (seems to be dependent on linux version used etc).
All are pointing into the direction of /etc/udev/rules/.d or lib/udev/rules.d
One is directed to change files like:
The idea is to bind the MAC address to a specific interface name.

However the tips are not consistent and seems to be linux variant dependent.

Can someone guide me through the process and instruct me how to do it for my specific setup?

Many thanks up front!

Have a nice day!


Re: WLANx Assignment based on MAC address

Posted: Sun Nov 12, 2017 10:00 pm
by SurferTim
To use mac based interface names in Stretch
Remove or move the file /etc/systemd/network/
Replace with a text file /etc/systemd/network/ that contains this:

Code: Select all

NamePolicy=kernel database onboard slot path mac

Re: WLANx Assignment based on MAC address

Posted: Sun Nov 12, 2017 11:00 pm
by Paul01
Hey SurferTim,

You seem to know your stuff well.
Long interface names though now the MAC address is part of it!!!!
Many thanks!!!!!!

Great stuff.