systemd-network wireless setup

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

systemd-network wireless setup

Postby bittwister » Apr 5th, '16, 23:25

Trying to get wireless nic to work under systemd-network.service.
System has two fixed ip wired nics and wireless.
Moving wired nics under systemd-network has decreased boot time by ~40 seconds.

I want my wireless to connect to one of 4 modems by default. From what I misunderstand I should be able to link /etc/wpa_supplicant.conf to whichever /etc/wpa_supplicant/MODEM.conf and next reboot/network restart should have an established connection. So far have failed to bring up the wireless connection connected to modem.
route -n shows it there but can not ping yahoo.com if I drop the wired connection. Current settings:
Code: Select all
# cd /usr/lib/systemd/network/
# ls -1 *_my__*
10_my__enp3s0.network
11_my__enp4s0.network
12_my__wlp2s0.network

# grep -v ^# 10_my__enp3s0.network

[Match]
Name=enp3s0

[Network]
Description=LAN_NIC
DNS=127.0.0.1
Domains=home.test

[Address]
Address=192.168.11.132/24

[Route]
Gateway=192.168.11.1
----------------------
# grep -v ^# 12_my__wlp2s0.network

[Match]
Name=wlp2s0

[Network]
Description=WIFI
DNS=127.0.0.1

[DHCP]
RouteMetric=10
--------------------------

For above to work

systemctl mask network.service
systemctl mask network-up.service
systemctl mask NetworkManager.service
systemctl mask NetworkManager-wait-online.service

ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
systemctl enable  systemd-resolved
systemctl enable systemd-networkd
systemctl enable systemd-networkd-wait-online
reboot

bittwister
 
Posts: 47
Joined: Oct 5th, '13, 21:48

Re: systemd-network wireless setup

Postby doktor5000 » Apr 5th, '16, 23:46

bittwister wrote:Trying to get wireless nic to work under systemd-network.service.

May I ask why? Why not simply use networkmanager?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18020
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: systemd-network wireless setup

Postby bittwister » Apr 6th, '16, 00:57

I have pretty much have automated my clean install scripts.No network managers required.
Only reason I need an outbound wireless connection is so I can borrow my neighbor's connection to use my VOIP phone to call tech support if I lose internet.
bittwister
 
Posts: 47
Joined: Oct 5th, '13, 21:48

[SOLVED] Re: systemd-network wireless setup

Postby bittwister » Apr 9th, '16, 13:06

Solution was to create /etc/wpa_supplicant/ to hold my $MODEM.conf files.
Modify INTERFACES="" in /etc/sysconfig/wpa_supplicant to have my wireless interface device.
create a desired.conf in /etc/wpa_supplicant/
soft link /etc/wpa_supplicant.conf to /etc/wpa_supplicant/desired.conf.
start wpa_supplicant and run wpa_gui, to create/save the desired.conf file.

Most modems are setup as dhcpd servers to hand out dynamic ip addresses.
I like to setup my network with static ip addresses and so far any modem I have used allows me to pick an ip address.
You can use ifconfig -a to get your wireless device and its bssid value.
ssid and psk are from your router wireless settings.
If you have SSID broadcast disabled, I suggest enabling it until you get wap_gui to save your settings.

With all the above in mind, here is what I did.
Code: Select all
systemctl stop wpa_supplicant
mkdir -p  /etc/wpa_supplicant/
chmod 600 /etc/wpa_supplicant/

cp  /etc/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf_vinstall

ifconfig -a
  snippet of interest
wlp2s0: snip
        snip
        ether 70:f1:a1:e9:e0:a8
Using the above,

kwrite /etc/sysconfig/wpa_supplicant
and set     INTERFACES="-i wlp2s0"
save/quit

cd /etc/wpa_supplicant/
cat > fios.conf
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel
update_config=1
network={
        ssid="my_fios"
        bssid=18:1b:eb:fb:89:8d
        psk="snip e6dd6228a69 snip"
        scan_ssid=1
}
^d          #<=====   That is a Ctrl+d

ln -sf to /etc/wpa_supplicant/fios.conf /etc/wpa_supplicant.conf

and created /usr/lib/systemd/network/12_my__wlp2s0.network with

[Match]
Name=wlp2s0

[Network]
Description=WIFI
DNS=127.0.0.1

[Address]
Address=192.168.1.6/24

[Route]
Gateway=192.168.1.1
Metric=30


systemctl start wpa_supplicant
systemctl status wpa_supplicant

wpa_gui &



At this point you would click scan to see your router and use Manage Networks click Edit to set desired value and click SAVE.
If Current Status has SSID: BSSID: filled in, you have logged into the router. If not, keep playing with Manage Networks EDIT.

Note: if you have set your router it not broadcast SSID then add scan_ssid=1 in network section and remember to go back and disable it in the modem.
bittwister
 
Posts: 47
Joined: Oct 5th, '13, 21:48


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest