Configuring Network IP Address on RHEL7 / CentOS7

This post will help you in Configuring Network IP Address on RHEL7 / CentOS7.
We all know some network changes are happened in RHEL7 and CentOS7, click the link to read more https://www.learnitguide.net/2015/05/network-changes-in-rhel7.htmlBasically, We configure the network ip addresses on linux using anyone of the below mentioned ways,

1. Editing the configuration file.
2. Using Text based or Graphical based Network Utility.
3. Using the Command Line Interface.

In this article, we will see how to configure network IP Address on RHEL7/Centos7 using nmcli command line interface.

nmcli is the advanced command line interface available in rhel 7/centOS 7.

Note: Install bash-completion package to have auto command complete features for nmcli utility.

Configuring Network IP Address on RHEL7 / CentOS7

Steps involved:

1. Identify the Network devices.
2. Activate/Connect the Network devices.
3. Establish the Network connection with proper type.
4. Assign the IP Address as per the requirement.
5. Restart the network devices.

Step1 : Identify the network devices

Ensure the network card which doesnt have ip address or card which need to be change the ip address as the image shows.

[[email protected] ~]# ip a

or

[[email protected] ~]# nmcli dev status

Configuring Network IP Address on RHEL7 / CentOS7

Above image shows, we identified our card as ens33 but it is disconnected. So we will connect or activate the network devices.

Step 2 :  Activate/Connect the Network devices

Using nmcli, we will connect the network connection as below to configure ip adresses.

[[email protected] ~]# nmcli dev con ens33

enable network rhel7 using nmcli

Step 3 : Establish Network connection with proper type

Choose the network card and select the proper types (Ethernet, bluetooth, wifi, bond, bridge, team and so on.). Use the below command to establish the network connection.

[[email protected] ~]# nmcli con add type ethernet ifname ens33 con-name ens33

Ensure the network connection we established as

[[email protected] ~]# nmcli con show

configure network on rhel7

Step 4 : Assign IP Address as per the requirement

Assign the IP Address to the network card using nmcli and set immediately from dhcp to manual, if not, your static ip will be changed by dhcp after the reboot. If you need dynamic ip, then leave it as it is.

[[email protected] ~]# nmcli con modify ens33 ipv4.addresses 192.168.2.20
[[email protected] ~]# nmcli con modify ens33 ipv4.method manual

assigning the ip address rhel7 centos 7

Step 5 : Restart network devices

To get the changes effect, down and up the network interfaces.

    [[email protected] ~]# nmcli con down ens33
[[email protected] ~]# nmcli con up ens33
[[email protected] ~]# ip a

ifdown and ifup the network interfaces on rhel7 and centos 7

Verfiy the IP Address.  Network configuration on RHEL7 or CentOS 7 is done.

Related Content on Linux might be useful to you to improve your Linux Skills.

Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

configure network on centos, configure network on centos7, configure network on centos 6, Configuring Network IP Address on RHEL7/CentOS7, How to Configure Network IP Address in RHEL7 or CentOS7, redhat network configuration command line, network configuration in linux