Wi-Fi

Publish date: Mar 7, 2019
Tags: wi-fi, linux, cli

Table of Contents

  1. nmcli
    1. list
    2. connect
    3. show
    4. dns
    5. dhcp
      1. add new wifi connection
      2. set password

nmcli

list

nmcli device wifi list

connect

# nmcli device wifi connect "minha_rede" password "123456"
# nmcli device wifi connect <network> password <password>

show

nmcli con show -a
# nmcli c s -a

dns

# nmcli con mod "<network>" ipv4.dns "<primary-dns> <secondary-dns>"
nmcli con mod "minha_rede" ipv4.dns "1.1.1.1 1.0.0.1"
nmcli con down "minha_rede"
nmcli con up "minha_rede"

dhcp

add new wifi connection

nmcli con add con-name <new-connection-name> ifname wlp2s0 type wifi ssid <ssid> ip4 <dhcp-cidr-range> gw4 <gateway-ipv4>

# example
nmcli con add con-name m5g ifname wlp2s0 type wifi ssid "MORITZ-5G" ip4 192.168.0.30/32 gw4 192.168.0.1

set password

nmcli con modify m5g wifi-sec.key-mgmt wpa-psk
nmcli con modify m5g wifi-sec.psk <my-pass-here>