how to connect wifi?

Archlinux use iwd to connect wifi.

  1. $ systemctl start iwd
  2. $ iwctl
  3. $ station wlan0 scan
  4. $ station wlan0 get-networks
  5. $ station wlan0 connect everxyz
  6. $ station wlan0 show

However, you’re unable to surf the internet right now. Restart your computer and enter liveUSB:

  1. $ mount /dev/sda2 /mnt
  2. $ arch-chroot /mnt
  3. # connect wifi

And install these packages

  1. $ pacman -S dhcpcd

Edit the file in /etc/dhcpcd.conf:

  1. interface wlan0
  2. static ip_address=192.168.31.117/24
  3. static routers=192.168.31.1
  4. static domain_name_servers=192.168.31.1 8.8.8.8

Then run dhcpcd:

  1. $ dhcpcd

That’s it!


使用内置 dhcp

iwd

Since version 0.19, iwd can assign IP address(es) and set up routes using a built-in DHCP client or with static configuration. It is a good alternative to standalone DHCP clients. To activate iwd’s network configuration feature, create/edit /etc/iwd/main.conf and add the following section to it:

编辑 /etc/iwd/main.conf

  1. [General]
  2. EnableNetworkConfiguration=true
  3. [Network]
  4. EnableIPv6=true