Recently, often in check the communication between the server is normal, so often use the route command for administrative modification here is a simple record of the Linux kernel in the Network routing table, the route command set routing is mainly static routes. To achieve communication between the two different subnets, you need a router that connects two networks, or a gateway to two networks at the same time, it is important to note that the route command is executed directly at the command line to add the route, it will not be persisted, and the route will be invalidated when the NIC restarts or the machine restarts. If you need a long-term valid route, you can take advantage of the NAT table under Iptables or add the route to the/etc/rc.local boot file.
The following route options and parameter information are available through the man Help
Options:-A: Set the address type;-C: Print the route cache of the Linux kernel;-N: Verbose mode;-Ñ: Do not perform DNS reverse lookup, directly display the IP address in digital form;-net: Route table to a network-e:netstat ;-host: The routing table to a host. Parameters: Add: Add the specified route record; Del: Delete the specified route record; target: Destination network or destination host; GW: set default gateway; MSS: Set maximum block Length (MSS) for TCP, per MB ; window: Specifies the TCP window size of the TCP connection through the routing table; Dev: The network interface represented by the route record.
View the routing table for this machine like this
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/86/55/wKioL1e8FsvAl5oBAAAeyyyDCjQ694.png-wh_500x0-wm_3 -wmp_4-s_2345452686.png "title=" Route.png "alt=" Wkiol1e8fsval5obaaaeyyydcjq694.png-wh_50 "/>
The flags in the flag indicate the following:
A dormant gateway Detection for active is enabled on the route. This field is only available for AIX 5.1 or later. U:up. H: Routed to host instead of network. G: route to Gateway. D: Routing is dynamically created by redirection. M: The route is modified by redirection. L: The link-level address is displayed in the route item. C: Create a clone route for access to the route. This field is only available for AIX 4.2.1 or later. W: This route is a clone route. This field is only available for AIX 4.2.1 or later. 1: Protocol-specific Route flag 2: Protocol-specific Route flag 3: protocol-specific Road flag B: The route represents a broadcast address. E: There is a bound cache entry. L: The route represents a local address. M: this route represents a multicast address. P: Locked route. R: The host or network cannot reach. S: Added manually. U: Route is available. S: the stop search option for group routing is enabled on the route.
This article from the "Technical essay" blog, reproduced please contact the author!
Use of the route command under Linux