How to Configure Static IP Addresses On Ubuntu Server easy way.

How to Configure Static IP Addresses On Ubuntu Server easy way.

Configure Static IP Addresses On Ubuntu Server easy way.

1.Loginto terminal and enter root user like :
sudo -i
2. Goto network config file:
cd /etc/netplan/
3. Tipe ls and you see the config file 50-cloud-init.yaml
4. Edite this confige file :
sudo nano /etc/netplan/50-cloud-init.yaml
Yoy see this file code like :
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s1:
addresses: []
dhcp4: true
version: 2
enp0s1 Is networking port.
You can replace this code :
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses: [192.168.1.2/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
dhcp4: no
version: 2
Exit and save your changes by running the commands below
sudo netplan apply
Now configured and saved Static IP Addresses On Ubuntu Server.

একটি মন্তব্য পোস্ট করুন

0 মন্তব্যসমূহ

Close Menu