Static IP & Network adapter

This session we will cover two important things Linux Server  

  • How to Assign or change Static IP
  • How to ADD new Adaptor

In this session Centos Linux / Red HAT Linux

Here I will explain the steps to edit or assign new IP address to RedHat/Centos Server

Login to server

Go to the directory

[root@cent8 ~]# cd /etc/sysconfig/network-scripts/

Currently having this IP

Here I am using vi editor

Have changed the IP address and make it to 192.168.1.20

So, save it and exit from editor

Restart Network Manager

[root@cent8 network-scripts]# systemctl restart NetworkManager

Or

Down the network and again up the network

[root@cent8 network-scripts]# ifdown ens33

Once network again up

You will see reflected changes  

This is the first Method to Change the IP Address.

Second method which I will use nmtui – (Network Manager Text User Interface)

[root@cent8 ~]# nmtui

If we wanted to change current IP click to edit

Current IP

Here I will assign new IP

Click Ok and exit

So need to restart network

[root@cent8 ~]# systemctl restart network

[root@cent8 ~]# ip addr

Here we will discuss how to add new IP to Centos/ RedHat Linux Server

How to add additional IP address

Go to Virtual Machine

Setting

Click to add new adaptor

Click finish and ok

Once network adaptor added new DHCP IP getting so now wanted to assign STATC IP

From nmtui or using vi edit can do that.

Once select manual assign ip insert ip and dns/gateway

Click ok and restart network manager

Down and up network

[root@cent8 ~]# ifdown ens36

[root@cent8 ~]# ifup ens36

These are the simple steps to add add edit change Network adaptor and IP Address in Linux Server

Leave a Reply

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