Paul01
Posts: 7
Joined: Sat Feb 09, 2013 5:40 pm

WLANx Assignment based on MAC address

Sun Nov 12, 2017 9:34 pm

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:
/lib/udev/rules.d/75-persistent-net-generator.rules
/etc/udev/rules.d/70-persistent-net.rules
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!

Cheers,
Paul

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

Re: WLANx Assignment based on MAC address

Sun Nov 12, 2017 10:00 pm

To use mac based interface names in Stretch
Remove or move the file /etc/systemd/network/99-default.link
Replace with a text file /etc/systemd/network/99-default.link that contains this:

Code: Select all

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

Paul01
Posts: 7
Joined: Sat Feb 09, 2013 5:40 pm

Re: WLANx Assignment based on MAC address

Sun Nov 12, 2017 11:00 pm

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.

Cheers,
Paul

Return to “Troubleshooting”