The route command displays or modifies the route table of the local IP address. Syntax: [plain] route [-CFvnee] route [-v] [-Afamily] add [-net |-host] target [netmaskNm] [gwGw] [metricN] [mssM] [windowW] [irttI]... 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
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.