Setting a Static IP on Ubuntu
Setting a Static IP on Ubuntu
 Setting a Static IP on Ubuntu 
 Identify your network interface name
1
ip addr
Look for the active interface, typically named eth0 or ens33.
Edit the netplan configuration file
1
sudo nano /etc/netplan/01-netcfg.yaml
Example configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
        addresses:
            - 10.10.10.2/24
        routes:
            - to: default
              via: 10.10.10.1
        nameservers:
            search: [mydomain, otherdomain]
            addresses: [10.10.10.1, 1.1.1.1]
Apply the changes
1
sudo netplan apply
Verify the static IP
1
ip addr
 This post is licensed under  CC BY 4.0  by the author.
