As a result of development, the need to connect the development machine frequently, but if not set static IP address, each reboot or disconnect the network connection, IP address will change, need to set a fixed IP address, down is how to set the fixed IP method
Default configuration
Input command: VIM/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENP2S0 (here/ifcfg-enp2s0 each person's name suffix is not the same, the prefix is/IFCFG-ENP)
If Vim is not installed, enter the command: Yum install vim encounters the option input y return to install successfully
Here's how to set up a fixed IP
First step:
Under Root, enter the command: ifconfig
If the prompt cannot find the ifconfig command, enter Yum upgrade and yum install Net-tools
After entering Ifconfig, remember the 2 IP addresses labeled below
Enter the command at this time: vim/etc/sysconfig/network-scripts/ifcfg-enp2s0
Insert Tag content: Insert command: In reading mode, click "I" into edit mode, it's OK
Bootproto represents the way to get IP ("DHCP" = dynamic Get/"static" = Set static IP)
IPADDR represents a static IP address (the address is a inet 192.168.0.138 acquired before Ifconfig)
The netmask represents the subnet mask (the address is netmask 255.255.255.0 acquired before Ifconfig)
Gateway represents gateways (because your IP is 192.168.0 network segment, so use 192.168.0.1, note: You are the IP address of the top three is what network segment in the back add a 1 on the line)
DNS1 is DNS (need You know your network DNS, generally in the router management background has configuration, you can not set DNS)
The last is to save the reboot for the configuration to take effect
Enter command: ": Wq" means to save and exit
Input command: Reboot, reboot
Source: http://blog.csdn.net/w18600281813/article/details/50977688