0 like 0 dislike
28 views
by (2.0k points)
how to config statics ip on ubuntu 22.04 version

1 Answer

0 like 0 dislike
by (7.6k points)

To configure a static IP address you need to creat a YAML file by cml:

touch /etc/netplan/01-network-configuration.yaml

Then, open it paste this content:

network:
    version: 2
    renderer: NetworkManager
    ethernets:
        eth0:
            addresses:
                - 192.168.1.21/24
            nameservers:
                addresses: [8.8.8.8, 8.8.4.4]
            routes:
                - to: default
                  via: 192.168.1.1

Now to applt the changes by command:

netplan apply

To check IP you can use:

ip a

...