First, describe
CentOS6.5 start by default does not automatically connect to the network, the method of obtaining IP address is automatically assigned by DHCP, if we want to temporarily change the IP address can be used simple command: ifconfig eth0 192.168.202.129, where ifconfig represents the interface parameter configuration, eth0 represents the first Ethernet card, and finally the static IP address you want to configure, but this configuration is temporary, if you restart the server then the configured IP address will be invalidated. So we set a long-term, valid static IP address by changing the configuration file.
Second, the text mode configuration IP address
The path to the configuration file is::/etc/sysconfig/network-scripts/ifcfg-eth0 file, the default configuration for this file is as follows:
[email protected] network-scripts]$ cat Ifcfg-eth0
Device=eth0
hwaddr=00:0c:29:85:fc:09
Type=ethernet
Uuid=6b218dfa-ff8e-4455-be44-ffdfd95ccefb
Onboot=no
Nm_controlled=yes
Bootproto=dhcp
At this point we will set the onboot to Yes, that is, automatically connect to the network after power on, and DHCP dynamic mode to static allocation of IP mode, the configuration file is as follows;
[email protected] network-scripts]$ cat Ifcfg-eth0
Device=eth0
hwaddr=00:0c:29:85:fc:09
Type=ethernet
Uuid=6b218dfa-ff8e-4455-be44-ffdfd95ccefb
Onboot=yes
Nm_controlled=yes
ipaddr=192.168.202.129
Bootproto=none
netmask=255.255.255.0
gateway=192.168.202.1
CentOS6.5 text mode to configure network parameters (static IP)