CentOS6.5 configure network parameters in text mode (static IP)
I. Description
When CentOS6.5 is started, the network is not automatically connected by default. The IP address is automatically allocated through DHCP. If you want to temporarily change the IP address, run the following command: ifconfig eth0 192.168.202.129, ifconfig indicates the interface parameter configuration, eth0 indicates the first Ethernet Card, and finally the static IP address you want to configure, but this configuration is temporary, if you restart the server, the configured IP address becomes invalid. Therefore, you can change the configuration file to set a valid static IP address for a long time.
Ii. Configure IP addresses in text mode
The path to the configuration file is:/etc/sysconfig/network-scripts/ifcfg-eth0 file, the default configuration of this file is as follows:
[Tong @ tong network-scripts] $ cat ifcfg-eth0DEVICE = eth0HWADDR = 00: 0C: 29: 85: FC: 09 TYPE = EthernetUUID = Signature = noNM_CONTROLLED = yesBOOTPROTO = dhcp
In this case, set ONBOOT to yes, that is, automatically connect to the network after the instance is started, and change the dynamic DHCP mode to static IP allocation. The configuration file is as follows;
[Tong @ tong network-scripts] $ cat ifcfg-eth0DEVICE = eth0HWADDR = 00: 0C: 29: 85: FC: 09 TYPE = EthernetUUID = 6b218dfa-ff8e-4455-be44-ffdfd95ccefbONBOOT = yesNM_CONTROLLED = yesIPADDR = 192.168.202.129BOOTPROTO = noneNETMASK = 255.255.255.0GATEWAY = 192.168.202.1