How To Configure Static IP Address On Ubuntu 21.04 Server3 min read
In this tutorial how to configure static IP address on your Ubuntu 21.04 server. Static IP address is manually setup IP system. It’s very important because your local network DHCP server always provide new IP to your host machine. So If you don’t use a static IP address on your server so you can see some time your server IP address change.
★ How To Install Rocket.Chat On Ubuntu 18.04 TLS
★ How To Install Bitwarden Password Manager On Ubuntu 18.04 Using Docker
Step #01: Check server version using below command.
root@ubuntu21:~# lsb_release -a && ip r
Output as like below
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 21.04.5 LTS Release: 21.04 Codename: hirsute default via 10.66.100.10 dev enp0s3 proto static 10.66.0.0/16 dev enp0s3 proto kernel scope link src 10.66.100.9
Step #02: Configure static ip address on Ubuntu 21.04 server.
Open netplan config file using any editor.
root@ubuntu21:~# vi /etc/netplan/00-installer-config.yaml
Then insert all below lines into your file. or you can edit your old text and replace interface and ip address as like you want.
network:
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
addresses: [10.66.100.9/16]
gateway4: 10.66.100.10
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
Then save press Esc type :wq then press Enter.
Finally run netplan apply command as like below.
root@ubuntu21:~# netplan apply
If your configure is success so you can’t see any error. But remember if your configuration include any white space so can’t properly run netplan command.
So I recommend your old text delete then copy my code and paste into your file then run netplan command.
If you want to see my YouTube channel for more details video.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!