Automatic connection to the WiFi network

Hello everyone,

NomadBSD 130R-20210508 (64-bit/x86-64/amd64) with Xfce4.

Does anyone know how to automatically activate the wifi network on startup without having to manually click on it among the others offered by networkmgr ?
I surely looked badly because I can’t find anything functional. For example, I deleted networkmgr to replace it with wifimgr and found that the wifi no longer existed …

FYI, nomadbsd works really well with Xfce…

Many thanks.

Hi. I’m using Openbox, and as is detailed in the topic octopkg-updated-316-packages-and-broke-the-desktop, i had put the instruction “sudo -E networkmgr&” on $HOME/.config/openbox/ and each time i start the computer it run that instruccion and connect to my wifi automatically. I suppose XFCE must have some file that can run on start the same type of instruction.

Hi PacoFdezSimon,
Thank you for your answer.
Whether it’s Xfce or Openbox, the WiFi network does not connect automatically. My autostart file (with Openbox) is however configured correctly (sudo -E networkmgr is enabled by default), my wpa_supplicant.conf is correct too, as is my rc.conf.
Anyway, I’m giving up for now and going back to ghostBSD.
Many thanks and maybe see you soon…

For the automatic wifi connection at boot time, neither wifimgr nor networkmgr is needed.
I deinstalled the networkmgr, added the following lines:

dhclient_flags_wlan0="-b -q -u -p /var/spool/"
create_args_wlan0="down country DE"
ifconfig_wlan0="up scan WPA DHCP"

to /etc/rc.conf and edited the /etc/wpa_supplicant.conf file accordingly.
So on boot, wifi connection is established automatically.

:~ # ps aux | grep -i wpa
root        467   0.0  0.1   18484  6840  -  Ss   14:17    0:00.03 /usr/sbin/wpa_supplicant -qq -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd -P /var/run/wpa_supplicant/wlan0.
1 Like

Hi o428tmp,

I reinstalled nomadBSD (while keeping Openbox) and found that proceeding in this way changes absolutely nothing : no automatic WiFi connection on boot.
Thanks anyway.

Try this: First create /etc/wpa_supplicant.conf:

sudo ee /wpa/supplicant.conf

Put this in the file (you can copy/paste this, but change to your settings, don’t forget the " "):

    ssid="your network's name"
    psk="your wifi password"

Now edit your /etc/rc.conf file as follows:

sudo ee /etc/rc.conf

and insert these lines anywhere in the file (the file is read top-to-bottom and executed that way on boot, so I normally keep these lines in the upper half):

create_args_wlan0="down country US"
ifconfig_wlan0="up scan WPA DHCP"
ifconfig_wlan0_ipv6="inet6 accept_rtadv"

The above lines are in my NomadBSD rc.conf. They are a bit different than my vanilla FreeBSD rc.conf, but they seem to work on my Nomad laptop. Change the country setting to your location, of course, and you can eliminate the ipv6 lines if they don’t pertain to your network.

Hope it works. I think your issue is the wpa_supplicant thing, if you can connect by clicking on the network through network manager.

@christophe60_fr Welcome to this forum! Hope you enjoy it and have a great time here hanging out!