Centos network settings Modification

Source: Internet
Author: User
Tags nameserver

Environment:

System hardware: VMWare vsphere (CPU: 2*4 cores, 2 GB memory)

System Version: Centos-6.5-x86_64

Router Gateway: 192.168.1.1

 

Steps:

1. view the network MAC address
[[Email protected] ~] # Cat/etc/udev/rules. d/70-persistent-net.rules

The following information is displayed:
# PCI device 0x15ad: 0x07b0 (vmxnet3)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 50: 56: 94: 04: 3C ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth0"

# PCI device 0x15ad: 0x07b0 (vmxnet3)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 50: 56: 94: 53: 24 ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth1"

Eth0: corresponds to the first Nic, and eth1: The second Nic. Currently, eth0 is used to connect to the vro, and eth1 is retained (the server is generally used to connect to other hosts)


2. Modify host name
[[Email protected] ~] # Vim/etc/sysconfig/Network
  

Open the file, modify the following content, and save

Networking = yes # use the network
Hostname = centos # Set Host Name

3. Modify the NIC
[[Email protected] ~] # Vim/etc/sysconfig/network-scripts/ifcfg-eth0
  

Open the file, modify the following content, and save

Device = eth0 # corresponds to the first Nic
Type = Ethernet
Onboot = yes # run at startup
Nm_controlled = Yes
Bootproto = static # use a static IP address instead of an IP address allocated by DHCP
Defroute = Yes
20174_failure_fatal = Yes
Ipv6init = No
Name = "system eth0" # Name
Hwaddr = 00: 50: 56: 94: 04: 3C # It must correspond to the MAC address of etho (/etc/udev/rules. d/70-persistent-net.rules)
Peerdns = Yes
Peerroutes = Yes
Ipaddr = 192.168.1.40 # specify the local IP Address
Netmask = 255.255.255.0 # specify the subnet mask
Gateway = 192.168.1.1 # specify the Gateway

4. Modify DNS
[[Email protected] ~] # Vim/etc/resolv. conf

Open the file, modify the following content, and save
Nameserver 8.8.8.8 # Google's DNS Server
Nameserver 202.96.128.86 # specify the nearest DNS server in the current city (different cities, online search)
Nameserver 192.168.1.1 # specify the DNS server specified on the router


5. Restart Network Configuration
[[Email protected] ~] # Service network restart

  

6. Restart

[[Email protected] ~] # Shutdown-R now

 

7. view the current IP settings

[[Email protected] ~] # Ifconfig

 

8. Test whether to connect to the Internet

[[Email protected] ~] # Ping www.163.com

 

Provincial DNS:

Guangdong Guangzhou (China Telecom) preferred DNS: 202.96.128.86 backup DNS: 202.96.128.166

Guangzhou City, Guangdong Province (China tietong) preferred DNS: 61.235.70.98 backup DNS: 211.98.4.1

Shanwei City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.166 backup DNS: 202.96.128.86

Shantou City, Guangdong Province (China Telecom) backup DNS: 202.96.128.166

Guangdong Heyuan City (China Telecom) preferred DNS: 202.96.128.166 backup DNS: 202.96.128.86

Guangdong Heyuan City (China Netcom) preferred DNS: 210.21.196.5 backup DNS: 221.5.88.88

Shenzhen City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.166 backup DNS: 202.96.134.133 (closed)

Yangjiang City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.86 alternative DNS: 202.96.128.166

Guangdong zengcheng City (China Telecom) preferred DNS: 202.96.128.86 backup DNS: 202.96.128.166

Guangzhou City, Guangdong Province (China tietong) preferred DNS: 61.235.70.98 backup DNS: 211.98.4.1

Jiangmen City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.86 backup DNS: 202.96.128.166

Foshan City, Guangdong Province (China Netcom) preferred DNS: 221.5.88.88 backup DNS: 210.21.196.6

Foshan City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.86 backup DNS: 202.96.128.166

Foshan City, Guangdong Province (China Unicom) preferred DNS: 221.4.8.1 backup DNS: 221.4.66.66

Meizhou City, Guangdong Province (China Telecom) preferred DNS: 61.235.70.98 backup DNS: 211.98.4.1

