LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 04-12-2016, 12:27 PM   #1
hpmachining
LQ Newbie
 
Registered: Apr 2016
Posts: 15

Rep: Reputation: 1
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:

Nano-2.3.6
cpio-2.11
Lynx-2.8.8
OpenSSL-1.0.1.1i
OpenSSH-6.6p1
Wget-1.15
GPM-1.20.7
Sudo-1.8.10p3
Which-2.20
pciutils-3.2.1
Wireless Tools-29
wpa_supplicant-2.2

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!
 
Old 04-12-2016, 01:38 PM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

You can create a /etc/udev/rules.d/70-persistent-net.rules file

Code:
# net device iwl3945
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:02:af:ed:e0", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="wlan0"
you would have to change the 00:13:02:af:ed:e0 to the mac address of the device/s
 
1 members found this post helpful.
Old 04-12-2016, 02:30 PM   #3
hpmachining
LQ Newbie
 
Registered: Apr 2016
Posts: 15

Original Poster
Rep: Reputation: 1
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.
 
Old 04-12-2016, 02:37 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
create for each card that you have


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
 
1 members found this post helpful.
Old 04-12-2016, 04:16 PM   #5
hpmachining
LQ Newbie
 
Registered: Apr 2016
Posts: 15

Original Poster
Rep: Reputation: 1
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?
 
Old 04-12-2016, 05:01 PM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
you could try
Code:
systemctl restart systemd-networkd.service
But a reboot might be nessecary
 
  


Reply

Tags
wifi, wpa_supplicant



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A few wifi problems, both with wpa_supplicant/dhcpcd and NetworkManager theactionindex Slackware 7 08-21-2015 05:03 PM
Wifi freeze Realtek 8188 wpa_supplicant liquidkaleidoscopes Slackware 4 01-06-2014 09:22 AM
Wifi / wpa_supplicant weirdness Pscylo Slackware 1 06-27-2008 07:39 PM
hostap wpa_supplicant wifi connects but no services available KrazyKanuk Linux - Wireless Networking 2 09-17-2007 12:28 PM
[wifi][debian] Wpa_supplicant problems .. Mycado Linux - Newbie 7 10-03-2006 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration