X
    Categories: Ubuntu

How To Configure Static IP Address On Ubuntu 22.04

Sharing is caring!

In this tutorial how to configure static ip address on ubuntu 22.04 server. Ubuntu 22.04 is latest release April 2022.

My server info:
######################################
IP address  : 10.66.10.7
Operating System: Ubuntu 22.04
RAM   : 2 GB
Disk   : 25 GB
vCPU   : 2
CPU op-mode(s)  : 64-bit
Service  : Static IP
Hostname (FQDN) :  ubuntu.technologyrss.local
######################################

Step #01: Server update and upgrade.

root@ubuntu:~# apt update && apt upgrade -y
Then ssh enable for remote connect.
root@ubuntu:~# nano /etc/ssh/sshd_config
root@ubuntu:~# service sshd restart
root@ubuntu:~# reboot

Step #02: Open netplan config file.

root@ubuntu:~# vi /etc/netplan/00-installer-config.yaml

Insert below all lines into 00-installer-config.yaml and must be replace as your interface name, ip address and gateway etc.

network:
    ethernets:
        enp0s3:
            addresses:
            - 10.66.10.7/16
            dhcp4: false
            routes:
              - to: default
                via: 10.66.10.1
            nameservers:
                addresses:
                - 8.8.8.8
                - 8.8.4.4
                search:
                - workgroup
    version: 2

Then run below command for update netplan

root@ubuntu:~# netplan apply

or you can use debug command if any error.

root@ubuntu:~# netplan --debug apply

If any error show please see YouTube channel for more videos. Don’t forget subscribe my channel or share to your friends.

0 0 votes
Article Rating
Admin: I am system administrator as Windows and Linux platform. I have 4 years skilled from the professional period. I have to configure Linux based system such as an Asterisk VOIP system, Network monitoring tools (ZABBIX), Virtualization (XEN Server), Cloud computing (Apache CloudStack) etc. Now share my professional skill each interested person. Thanks to all.
Leave a Comment