Hey, guys.
This video is an update to the latest version of the Ubuntu server released in 2023.
In the above video we saw how to set up a static IP address in the Ubuntu server.
But the same method doesn't work in 2023.
We need to follow other steps to set up a static IP address.
The first step that you need to perform is you need to find the default gateway address.
So to find the default gateway address, you just need to type the command as IP route list.
This will give you the default gateway and network interface name.
Note it down.
After that you need to go to the directory netplan with the following root slash.
Slash netplan.
In this directory you will find a file zero zero installer Config.yaml.
In this file you need to configure the static IP address.
So first, open the file with VI editor with the command VI zero zero installer config.yaml.
Now you need to add the following information in the file one by one.
First type network Colon.
Then type version colon two.
Then renderer colon networked.
After that type Ethernets and network interface name.
Then set dhcp four and dhcp six to false.
Then set the IP address and format as shown below.
Then set the name servers.
You can set the same IP as the name server here.
And finally set the route with routes colon and hyphen to colon default via colon and IP address.
After adding the information press escape key, then press Ctrl shift colon and type WQ and logical
not for writing the information to the file.
This will update the file with new information.
After writing the information to the file, Now it's time to apply the changes to the network.
So just type the following command Netplan apply.
This will apply the new network settings to your server.
You can view the new static IP address with ifconfig command.
And can also test the network with the ping command.
So this is how you can set up a static IP address in the latest version released in 2023.