How to configure an IP Address on CentOS 7

How to configure an IP Address on CentOS 7




First Method


On CentOS 7 or RHEL 7 one need to use the NetworkManager daemon. It attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices. In this quick tutorial you will learn about configuring a network interface using ifcfg files located in /etc/sysconfig/network-scripts/ directory in a CentOS 7 and RHEL 7:
  1. Create a file named /etc/sysconfig/network-scripts/ifcfg-eth0 as follows:
  2. DEVICE=eth0
  3. BOOTPROTO=none
  4. ONBOOT=yes
  5. PREFIX=24
  6. IPADDR=192.168.2.203
  7. Restart network service: systemctl restart network




Second Method



You can also use nmtui, a text-based user interface for configuring network interfaces


Select Edit a connection and press Enter.

Choose the network interface and then Edit.

Configure Static IP Address in CentOS 7 - Choose the network interface


Set the IP Address and enter OK.

Configure Static IP Address in CentOS 7 - Configure Static IP Address


Finally, restart the network service using the following command to have these changes take effect.








Antero Technology Group

Author & Editor

Hope it was Helpful must drop your comments for any query.

0 comments:

Post a Comment

Please do not enter any spam link in the comment box.