Skip to content

Instantly share code, notes, and snippets.

@zh4n7wm
Last active December 18, 2020 13:06
Show Gist options
  • Save zh4n7wm/5d56ff99a996e3e635032e7faa4372e0 to your computer and use it in GitHub Desktop.
Save zh4n7wm/5d56ff99a996e3e635032e7faa4372e0 to your computer and use it in GitHub Desktop.
Arch Linux Tips

wireless

install wpa_supplicant and dhcpcd

sudo pacman -S wpa_supplicant dhcpcd

get wireless network interface

ip link

generate config file

wpa_passphrase your-ssid your-password

write config file to /etc/wpa_supplicant/wpa_supplicant-%I.conf, replace %I with your network interface, e.g.: wlan0 or wlo1 ...

# edit `/etc/wpa_supplicant/wpa_supplicant-%I.conf`, my network interface is `wlo1`

mkdir -p /etc/wpa_supplicant

cat /etc/wpa_supplicant/wpa_supplicant-wlo1.conf

ctrl_interface=/run/wpa_supplicant GROUP=wheel

network={
	ssid="your-ssid"
	scan_ssid=1
	key_mgmt=WPA-PSK
	#psk="your-password"
	psk=replace-with-yourself
}

test connection

connect wifi

wpa_supplicant -B -i wlo1 -c /etc/wpa_supplicant/wpa_supplicant-wlo1.conf

check connection

ip addr show

if got ip address, then you can test by ping archlinux.org

start wifi on boot

sudo systemctl enable wpa_supplicant@wlo1
sudo systemctl enable dhcpcd@wlo1

static ip

edit /etc/dhcpcd.conf, dhcpcd docs

interface wlo1
static ip_address=192.168.0.10/24	
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment