Pages

Friday, December 18, 2015

Working with Network on CentOS/RHEL 07 - Part 09

Home

Configure Static IP address using Command Line UI (nmtui)

- In this section of document we will have a look on how we can configure an IP address (IPV4) on an Ethernet interface in RHEL/CENTOS 7
- First execute below command to get into command line UI provided by OS

[root@myserver2 ~]# nmtui

- Post execution of command “nmtui” on putty itself you will be given an user interface which will help you step wise for the configuration of network interface details.


- Select the desired physical connection profile to which IP address details are to be modified.





- Assign required details to the interface such as MAC address, MTU to be supported, IP address , Gateway IP Address, DNS Server’s IP address, Domain name of which interface should belong, Parameter to get Interface Automatically UP




- Once all changes are saved IP address details can be seen in the below command and file outputs,
[root@myserver2 ~]# ip addr show enp0s9
4: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:b6:50:f3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.248.202/24 brd 192.168.248.255 scope global dynamic enp0s9 valid_lft 813sec preferred_lft 813sec
    inet6 fe80::a00:27ff:feb6:50f3/64 scope link valid_lft forever preferred_lft forever

[root@myserver2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-wired-connection-enp0s9
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=yes
NAME=wired-connection-enp0s9
UUID=fc5cd587-6e1d-4266-a1da-aad57036a1f6
ONBOOT=yes
DNS1=192.168.248.1
HWADDR=08:00:27:B6:50:F3
MACADDR=08:00:27:B6:50:F3
MTU=1500
IPADDR=192.168.248.202
PREFIX=32
GATEWAY=192.168.248.1
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
Note:- IPV6 related can be removed from the file if needed manually, presence of it will not be of that much problem of confusion

Back To Top
Home

No comments:

Post a Comment