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.