Zhanjiang City, Guangdong Province (China Telecom) preferred DNS 202.96.128.68 backup DNS 202.96.128.166

Dongguan City, Guangdong Province (China Telecom) preferred DNS: 202.96.128.86 backup DNS: 202.96.128.166

 

Guangxi:

Guangxi Nanning (China Telecom) preferred DNS 202.103.224.68 backup DNS 202.103.225.68

Nanning City, Guangxi Province (China tietong) preferred DNS: 61.235.164.18 backup DNS: 61.235.164.13

Guangxi Zhuang Autonomous Region (China Telecom) preferred DNS: 202.103.224.68 backup DNS: 202.103.225.68

Guangxi Zhuang Autonomous Region Liuzhou City (China Netcom) preferred DNS: 221.7.136.68 alternative DNS: 221.7.128.68

Fangchenggang city, Guangxi Zhuang Autonomous Region (China tietong) preferred DNS: 61.235.164.13 backup DNS: 61.235.164.18

Guangxi Zhuang Autonomous Region Liuzhou City (China Telecom) preferred DNS: 202.103.224.68 alternative DNS: 202.103.225.68

 

Hunan:

Hengyang City, Hunan Province (China Telecom) preferred DNS: 220.170.64.96 backup DNS: 202.103.96.68

Hengyang City, Hunan Province (China Telecom) preferred DNS 59.51.78.210 backup DNS 222.246.129.80

Yueyang City, Hunan Province (China tietong) preferred DNS: 211.98.2.4 backup DNS: 61.234.254.6

Hunan Changsha (China Telecom) preferred DNS: 202.103.96.112 backup DNS: 202.103.96.68

Hunan Changsha (China tietong) preferred DNS: 61.234.254.5 (BLOCKED) backup DNS: 61.234.254.6 (BLOCKED)

Yongzhou City, Hunan Province (Citic broadband) preferred DNS: 219.72.225.254 backup DNS: 219.72.225.253

Yongzhou City, Hunan Province (China Telecom) preferred DNS: 218.76.248.6 alternative DNS: 218.76.248.100

Xiangtan city, Hunan Province (China Telecom) preferred DNS: 222.246.129.81 backup DNS: 59.51.78.211

Xiangtan city, Hunan Province (China Telecom) preferred DNS: 220.170.0.210 backup DNS: 222.246.129.81

Changde City, Hunan Province (China Telecom) preferred DNS: 59.51.78.210 backup DNS: 222.246.129.80

Yiyang City, Hunan Province (China tietong) preferred DNS: 61.232.206.100 backup DNS: 202.101.172.35

Jishou city, Hunan Province (China Telecom) preferred DNS: 222.246.129.81 backup DNS: 59.51.78.211

Shaoyang City, Hunan Province (China Telecom) preferred DNS: 218.76.192.101 backup DNS: 218.76.192.100

Shaoyang City, Hunan Province (China Dian Telecom) preferred DNS: 59.51.78.210 backup DNS: 59.51.78.210

Yueyang City, Hunan Province (China Telecom) preferred DNS: 222.246.129.81 backup DNS: 59.51.78.211

 

Fujian:

Fujian Xiamen (China Telecom) preferred DNS: 202.101.103.55 backup DNS: 202.101.103.54

Fujian Xiamen (China Netcom) preferred DNS: 218.104.128.106 backup DNS: 58.22.96.66

Quanzhou City, Fujian Province (China Telecom) preferred DNS: 202.101.107.85 backup DNS: 218.85.157.99

Zhangzhou City, Fujian Province (China Telecom) preferred DNS: 218.85.157.99 backup DNS: 202.101.112.55

Fujian Fuzhou (China Telecom) preferred DNS: 218.85.157.99 backup DNS: 202.101.98.55

Quanzhou City, Fujian Province (China Telecom) preferred DNS: 218.85.157.99 backup DNS: 202.101.107.98 backup DNS: 202.101.107.55 backup DNS: 202.101.107.85

Fujian Longyan city (China Telecom) preferred DNS: 202.101.113.55 backup DNS: 218.85.157.99 (province backup)

 

