Instance environment virtual machine: VMware11.1.0 system: CentOS6.6 # ifconfig-a & lt; view the status of all NICs 2. # vi/etc/sysconfi
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 < <网关< p>
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.