21

Running Arch Linux with kernel 3.6.11-12-ARCH+ on my Raspberry Pi.

I have a Linksys wifi usb dongle (WUSB54GC v3) that is running and working after I execute the following commands:

$> sudo ifconfig wlan0 up
$> sudo iwlist scan
$> sudo iwconfig wlan0 mode managed essid myssid key "mykey" retry 7
   # Only had to do this next one the first time
$> sudo wpa_passphrase myssid "mypassword" > /etc/wpa_supplicant/wpa_supplicant.conf 
$> sudo wpa_supplicant -B -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
$> sudo dhcpcd wlan0

How do I get wifi on this device to work every time after booting? Eventually I want to deploy it in location without a wired connection (hence the wifi), but I obviously can't do that if I have to manually start/connect the wifi every time.

migrated from serverfault.com Jun 24 '13 at 3:12

This question came from our site for system and network administrators.

  • Wireless is best managed via a daemon such as network-manager or wicd. – jordanm Jun 24 '13 at 3:34
  • 1
    Did you try this instruction to automatically connect to wireless networks: wiki.archlinux.org/index.php/Netcfg – Raza Jun 24 '13 at 4:56
  • 3
    netcfg is depreciated in favour of netctl (not sure if that change has been reflected in the ARM respin of Arch yet though), but yes that is the way to handle your network config. – fukawi2 Jun 24 '13 at 5:18
18

You should use netctl. It is the Arch Linux built in network management system. If it isn't already installed (it should be though), run pacman -Syu netctl then look in /etc/netctl. There are example configuration files in /etc/netctl/examples. To use an example, just copy it to /etc/netctl and edit it to fit your set up. So for your case, run cp /etc/netctl/example/wireless-wpa /etc/netctl/somedescriptivename then edit /etc/netctl/somedescriptivename to fit your set up.
To enable auto configuration of your wireless networks with systemd, make sure the wpa_actiond package is installed and enable the service: systemctl enable netctl-auto@wlan0.service

For more information please refer to the Netctl wiki entry.

  • that netctl-auto list returns no profiles, whereas 4 are configured and work with manual netctl is expected or anormal ? How can I use netctl-auto switch-to X if there are seemingly no valid X values ? I find the netctl-auto arch wiki entry surprisingly unhelpful, maybe you know where to find a better doc ? – Nikana Reklawyks Feb 3 '17 at 18:55
  • Nikana, I don't use netctl-auto very much, but just a few tips: 1. netctl-auto is for wireless connections only. If you're looking to use it for ethernet, use netctl-ifplugd. 2. Make sure you do not use wpa-config as the security method, and instead of wpa-configsection or wpa. Profiles will not show up when using wpa-config – Jacob Wiltse Feb 10 '17 at 20:23
  • Thank you. Unfortunately for future viewers, my setup works now, not that I recall doing anything special. netctl-auto list returns a bunch of profiles as it should. I think maybe one of my profiles was not compatible with netctl-auto because of this no-wpa-config requirement, which prevented all of them from showing up. – Nikana Reklawyks Feb 10 '17 at 20:49
6

An easier way that eliminates some of the guesswork on how to make profiles for netctl (taken from the netctl page on the arch wiki):

Step 1. Setup wireless internet manually, using wpa_supplicant as described in the OP. If your system doesn't have it installed do $ pacman -S wpa_supplicant.

Step 2. You'll also need dialog package, so $ pacman -S dialog. Then, you could either reboot your system or disconnect from your wireless network.

Step 3. Run $ wifi-menu -o, then go through the very straightforward Windows/Mac-esque settings. You can check the preset value of your system's network id via $ sudo netctl list. The value would be in the format of wlan098-SSID. (where SSID = your WLAN's name)

Step 4. Finally run $ netctl enable wlan098-SSID and reboot the system $ reboot

Still, occasionally you might get an error message with something like temporarily unable to resolve name or something, but just try pinging again and it should work.

2

There's an easier way. Assuming you have a standard arch base-install (in 2019):

  1. Install dialog.
  2. Run wifi-menu.
  3. Arrow down, pick your desired connection, hit enter, accept connection-name, enter password.
  4. Run netctl list, to get your device-SSID.
  5. Run netctl enable [device-SSID], thenreboot`.

Use root permissions if you get permission error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.