Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use /etc/network/interfaces file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under /etc/netplan/ directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in Ubuntu 18.04 LTS server and desktop editions.
Configure Static IP Address In Ubuntu 18.04 LTS Server
Let us find out the default network configuration file:
$ ls /etc/netplan/ 50-cloud-init.yaml
As you can see, the default network configuration file is 50-cloud-init.yaml and it is obviously a YAML file.
Now, let check the contents of this file:
$ cat /etc/netplan/50-cloud-init.yaml
Add the configuration for available interfaces like eth0: and eth1:
network:
ethernets:
eth0:
addresses:
- 192.168.1.9/24
dhcp: false
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
- 8.8.8.8
- 8.8.4.4
search: []
eth0:
addresses:
- 192.168.1.9/24
dhcp: false
version: 2
Recent Comments