Configure static IP address using Netplan
Step 1 : Install the net-tools package
sudo apt install net-tools
Step 2 : Get a list of available interfaces using the following command:
ifconfig -a
Step 3 : Open /etc/netplan/50-cloud-init.yaml
sudo nano /etc/netplan/50-cloud-init.yaml
Step 4 : Find the following lines:
dhcp4: true
Step 5 : Change the preceding line to add an IP address, net mask, and default gateway (replace samples with the respective values):
addresses: [192.168.1.15/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
dhcp4: no
Step 6 : Apply the network service for the changes to take effect
sudo netplan apply
Step 7: Try to ping a remote host to test the network connection
ping www.google.com
Francisco
Thank you for sharing. Just what I needed.