Because the system needs to access the server separately from the Intranet, that is, the Internet users access the server from the Internet, and the Intranet users access the server from the Intranet, the result is that the Intranet cannot be accessed after the dual gateway is configured, use the route command to view the cause of the route problem and reset the route to solve the problem.
To avoid routing problems after the server is restarted, add/etc/rc. Local in the configuration file.
route add-net 172.0.0.0 netmask route 0.0.0 GW 172.31.255.254 Dev eth1 # Intranet route
route add-net 222.211.64.120 netmask route 255.255.255 GW then Dev eth0 # Is route
route GW Internet egress IP address eth0 # default route
route del-net default netmask 0.0.0.0 GW 172.31.255.254 Dev eth1 # Delete the route added by the System
In this way, after the system is restarted, the correct static route can be automatically set to ensure normal access to the Intranet and Internet.
Principle Description: Generally, only one route can be created by default. Even if two route entries are added, only the one with a small metric route is unavailable (such as port down) the other one takes effect. Therefore, the port that does not know the remote address (such as accessing the internet) must refer to the default route, for a port that clearly knows the distribution of the remote address (usually the Intranet address segment), it refers to a static route.
In Linux, the route print Command similar to Windows is:
1. Route-e
2. IP Route list
3. netstat-Rn
Netstat-in: View Interface Card Information
Netstat-Rn view route information