WiFi configuration for different computers with wpa_supplicant
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
WiFi configuration for different computers with wpa_supplicant
I am looking for some advice on managing wireless connections with wpa_supplicant. First some background on what I have done so far. My build is LFS 7.9-systemd built on a 32GB USB flash drive with the following from BLFS installed:
I created configuration files for systemd-networkd to use dhcp for both wired and wireless connections. I then created a wpa_supplicant configuration file (/etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf) for wlp2s0 and added information for my home and work router. Everything works when used on the same laptop at home or at work. But when I booted to a different laptop at work, the interface was no longer wlp2s0, but was wlp5s0. To make it work, I created a link to the wlp2s0 file (/etc/wpa_supplicant/wpa_supplicant-wlp5s0.conf -> /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf), enabled it, and this worked.
Now for my question. Is there a better way to handle this situation when booting on different computers? Perhaps a way to force the wifi interface (if one exists) to be named the same thing no matter what computer it is booted on? This is my first LFS build, so I will appreciate any comments or criticism on what I have done so far, or any advice on how to proceed from here. Thanks!
Thanks spiky, but I don't think that will do what I want. If I understand correctly, your proposal would name a specific network card to wlan0. If I boot the USB flash drive on the same computer, I am pretty sure the name that udev assigned is consistent. It is when I boot my system on a different computer, (with a different network card) that I get a different name.
What I am asking for is if there is a way to assign the first wireless interface found (if any) on any computer to a specific name so I wouldn't have to add a separate configuration file for wpa_supplicant to recognize the card. The way I am doing it now is fine for my purposes, but in the interest of learning I was wondering if there is a way to accomplish this. Thanks again for your help.
so my thoughts were it would pick up the mac address for the card, Assign it to wlan0 each card would have different mac addresses
but the mac address would only work as per card present in what ever machine
It wont hurt to try it
FYI
I have 2 cards so name wlan0 and wlan1. and give each 1 there own config
same princable
I see now. Thanks for teaching me this. I will play around with this option. I may end up sticking with creating a new config for wpa_supplicant instead, but I like that I learned to use another tool. I'll do some searching, but do you know what to use to activate the new rules without rebooting?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.