2018年1月21日日曜日

Arch Linux Wifi Setup

Setting up wifi on Arch Linux Laptop

archlinux wiki reference

Setting up Manually

  • Show network interface
    • iw dev
  • Show network interface status
    • iw dev $interface link
  • Activate interface (if necessary)
    • ip link set $interface up
    • ip link show $interface check it’s up
  • Discover access points (if you don’t know the SSID)
    • iw dev $interface scan | less
  • Connect to an AP
    • use wpa_suppicant

Connect to AP with wpa_supplicant

  • Configure settings with wpa_passphrase
    • wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/my_config.conf
  • Connect
    • wpa_supplicant -B -i interface -c /etc/wpa_supplicant/my_config.conf
    • dhcpcd interface
      start dhcp to get ip address (if wpa_supplicant run successful dhcp may work automatically and interface card obtain ip address)

Caution

If you already setup wpa_supplicant as startup service or run several times you can see several process running by ps aux | grep wpa_supplicant. In this situation wpa_supplicant command will not work correctly. Kill all wpa_supplicant process by killall wpa_supplicant before configuration.

Setting up Startup Service

  • systemctl enable wpa_supplicant@interface.service
  • systemctl enable dhcpcd@interface

Actually this set up didn’t work for me at first.
It seems I set up before using automatic setting with netctl. I can see right now by systemctl and netctl-auto@interface.service and dhcpcd@interface.service are there. It seems that two different network service running is the cause of problem.

So I disable it by systemctl disable netctl-auto@interface.

Then after rebooted, it’s working now!
Phew…

Written with StackEdit.