In Ubuntu 20.04 static IP needs to be set in netplan configuration. You can set it up by following the next steps
1. First you need to log in with your credentials. By default, the following credentials are set: Username: room
Password: roomaccess
2. Use the following command to view ip address. As you will see, a dynamic IP is assigned automatically. So, to make this IP address static, we must edit the netplan configuration file.
ip addr
To set up the static IP address via netplan you will first have to enter netplan configuration. You can do this by using the following command:
sudo vim /etc/netplan/60-visionect-network.yaml
network:
ethernets:
eth0:
dhcp4: true
eth1:
dhcp4: true
eth2:
dhcp4: true
version: 2
3. Above are the default entries, which shows that interface “eth0” is getting the IP from DHCP server. As it is a yaml file, so while making the changes in the file we must follow the correct indentation. Add the following lines to the yaml file,
network:
ethernets:
eth0:
dhcp4: true
addresses: [192.168.1.222/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8]
eth1:
dhcp4: true
eth2:
dhcp4: true
version: 2
5.When editing Yaml files, make sure you follow the YAML code indent standards. If the syntax is not correct, the changes will not be applied.
Once done, save the file and apply the changes by running the following command:
sudo netplan apply
Now you can run “ip addr” and “ip route” command to view IP address and route details to see results for yourself.