Jiangxi:

Xinyu city, Jiangxi Province (China Telecom) preferred DNS: 202.101.224.69 backup DNS: 202.109.226.68

Jiangxi Nanchang City (China Telecom) preferred DNS: 202.101.224.69 backup DNS: 202.101.226.68 preferred DNS: 61.232.206.102

Jiangxi Nanchang City (China tietong) preferred DNS: 211.98.2.4 backup DNS: 211.98.4.1

Yichun City, Jiangxi Province (China Telecom) preferred DNS: 202.101.224.69 backup DNS: 202.101.226.68

 

Shanxi

Shanxi Yuncheng (China Netcom) preferred DNS: 202.99.192.66 backup DNS: 202.99.192.68

Taiyuan City, Shanxi Province (China Netcom) preferred DNS: 202.99.192.66 backup DNS: 202.99.192.68

Taiyuan City, Shanxi Province (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.130

Taiyuan City, Shanxi Province (China tietong) preferred DNS: 211.98.32.132 backup DNS: 211.98.4.1

Datong City, Shanxi Province China Netcom preferred DNS: 202.99.192.66 backup DNS: 202.99.192.68

 

Jiangsu:

Jingjiang City, Jiangsu Province (China Telecom) preferred DNS: 221.228.255.1 backup DNS: 218.2.135.1

The preferred DNS for Nanjing City, Jiangsu Province (China Telecom) is 218.2.135.1 and the backup DNS is 61.147.37.1.

Zhenjiang City, Jiangsu Province (China Telecom) preferred DNS: 218.2.135.1 backup DNS: 61.147.37.1

Yancheng City, Jiangsu Province (China tietong) preferred DNS: 222.45.1.40 backup DNS: 211.98.4.1

Huai 'an city, Jiangsu Province (China Telecom) preferred DNS: 61.147.37.1 backup DNS: 61.177.7.1

Jiangsu Suzhou (China Telecom) preferred DNS: 61.177.7.1 backup DNS: 221.228.255.1

Yangzhou City, Jiangsu Province (China Telecom) preferred DNS 61.147.37 backup DNS 61.177.7.1

Wuxi City, Jiangsu Province (China tietong) preferred DNS 211.98.2.4 backup DNS 211.98.4.1

Wuxi City, Jiangsu Province (China Telecom) preferred DNS: 221.228.255.1 backup DNS: 218.2.135.1

 

Zhejiang:

Ningbo, Zhejiang Province (China Telecom) preferred DNS: 202.96.104.15 backup DNS: 202.96.104.25

Ningbo, Zhejiang Province (China Telecom) preferred DNS: 202.96.104.16 backup DNS: 202.96.104.26

Ningbo, Zhejiang Province (China Telecom) preferred DNS: 202.96.104.27 backup DNS: 202.96.104.17

Hangzhou City, Zhejiang Province (China Netcom) preferred DNS: 218.108.248.200 backup DNS: 218.108.245.157

The preferred DNS: 61.153.177.199 backup DNS: 61.153.177.198

Hangzhou City, Zhejiang Province (China Telecom) preferred DNS: 202.101.172.35 backup DNS: 202.101.172.47

Yueqing City, Zhejiang Province (China Telecom) preferred DNS: 61.153.177.200 backup DNS: 61.153.177.202

Yuyao City, Zhejiang Province (China Telecom) 202.96.104.17202.96.104.27

 

Shaanxi:

Yulin City, Shaanxi province (China Telecom) preferred DNS: 202.100.4.15 backup DNS: 202.100.0.68

Yan'an city, Shaanxi province (China Telecom) preferred DNS: 61.134.1.4 backup DNS: 218.30.19.40

Xi'an, SHAANXI (China tietong) preferred DNS: 222.41.52.3 backup DNS: 61.232.202.158

Xi'an (China Telecom), Shaanxi province preferred DNS: 218.30.19.40 backup DNS: 61.134.1.4

 

Anhui

Preferred DNS: 202.102.192.68 backup DNS: 202.102.199.68

Fuyang City, Anhui Province (China Telecom) preferred DNS: 202.102.192.68 backup DNS: 202.102.199.68

Hubei ProvinceHubei (China Telecom) preferred DNS: 202.103.44.150 backup DNS: 202.103.24.68

Hubei Wuhan (China Telecom) preferred DNS: 202.103.24.68 backup DNS: 202.103.44.150

Hubei Wuhan (China Telecom) preferred DNS: 202.104.24.68 backup DNS: 202.103.0.117

Huangshi city, Hubei Province (China Telecom) preferred DNS: 202.103.44.150 backup DNS: 202.103.24.68

 

Shandong:

Yantai City, Shandong Province (China Netcom) 202.102.154.3202.102.152.3

Jining city, Shandong Province (China Netcom) preferred DNS: 202.102.154.3 backup DNS: 202.102.152.3

Qingdao, Shandong Province (China Netcom) preferred DNS: 202.102.134.68 backup DNS: 202.102.128.68

Binzhou City, Shandong Province (China Netcom) preferred DNS: 202.102.134.68 backup DNS: 202.102.128.68

Linyi City, Shandong Province (China Netcom) preferred DNS: 202.102.154.3 backup DNS: 202.102.152.3

Linyi City, Shandong Province (China Telecom) preferred DNS: 219.146.0.130 backup DNS: 219.150.32.132

Shandong Province Dezhou (China Netcom) preferred DNS 202.102.152.3 alternative DNS 202.102.154.3

Shandong Tengzhou (China Netcom) preferred DNS: 202.102.128.68 backup DNS: 202.102.134.68

Heze city, Shandong Province (China Netcom) preferred DNS: 202.102.152.3 backup DNS: 202.102.154.3

China Telecom preferred DNS: 219.146.0.130 backup DNS: 219.150.32.132

Shandong Zibo City (China Netcom) preferred DNS: 202.102.154.3 backup DNS: 202.102.152.3

Liaocheng City, Shandong Province (China Netcom) preferred DNS: 202.102.152.3 backup DNS: 202.102.154.3

Dongying City, Shandong Province (China Netcom) preferred DNS: 202.102.152.3 alternative DNS: 202.102.154.3

Dongying City, Shandong Province (China Netcom) preferred DNS: 202.102.154.3 alternative DNS: 202.102.128.68

Weihai City, Shandong Province (China Netcom) preferred DNS: 202.102.154.3 backup DNS: 202.102.152.3

 

Heilongjiang:

Heilongjiang Province sharing (China Netcom) preferred DNS: 202.97.224.69 backup DNS: 202.97.227.138

Heilongjiang Harbin (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.130

 

Hebei:

Hebei Shijiazhuang (China Netcom) preferred DNS: 202.99.160.68 backup DNS: 202.99.166.4

Handan City, Hebei Province (Netcom) preferred DNS: 202.99.160.68 backup DNS: 202.99.166.4

Handan City, Hebei Province (China tietong) preferred DNS: 211.98.2.4 backup DNS: 61.232.206.102

Xingtai City, Hebei Province (China Netcom) preferred DNS: 202.99.160.68 backup DNS: 202.99.166.4

Qinhuangdao, Hebei Province (China Netcom) preferred DNS: 202.99.166.4 backup DNS: 202.99.160.68

Cangzhou City, Hebei Province (China Netcom) preferred DNS: 202.99.160.68 backup DNS: 202.99.176.30 or 202.99.166.4

Zhangjiakou City, Hebei Province (China Netcom) preferred DNS: 202.99.166.4 backup DNS: 202.99.160.68

Zhangjiakou City, Hebei Province (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.130

Xingtai City, Hebei Province (China Netcom) preferred DNS: 202.99.160.68 backup DNS: 202.99.166.4 or 202.99.168.8

 

Guizhou

Guizhou Guiyang (China Telecom) preferred DNS: 202.98.192.67 backup DNS: 202.98.198.167

Yuxi City, Yunnan Province (China Telecom) preferred DNS: 222.172.200.68 backup DNS: 61.166.150.123

Yunnan (China tietong) preferred DNS: 211.98.72.7 backup DNS: 211.98.72.8

Yunnan Kunming (China Netcom) preferred DNS: 221.3.131.12 backup DNS: 221.3.131.11

 

Liaoning

Chaoyang city, Liaoning Province (China tietong) preferred DNS: 61.232.206.102 backup DNS: 211.98.4.1

Chaoyang city, Liaoning Province (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.130

Chaoyang city, Liaoning Province (China Netcom) preferred DNS: 202.96.69.38 backup DNS: 202.96.64.68

Dalian city, Liaoning province (China Telecom) preferred DNS: 219.150.32.132. Backup DNS: 219.146.0.130

Dalian city, Liaoning province (China Netcom) preferred DNS: 202.96.69.38 backup DNS: 202.96.64.68

Fushun city, Liaoning Province (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.130

 

Henan

Henan (China Telecom) preferred DNS 222.88.88.88 alternative DNS 222.85.85.85

Preferred DNS: 210.76.0.2 backup DNS: 219.150.150.150

Zhengzhou City, Henan Province (China Telecom) preferred DNS: 219.150.150.150 backup DNS: 219.150. 32.132

Zhengzhou City, Henan Province (China Netcom) preferred DNS: 202.102.224.68 backup DNS: 202.102.227.68

Luohe City, Henan Province (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 222.88.88.88

Anyang City, Henan Province (China tietong) preferred DNS: 211.98.192.3 backup DNS: 61.233.65.3

Luoyang City, Henan Province (China Telecom) preferred DNS: 222.88.88.88 backup DNS: 222.85.85.85

Henan Netcom DNS (province) preferred DNS: 202.102.224.68 backup DNS: 202.102.227.68

Zhumadian City, Henan Province (China Netcom) preferred DNS: 202.102.224.68 backup DNS: 202.102.227.68

 

Sichuan

Sichuan Chongqing (China Telecom) preferred DNS: 61.128.128.68 backup DNS: 61.128.192.68

Luzhou city, Sichuan Province (China Telecom) preferred DNS: 61.139.2.69 backup DNS: 202.98.96.68

Luzhou city, Sichuan Province (China tietong) preferred DNS: 61.236.159.99 backup DNS: 61.139.2.69

Sichuan Chengdu (China Telecom) preferred DNS: 202.98.96.68 backup DNS: 61.139.2.69

Suining City, Sichuan Province (China Telecom) preferred DNS: 202.98.96.68 backup DNS: 61.139.2.69

 

Inner Mongolia

Inner Mongolia Hohhot (China Telecom) preferred DNS: 219.148.162.31 backup DNS: 219.150.32.132

Inner Mongolia Hohhot (China Netcom) preferred DNS: 202.224.99.68 backup DNS: 202.224.99.67

Tianjin (China Telecom) preferred DNS: 219.150.32.132 backup DNS: 219.146.0.132

Tianjin (China Netcom) preferred DNS: 202.99.104.68 backup DNS: 202.99.96.68

 

Xinjiang

Preferred DNS: 61.128.114.166 alternative DNS: 61.128.114.20.

Aksu City, Xinjiang (China Telecom) preferred DNS: 61.128.114.166 alternative DNS: 61.128.114.20.

Preferred DNS: 61.128.114.166 backup DNS: 61.128.114.20.

 

Jilin Province province sharing (China Netcom) preferred DNS: 202.98.5.68 backup DNS: 202.98.0.68

Haikou City, Hainan Province (China tietong) preferred DNS: 202.103.96.112 alternative DNS: 61.144.40.92

Haikou City, Hainan Province (China Telecom) preferred DNS: 202.100.197.50 backup DNS: 202.100.199.8

 

Tibet

Tibet Lhasa (China Netcom) preferred DNS: 221.13.65.34 backup DNS: 202.102.152.3

 

Gansu

China Telecom, Lanzhou city, Gansu province: preferred DNS: 202.100.64.68 backup DNS: 202.100.64.66

China tietong, Lanzhou city, Gansu province: preferred DNS: 211.98.121.27 backup DNS: 211.98.2.4

Wuwei city, Gansu province (China Telecom) preferred DNS: 202.100.64.68 backup DNS: 60.178.0.93

Centos network settings Modification

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.