Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 22854  / 2 Years ago, sat, june 4, 2022, 3:40:05

For esoteric reasons I have a server which only has WiFi access to the network.


By copying the necessary dpkg files on a removable drive I've managed to install wpa_supplicant.


The thing that's bugging me is that on other distributions configuring it can be done by editing /etc/wpa_supplicant/wpa_supplicant.conf. But this doesn't work on Ubuntu because the systemd service file starts up wpa_supplicant without specifying a configuration file. There is no -c specified in its arguments.


Even the Ubuntu man page says the most common way to start it is by specifying a config file...



In most common cases, wpa_supplicant is started with:


         wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0


Because this is a server there is no GUI installed and I'm not using network manager (AFAIK)


I have of course confirmed that shutting down the systemd service and manually starting the Daemon from the command line will work. And I can of course modify the .service file. But this feels like the wrong solution.


Can anyone tell me how I am supposed to configure wpa_supplicant on Ubuntu server?


More From » networking

 Answers
0

It is not necessary to manually configure wpa_supplicant.



Networking in recent Ubuntu server versions is managed by netplan. Check to see the name of your netplan file:



ls /etc/netplan


I will assume that the name of the file you found is 01-netcfg.yaml. Substitute your details here if not 01-netcfg.yaml.



We will amend the file to specify your details:



sudo nano /etc/netplan/01-netcfg.yaml


Change the file to read:



network:
version: 2
renderer: networkd
wifis:
wlx-----:
dhcp4: yes
dhcp6: yes
access-points:
"network_ssid_name":
password: "**********"


Please substitute your wireless interface name here instead of wlx----. Please note that the access point name and password are enclosed in quotation marks ". Spacing, indentation, etc. are crucial, please proofread carefully twice.



Save (Ctrl+o followed by Enter) and exit (Ctrl+x) the text editor nano. Follow with:



sudo netplan generate
sudo netplan apply


If you instead prefer a static IP address for the server, you can find the template here:



cat /usr/share/doc/netplan/examples/wireless.yaml 

[#3396] Saturday, June 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
puccop

Total Points: 66
Total Questions: 99
Total Answers: 93

Location: Aruba
Member since Sun, Nov 27, 2022
2 Years ago
puccop questions
Thu, Feb 17, 22, 08:16, 2 Years ago
Fri, Jan 13, 23, 18:55, 1 Year ago
Fri, Jan 21, 22, 07:21, 2 Years ago
Thu, Jul 28, 22, 06:32, 2 Years ago
;