Rookie growth Notes-centos network configuration can not access the external network (ii)

Source: Internet
Author: User
Tags nameserver

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)

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.