Connect to a wireless access point from command line in Ubuntu using nmcli

View available wifi networks

  • nmcli dev wifi

Connect to a specific network

  • sudo nmcli device wifi connect FistOfTheNorthStar_5G password ATATATATATATATAAAA
    • In this example, FistOfTheNorthStar_5G is the SSID and the password is ATATATATATATATAAAA
    • Keep in mind that the password is plain text so if someone is watching you type it, they will see your password.
    • When typing the SSID (name of the wireless network) you can press tab after typing the first few letters and it will auto-complete.
    • Once connected, the computer will automatically try to reconnect to that same connection if it is rebooted.

Disconnect the wireless connection

  • sudo nmcli device disconnect (insert wireless network adapter name here)
    • The adapter name can be quickly found via ‘ifconfig | grep wl’
    • Also you do not need to disconnect first if you want to switch to another wireless network

View ip address information for your wireless network adapter (the name of the adapter typically starts with ‘wl’ for wireless lan)

  • ifconfig

View wireless statistics such as transmit power and frequency for your wireless adapter and access point (the name of the adapter typically starts with ‘wl’ for wireless lan)

  • iwconfig

To test the speed of the connection

  • speedtest-cli
    • If this is not installed, you can install it via ‘sudo apt install speedtest-cli’