I. Setting up a Linux network
1) Set IP address at zero
Since CENTOS7 does not have the Ifconfig command by default, we first install net-tool so that we can use the Ifconfig command to view the IP address.
• Mount the System CD
[Email protected] ~]# mount/dev/cdrom/media/cdrom/
• Enter the CD-ROM installation package directory installation Net-tool
[Email protected] ~]# cd/media/cdrom/packages/
[Email protected] packages]# RPM-IVH net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
Now we can use the Ifconfig command to set the 0 O'Clock IP address (does not take effect after reboot)
Let's look at the usage of ifconfig.
[Email protected] packages]# ifconfig-h
Usage:
Ifconfig [-A] [-v] [-s] <interface> [[<af>] <address>]
Here is an example
[Email protected] packages]# ifconfig eno16777736 192.168.1.1 255.255.255.0
Then check the IP address is 192.168.1.1
Note: Address will expire after restarting service
Two. Permanently modify the IP address (modify the network configuration file)
Nic configuration file in/etc/sysconfig/networ-script/ifcfg-NIC name
We use the VI editor to modify the contents of the content can be permanently modified
Finally restart the Network service
[root@localhost network-scripts]# systemctl Restart Network.service
If there is no error, the modification succeeds.
Linux Initialization configuration-----Network configuration