Centos network configuration
[Modify IP address]
1. Use the Setup command
Use the setup command to enter the graphical interface, enter the Network Configuration, Edit Device according to the prompts, and set the IP according to the prompts.
2. Directly edit the file to modify
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Here ifcfg-eth0 is the corresponding NIC configuration file
DEVICE=eth0 #Describe the device alias corresponding to the NIC. For example: ifcfg-eth0 is eth0
BOOTPROTO=static #Set the way the NIC obtains the ip address. The possible options are static, DHCP or bootp, which correspond to the statically specified IP address, the IP address obtained through the DHCP protocol, and the IP address obtained through the bootp protocol.
BROADCAST=192.168.0.255 # corresponding subnet broadcast address
HWADDR=00:07:E9:05:E8:B4 #corresponding network card physical address
IPADDR=12.168.1.2 #If you set the NIC address to be statically specified, this field specifies the IP address corresponding to the NIC.
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0 #Network card corresponding network mask
NETWORK=192.168.1.0 #Network address corresponding to the network card
ONBOOT=yes