CENTOS6 network configuration can not access the extranet

Source: Internet
Author: User


Phenomenon:

Ping Intranet Normal

Ping extranet IP, domain name can not be normal, return error: Connect:network is unreachable

The following is an inadvertent view of the Linux network configuration with the command to add a gateway:


Route add default GW 192.168.128.2 dev eth0
Press the above action to add the default gateway. Again access to the extranet all normal.

This phenomenon, it should be the configuration file does not configure the gateway, but after the confirmation/etc/sysconfig/network is configured with the gateway address, and the gateway address is also correct, after several reboots network, as long as not manually add a gateway, You will not be able to access the extranet.

After careful confirmation of each network configuration file, found in the network card configuration file (Ifcfg-eth0) has a network configuration item, for this configuration item, its role is not very clear, so to the official website to view the description:

Network=<address>
Where <address> is the network address. This directive is deprecated, as the value of calculated automatically with Ifcalc.
The rhythm is to tell us not to set this parameter (deprecate), this value will be automatically computed by Ifcalc. Since no setting, naturally removed.

After removing, restart Network Service, the extranet unexpectedly can visit. Using route to view the routing table, you find that you can automatically add the default message, but it has not been:


Kernel IP routing table
destination     gateway          genmask         Flags Metric ref    use Iface
192.168.128.0   *                255.255.255.0   u     0      0         0 eth0
link-local      *                255.255.0.0     u     1002   0        0 eth0
default          192.168.128.2   0.0.0.0         UG     0      0        0 eth0

It seems that the problem is caused by this network parameter setting. As to exactly why this is the case, it is not clear what effect this setting will have.

TIPs: For simplicity, you can also set Ipaddr,gateway to ifcfg-eth* files without having to set up the gateway separately in network.

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.