Set static IP on Ubuntu 24.04

First check your current ip and gateway settings with the command “ip a” and “ip r”.

Edit the file /etc/netplan/00-installer-config.yaml, place the following contents in it:

network:
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 172.29.0.2/24
      nameservers:
        addresses: [1.1.1.1,8.8.8.8]
      routes:
        - to: default
          via: 172.29.0.1
  version: 2

The gateway address can be determined by executing ip r

Share

Leave a Reply

Your email address will not be published. Required fields are marked *