[Linux] How to connect to wireless WPA2 with Netplan
by moondaddi on 2018-12-10
Netplan is the utility for easily configuring networking on a linux system. Ubuntu 17.10 starts including the netplan by default instead of deprecated ifupdown.
How to connect
Check the network interface
Make new file with any name *.yaml in
You can make as many configuration files as you want. In that case, *.yaml files will be applied by alphbetically.
network: version: 2 renderer: networkd ethernets: # this is for lan enp2s0: addresses:  dhcp4: true wifis: # this is for wlan wlp3s0: # wlan interface access-points: "SSID": # your SSID password: "PASWORD" # your PASSWORD dhcp4: no dhcp6: true addresses: [192.168.0.200/24] # set the static IP gateway4: 192.168.0.1 # gateway nameservers: addresses: [192.168.0.1,188.8.131.52,184.108.40.206]
How to check wlan interface
The configuration files
/etc/netplan/*.yaml needs to be generated before applying to system. The .conf files will be generated in `/run/netplan/.conf` which shadow completely YAML files.
sudo netplan --debug generate
Apply the generated conf
sudo netplan apply
Netplan reference page (https://netplan.io/reference)