Linux cannot access the Internet

Source: Internet
Author: User
Tags ip number nameserver
ArticleDirectory

Right-click the Linux desktop, create a terminal, enter "ifconfig eth0 IP netmask mask" on the terminal, and then enter "route add default GW Gateway number ".

For example, if the IP number is 192.168.11.39 and the Gateway number is 192.168.11.254, enter "ifconfig eth0 192.168.11.39 netmask 255.255.255.255.0" and press "route add default GW 192.168.11.254 ".

In the two input statements, the previous one is to configure the IP address and mask for the computer, and the last one is to configure the gateway. You must think of something else. By the way, there is still a DNS!

For DNS configuration, go to the main menu (the Red Hat), system settings, and network, and click DNS. Enter: 202.96.134.133 in the primary DNS and enter: 202.96.128.68 In the second DNS. Can you try it online?

How can I save the NIC IP address settings?

Edit STARTUP configuration document: Add the following information to the/etc/sysconfig/network-scripts/ifcfg-eth0 document:
Device = eth0
Xonboot = Yes
Bootproto = static
Ipaddr = 192.168.11.39
Netmask = 255.255.255.0
Gateway = 192.168.11.254

Save DNS configurations?

In the new terminal: VI/etc/resolv. conf (VI is used to modify document information ). Add the following two sentences: "nameserver 202.96.134.133" and "nameserver 202.96.128.68" (press the <Insert> key to add ). After adding the disk, press the <ESC> key and enter ": WQ" to log out.

I hope this post will help you ~

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.