Network IP configuration of the newly installed system in CentOS 6.6
Instance Environment
# Ifconfig-a <view the status of all NICs
2. # vi/etc/sysconfig/network-scripts/ifcfg-eth0 <edit Nic configuration file
Start configuration by pressing the I key
Content to be modified:
ID 5 ONBOOT = no changed to ONBOOT = yes
# Start With system?
Id 7 BOOTPROTO = dhcp changed to BOOTPROTO = static
# Whether the IP address is automatically allocated by the DHCP server or manually configured
Content to be added:
IPADDR = 192.168.1.108 <IP
NETMASK = 255.255.255.0 <Subnet Mask
GATEWAY = 192.168.1.1 <GATEWAY
DNS1 = 202.96.128.166
DNS2 = 202.96.134.20.
Add DNS Configurations Based on the local network vendor
3. Exit and save:
① Press Esc
② Input: wq press ENTER
4. restart the network service: # service network restart
DNS can also be configured in other files
# Vi/etc/resolv. conf
Join
Nameserver 202.96.128.166
Nameserver 202.96.134.133
Exit save and restart the network service. The actual/etc/resolv. conf is the DNS configuration information of the NIC configuration file before it is automatically called.