Linux/Wifi

From Wiki

Get infos

  • list network hardware
lshw -class network
  • show all network devices
ifconfig -a
  • get wifi information
iwconfig
  • bring interface up
ifconfig wlan0 up
  • show supported channels
iwlist wlan0 channel
  • scan for wifi networks
iwlist wlan0 scan | grep ESSID
  • scan and show channel usage
sudo iwlist wlan0 scan | grep Frequency | sort | uniq -c | sort -n


configuration

  • get country information
iw reg get
  • set country information
iw reg set DE
  • install WPA support
sudo apt install wpasupplicant
  • /etc/wpa_supplicant/wpa_supplicant.conf
network={
    ssid="xxxSSIDxxx"
    psk="xxxPASSWORDxxx"
}
  • bring interface up
ifconfig wlan0 up
  • connect to WPA wifi
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext
# add -B for background
  • get IP
dhclient wlan0
  • /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet dhcp
      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Troubleshooting

  • airplane mode?
rfkill list all