today in the configuration of the new system, because there are two network cards, a eth0 (192.168.118.132): External Services, eth1 (192.168.133.129): internal services.
after the system is installed, the IP is automatically acquired using the Dhclient, and then the eth0 and ETH1 are configured separately.
The configuration is as follows:
Device=eth0
hwaddr=00:0c:29:70:84:8d
type=ethernet
uuid=6eaaa43f-fe2a-4e81-8bc1-898662bfed0d
Onboot=yes
Nm_controlled=yes
bootproto=static
ipaddr=192.168.118.132
netmask=255.255.255.0
gateway=192.168.118.2
dns=8.8.8.8
device=eth1
hwaddr=00:0c:29:70:84:97
type=ethernet
uuid=b56d7b25-e945-4186-8f71-1f92a0f3387a
Onboot=yes
Nm_controlled=yes
bootproto=static
ipaddr=192.168.133.129
after configuration, restart the service. Then, when using Yum to install the package, error:
14:pycurl ERROR 6-"couldn ' t resolve Host ' mirrorlist.centos.org '"
Error: Cannot find a valid baseurl for Repo:base
do ping www.baidu.com times wrong:
Ping:unknown host www.baidu.com
re-check the NIC configuration file, check that the parameters are correct. After some troubleshooting, a DNS configuration file was found:the configuration parameters of the/etc/resolv.conf are incorrect:
[email protected] ~]# cat/etc/resolv.conf
; generated By/sbin/dhclient-script
Search Localdomain
nameserver 192.168.133.1
It turns out that when you use the dhclient to get the command,/etc/resolv.confthe parameter set in the wrong
Solution:
Method 1.vi/etc/resolv.conf, directly modify the file, putchange the nameserver parameter to a DNS service address that can be used
Method 2.echo "nameserver 8.8.8.8" >>/etc/resolv.conf where the 8.8.8.8 (Google DNS server address) can be configured according to the actual situation
Rookie growth Notes-centos network configuration can not access the external network (ii)