Home >Operation and Maintenance >CentOS >How to configure ip address in centos
In order to make the IP address permanent. First enter and edit the vi /etc/sysconfig/network-scripts/ifcfg-enp4s0f0 file.
Explain the following file:
DEVICE=enp4s0f0 The device alias corresponding to the network card, such as ifcfg-enp4s0f0 The first network card
The Chinese translation of BOOTPROTO is the startup source. It represents the way the network card obtains the IP address. DHCP (Dynamic Host Configuration Protocol) represents the IP address dynamically generated by the DHCP server. Static indicates that the IP address is a static IP.
BROADCAST=192.168.0.255 Subnet broadcast address
HWADDR=00:50:56:8E:47:EE Network card physical address
IPADDR=12.168.1.117 Network card IP address
IPV6INIT=no Network card corresponding network mask
NETWORK=192.168.1.0 The network address corresponding to the network card
ONBOOT=yes Whether to set this network interface when the system starts. When set to yes, this device will be activated when the system starts. The default setting is yes.
#Use vi editor, press insert key to insert and enter editing mode.
Move the cursor to the IPADDR setting section and change it to the IP address that needs to be set, such as 1.118 in this example. Press the esc key. Enter colon: wq. Save and exit, and you will be prompted with "/etc/sysconfig/network-scripts/ifcfg-enp4s0f0" 14L, 302C writteAfter setting up, restart the network serviceservice network restartRecommended tutorial :
centos tutorial
The above is the detailed content of How to configure ip address in centos. For more information, please follow other related articles on the PHP Chinese website!