Troubleshoot problems with virtual machines not being able to surf the web after installing Linux systems

Source: Internet
Author: User
Tags domain name server

First, the virtual machine is set to the bridge mode needs to be configured under the CentOS IP and DNS two, centos  modify the gateway   modify the corresponding network card gateway configuration file [[email protected]]# vi / Etc/sysconfig/network Modify the following networking=yes      (indicates whether the system uses a network, which is generally set to Yes.) If set to no, the network can not be used, and many system services will not start hostname=centos      (set the hostname of this machine, the hostname set here and/etc/ Host name set in hosts) gateway=    (sets the IP address of the gateway for the native connection. For example, the gateway is 10.0.0.2) Third, centos  modify the DNS configuration file that modifies the corresponding network card # vi /etc/resolv.conf modify the following content nameserver  202.96.128.86nameserver 202.96.125.166nameserver  #google域名服务器nameserver  8.8.4.4#google Domain name server four, Restart network configuration # service network restart or # /etc/init.d/network restart v. Test ping to see if the gateway communicates, If it doesn't work, add the routing table: 1: Use the  route  command to add a route added using the route  command, the machine restarts or the network card restarts after the route expires, Method://Add to the host route # route add  –host 192.168.168.110 dev eth0# route add –host 192.168.168.119  gw 192.168.168.1//routes added to the network # route add –net ip netmask mask eth0#&nBsp;route add –net ip netmask mask gw ip# route add –net  ip/24 eth1//Add default gateway # route add default gw ip//remove route # route del  –HOST 192.168.168.110 DEV ETH02: How to set up a permanent route under Linux: 1. Add a method to the/etc/rc.local: route  add -net 192.168.3.0/24 dev eth0route add -net 192.168.2.0/24 gw  192.168.3.2542. Add to End method:gateway=gw-ip  or  gateway=gw-dev3./etc/sysconfig/in/etc/sysconfig/network STATIC-ROUTER : ANY NET X.X.X.X/24 GW Y.Y.Y.Y determine the above error, or can not surf the internet, on the ping  website  , switch the virtual machine NIC configuration.   such as the original bridge mode, replaced by net mode, and then cut back, two times a trip to the Internet.

This article is from the "11671429" blog, please be sure to keep this source http://11681429.blog.51cto.com/11671429/1876587

Troubleshoot problems with virtual machines not being able to surf the web after installing Linux systems

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.