Route for linux Network commands

Source: Internet
Author: User

The route command displays or modifies the route table of the local IP address. Syntax: [plain] route [-CFvnee] route [-v] [-A family] add [-net |-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [windowW] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] www.2cto.com route [-v] [-A family] del [-net |-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If] route [-V] [-- version] [-h] [-- help] describes how to maintain the IP route table, after the device is configured using the ifconfig command, it is mainly used to establish a static route to the specified host or network. When the add or del option is specified, the route command modifies the route table. Without these options, the route command displays the content in the route table. Parameter:-n: the IP address or port number is used directly without the communication protocol or host name.-e: The route table is displayed in netstat format, -ee generates a very long row with all route table parameters (more detailed information is displayed ). Del: delete a route; add: add a route; add and delete route parameters:-net: indicates that the next route is a network; www.2cto.com-host: indicates the routes connected to a single host. netmask NM uses the network mask when a network route is added. Gw: Short for gateway, followed by the IP value, different from dev; dev: The route package through the gateway. Note: The specified gateway must be reachable first, this usually means that you must first create a static route for the gateway. If you only want to specify the network card to connect, use this setting, followed by eth0.

The preceding example shows the difference between route and route-n. Destination: Specify the Destination network address of the route. The destination address can be an IP address (the host address bit of the network address is set to 0), the IP address is the IP address for the host route, and the default route is 0.0.0.0 (default ). Genmask: indicates the network mask (netmask) of the route ).
Gateway: the host name or IP address used by the Gateway. The "*" output above indicates no gateway. Flag: indicates the ingress Flag. The available tags are as follows: www.2cto.com
U (route is up): the route is started; H (target is ahost): the target is the host (IP); G (use gateway): packets need to be transmitted through the gateway; R (reinstate route for dynamic routing): reset the dynamic route. D (dynamically installed by daemon orredirect): dynamically install the route. M (modified from routing daemon orredirect ): modify the route ;! (Reject route): reject a route. Metric: Route unit sales Ref: Number of other routes dependent on the current status of the route Use: Number of route table entries used Iface: the destination network of the packet sent by the route


 
Author: richerg85

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.