Saturday, December 12, 2015

how to assign network setting in rhel 7 using nmtui and nmcli ?

How to assign network in RHEL 7?

networking two ways

network manager


rpm -qa | grep -i Networkmanager

systemctl status NetworkManager

There are  three  different ways assign network settings

GUI ----->Graphical
text ... nmtui   --->Text based
cli .... nmcli    ----> Command line

Using lagacy network service

planing to add manually values for eth0

vim /etc/sysconfig/netwok-scripts/ifcfg-eth0


for static

BOOTPROTO=none   or static

sytemctl restart NetworkManager

To assign  system name (hostname)
Using command line

hostnamectl set-hostname


vim /etc/hostname

before rhel7 set hostname

vim /etc/sysconfig/network

updating name server info

vim /etc/resolv.conf

or local dns

local name mapping
if u have to systems .... call with nicknames ...alias name user /etc/hosts
give ip call that system with name  ( nss switch will manage this proccess)
ex:-  172.25.x.11 system1
     172.25.x.10 system2

vim /etc/hosts

172.25.x.11 system1
172.25.x.10 system2

using nmtui

nmtui stands for Network Manager Text User Interface.
nmtui is actually a very easy text based tool to configure IP address and host names. Just type “nmtui” on command prompt and follow the simple steps

Now choose your connection type after selecting “Edit a connection”. I am choosing ethernet as I don’t have any other connection to my virtual machine.

As I showing here in rhel7 configuring IP addresses. So I had selected “edit” to manually set the ip address

Now after selecting “manual” you can configure ip addresses as per your specifications.

After you press “OK” to come out of this window. Don’t forget to activate the network connection again.

Once you are done with the nmtui tool in rhel7 configuring IP addresses.  You can check using ‘ifconfig or ip a or hostname –i.

Using  nmcli (Network Manager Command Line Interface )

show the connections using

nmcli connection show
nmcli connection show eno1

Configure an IP address
nmcli connection modify eno1 ipv4.addresses

Configure an IP address with default gateway
nmcli connection modify eno1 ipv4.addresses \  ipv4.gateway ipv4.never-default no

Configure an additional IP address
nmcli connection modify eno1 +ipv4.addresses

Add a static route
These will be saved in the route-<interface> file in /etc/sysconfig/network-scripts/ :

nmcli connection modify eno1 +ipv4.routes ''

No comments:

Post a Comment