29

I have bought a Model A Pi, and I successfully configured it with a USB Wifi dongle on Raspbian. I recently prepared an SD card with the latest version of Arch Linux ARM and I am trying to get it set up with WiFi. I was trying to follow a Raspbian WiFi tutorial (thinking it could be the same as Arch Linux ARM) which said that there is a directory /etc/network/ and you could set up WiFi from the interface file, but no directory /etc/network/ exists. I heard about netctl but I have no Idea how to use it! I do have a supported USB WiFi dongle. Could someone please show me how I can setup WiFi on Arch Linux ARM? Thanks!

2

2 Answers 2

38

The deprecated netcfg used /etc/network.d/ to store profiles. The successor of netcfg is netctl.

In order to setup a wireless network, install netctl using sudo pacman -S netctl. Next, you have to create a network profile. /etc/netctl/examples/ contains some examples. Let's assume you want to setup a WPA2-PSK network. Simply copy over the example file and start editing:

/etc/netctl# install -m640 examples/wireless-wpa wireless-home
/etc/netctl# cat wireless-home
Description='A simple WPA encrypted wireless connection'
Interface=wlan0
Connection=wireless
Security=wpa

IP=dhcp

ESSID='MyNetwork'
# Prepend hexadecimal keys with \"
# If your key starts with ", write it as '""<key>"'
# See also: the section on special quoting rules in netctl.profile(5)
Key='WirelessKey'
# Uncomment this if your ssid is hidden
#Hidden=yes

Edit MyNetwork and WirelessKey as needed. Note the 640 permissions, you do not want to leak your wireless passphrase to the world!

Proceed with testing:

# netctl start wireless-home

If you do not get an error, you should be connected. Let's test this:

$ ping 8.8.8.8

To make this network start on boot:

# netctl enable wireless-home
7
  • I am getting an error that the job failed, what should I do?
    – user151324
    Jun 18, 2013 at 0:19
  • Use journalctl -af to watch your logs. There may be multiple reasons, like incorrect password or SSID. Perhaps you have to change wlan0 to something different due to a udev change, run ifconfig to determine the correct name for the wireless interface. If you have more bad luck, your USB dongle is not entirely supported by the driver.
    – Lekensteyn
    Jun 18, 2013 at 8:15
  • @Lkensteyn Okay, thanks, I have a supported wifi dongle and it worked out of the box with raspbian. I'll try it out! Thanks!
    – user151324
    Jun 18, 2013 at 14:41
  • 1
    Found this to be accurate, however, I ran into the following problems/solutions: "Profile <profile-name> does not exist or is not readable" - using a dash in the name of the profile causes some escape issues. had to take out the dash; "The interface of network profile <profile-name> is already up - had to take wlan0 down before starting my profile - ip link wlan0 down; netctl start <profile-name>
    – jlsecrest
    Jun 11, 2014 at 11:55
  • (errors above seen after running the command, failing, and then checking journalctl -xn)
    – jlsecrest
    Jun 11, 2014 at 12:01
7

This didn't work for me at first. After following the above instructions, I had to run

systemctl enable netctl-auto@wlan0

to make it work. I found the answer at the ArchLInux Arm Forum

1
  • Note that for this to work, you must disable all your netctl profiles first, e.g. # netctl disable home-wifi, and that the wlan0 has to match your interface name, not your profile under /etc/netctl/. After that's done, this seems spot-on. Aug 11, 2014 at 23:52

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