setting_static_ip_address_ubuntu_24_04
This is an old revision of the document!
Setting a Static IP Address in Ubuntu 24.04
See: https://linuxconfig.org/setting-a-static-ip-address-in-ubuntu-24-04-via-the-command-line
First Backup Your network configuration file containing DHCP.
user@svr: cd /etc/netplan user@svr:/etc/netplan$ sudo cp 50-cloud-init.yaml 50-cloud-init.yaml-bak user@svr:/etc/netplan$ ls 50-cloud-init.yaml 50-cloud-init.yaml-bak
Example Configuration of a Static IP. Use Vim or Nano to edit 50-cloud-init.yaml
sudo vim 50-cloud-init.yaml
network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no addresses: - 192.168.1.10/24 routes: - to: default via: 192.168.1.1 nameservers: addresses: [8.8.8.8, 8.8.4.4]
Apply the network changes:
user@svr: /etc/netplan$ sudo netplan apply
Check the status of the network changes:
if config -a
A Great Vim Cheat Sheet
setting_static_ip_address_ubuntu_24_04.1735493317.txt.gz · Last modified: 2024/12/29 17:28 by wikiadmin