How to add/ip address in centos7 minimal after 1st installation
There are many system administrator who faces problem adding ip address in centos7 minimal after 1st installation because in the centos7 some command has been changed & setup command disappear in this version. Here i will discuss about how to setup ip address in centos 7 from command line.
First, type “#nmcli d” command in your terminal for quick list ethernet card installed on your machine:
Type “#nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).
If you are familiar with using the vi editor you can also modify the ifcf-eth0 file using vi. To use this option, type the following command in the prompt:
You can also use nano as a text editor. If you are newer to Linux this editor has less of a learning curve than vi. Nano will need to be installed using the command:
yum install nano Once installed, to use nano to edit the file type: nano /etc/sysconfig/network-scripts/ifcfg-enp0s3
Here is an example of the file using 192.168.1.2 as the static IP address.
UUID=”WHAT EVER IS YOUR COMPUTER’s UUID”
HWADDR=”WHATEVER IS YOUR COMPUTER’S MAC ADDRESS”
Restarting the networking service
You may have to restart the network adapter or the machine. To restart the network adapter use the following command: service network restart.
If you wish to install the common networking tools you can now install the net-tools package using the following command: yum install net-tools
This will allow you to view your network adapters using the terminal command: ifconfig