Configure a static IP address, subnet mask, gateway, and DNS server in Ubuntu.
Problem Statement:-
Configure a static IP address, subnet mask, gateway, and DNS server for a network interface using the command line. Verify that the network configuration persists after rebooting the system.
Solution:
First of all, I must remove all your confusion:
Earlier in Ubuntu, when we want to change the IP address we use /etc/network/interfaces
This file is used by “ifupdown” tools from Debian. Now Ubuntu has switched from “ifupdown” to “Netplan”.
So now your network settings are handled from /etc/netplan/? in this folder you will get a ‘.yaml’ file.
Now talk about the solution:
Now if you made any mistake or want to get back the old stat of network configuration as it was.
Then do this:
Now hope you understand the whole process and if you have any suggestions DM me.
Thank you for reading.