{
    "mode": "man",
    "parameter": "ROUTE",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/ROUTE/8/json",
    "generated": "2026-06-13T21:38:33Z",
    "synopsis": "route [-CFvnNee] [-A family |-4|-6]\nroute  [-v]  [-A  family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss\nM] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]\nroute  [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric M] [[dev]\nIf]\nroute  [-V] [--version] [-h] [--help]",
    "sections": {
        "NAME": {
            "content": "route - show / manipulate the IP routing table\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "route [-CFvnNee] [-A family |-4|-6]\n\nroute  [-v]  [-A  family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss\nM] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]\n\nroute  [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric M] [[dev]\nIf]\n\nroute  [-V] [--version] [-h] [--help]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Route manipulates the kernel's IP routing tables.  Its primary use is to set up static routes\nto specific hosts or networks via an interface after it has been configured with  the  ifcon‐‐\nfig(8) program.\n\nWhen  the  add or del options are used, route modifies the routing tables.  Without these op‐\ntions, route displays the current contents of the routing tables.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-A",
                    "content": "use the specified address family (eg `inet'). Use route --help for a  full  list.  You\ncan use -6 as an alias for --inet6 and -4 as an alias for -A inet\n\n",
                    "flag": "-A"
                },
                {
                    "name": "-F",
                    "content": "default.\n",
                    "flag": "-F"
                },
                {
                    "name": "-C",
                    "content": "",
                    "flag": "-C"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-n",
                    "content": "useful if you are trying to determine why the route to your nameserver has vanished.\n",
                    "flag": "-n"
                },
                {
                    "name": "-e -ee",
                    "content": "line with all parameters from the routing table.\n\ndel    delete a route.\n\nadd    add a new route.\n\ntarget the destination network or host. You can provide an addresses or symbolic  network  or\nhost name. Optionally you can use /prefixlen notation instead of using the netmask op‐\ntion.\n",
                    "flag": "-e"
                },
                {
                    "name": "-net",
                    "content": ""
                },
                {
                    "name": "-host",
                    "content": "netmask NM\nwhen adding a network route, the netmask to be used.\n\ngw GW  route packets via a gateway.\nNOTE: The specified gateway must be reachable first. This usually means that you  have\nto  set up a static route to the gateway beforehand. If you specify the address of one\nof your local interfaces, it will be used to decide about the interface to  which  the\npackets should be routed to. This is a BSDism compatibility hack.\n\nmetric M\nset  the metric field in the routing table (used by routing daemons) to M. If this op‐\ntion is not specified the metric for inet6 (IPv6) address family defaults to '1',  for\ninet  (IPv4) it defaults to '0'. You should always specify an explicit metric value to\nnot rely on those defaults - they also differ from iproute2.\n\nmss M  sets MTU (Maximum Transmission Unit) of the route to M bytes.  Note that  the  current\nimplementation  of the route command does not allow the option to set the Maximum Seg‐\nment Size (MSS).\n\nwindow W\nset the TCP window size for connections over this route to W bytes. This is  typically\nonly used on AX.25 networks and with drivers unable to handle back to back frames.\n\nirtt I set  the  initial round trip time (irtt) for TCP connections over this route to I mil‐\nliseconds (1-12000). This is typically only used on AX.25 networks. If omitted the RFC\n1122 default of 300ms is used.\n\nreject install  a blocking route, which will force a route lookup to fail.  This is for exam‐\nple used to mask out networks before using the default route. This is  NOT  for  fire‐\nwalling.\n"
                },
                {
                    "name": "mod, dyn, reinstate",
                    "content": "install  a dynamic or modified route. These flags are for diagnostic purposes, and are\ngenerally only set by routing daemons.\n\ndev If force the route to be associated with the specified device, as the kernel will  other‐\nwise  try  to determine the device on its own (by checking already existing routes and\ndevice specifications, and where the route is added to). In most normal  networks  you\nwon't need this.\n\nIf dev If is the last option on the command line, the word dev may be omitted, as it's\nthe default. Otherwise the order of  the  route  modifiers  (metric  netmask  gw  dev)\ndoesn't matter.\n\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo",
                    "content": "adds  the  normal loopback entry, using netmask 255.0.0.0 and associated with the \"lo\"\ndevice (assuming this device was previously set up correctly with ifconfig(8)).\n\n"
                },
                {
                    "name": "route add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0",
                    "content": "adds a route to the local network 192.56.76.x via \"eth0\".  The word \"dev\" can be omit‐\nted here.\n\n"
                },
                {
                    "name": "route del default",
                    "content": "deletes the current default route, which is labeled \"default\" or 0.0.0.0 in the desti‐\nnation field of the current routing table.\n\n"
                },
                {
                    "name": "route del -net 192.56.76.0 netmask 255.255.255.0",
                    "content": "deletes the route. Since the Linux  routing  kernel  uses  classless  addressing,  you\npretty  much  always have to specify the netmask that is same as as seen in 'route -n'\nlisting.\n\n"
                },
                {
                    "name": "route add default gw mango",
                    "content": "adds a default route (which will be used if no other route matches).  All packets  us‐\ning  this route will be gatewayed through the address of a node named \"mango\". The de‐\nvice which will actually be used for that route depends on how we can reach \"mango\"  -\n\"mango\" must be on directly reachable route.\n\n"
                },
                {
                    "name": "route add mango sl0",
                    "content": "Adds the route to the host named \"mango\" via the SLIP interface (assuming that \"mango\"\nis the SLIP host).\n\n"
                },
                {
                    "name": "route add -net 192.57.66.0 netmask 255.255.255.0 gw mango",
                    "content": "This command adds the net \"192.57.66.x\" to be gatewayed through the  former  route  to\nthe SLIP interface.\n\n"
                },
                {
                    "name": "route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0",
                    "content": "This  is  an  obscure one documented so people know how to do it. This sets all of the\nclass D (multicast) IP routes to go via \"eth0\". This is the correct normal  configura‐\ntion line with a multicasting kernel.\n\n"
                },
                {
                    "name": "route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject",
                    "content": "This installs a rejecting route for the private network \"10.x.x.x.\"\n\n"
                },
                {
                    "name": "route -6 add 2001:0002::/48 metric 1 dev eth0",
                    "content": "This adds a IPv6 route with the specified metric to be directly reachable via eth0.\n\n"
                }
            ]
        },
        "OUTPUT": {
            "content": "The output of the kernel routing table is organized in the following columns\n",
            "subsections": [
                {
                    "name": "Destination",
                    "content": "The destination network or destination host.\n"
                },
                {
                    "name": "Gateway",
                    "content": "The gateway address or '*' if none set.\n"
                },
                {
                    "name": "Genmask",
                    "content": "The  netmask  for  the  destination  net; '255.255.255.255' for a host destination and\n'0.0.0.0' for the default route.\n\nFlags  Possible flags include\nU (route is up)\nH (target is a host)\nG (use gateway)\nR (reinstate route for dynamic routing)\nD (dynamically installed by daemon or redirect)\nM (modified from routing daemon or redirect)\nA (installed by addrconf)\nC (cache entry)\n!  (reject route)\n\nMetric The 'distance' to the target (usually counted in hops).\n\nRef    Number of references to this route. (Not used in the Linux kernel.)\n\nUse    Count of lookups for the route.  Depending on the use of -F and -C this will be either\nroute cache misses (-F) or hits (-C).\n\nIface  Interface to which packets for this route will be sent.\n\nMSS    Default maximum segment size for TCP connections over this route.\n\nWindow Default window size for TCP connections over this route.\n\nirtt   Initial RTT (Round Trip Time). The kernel uses this to guess about the best TCP proto‐\ncol parameters without waiting on (possibly slow) answers.\n"
                },
                {
                    "name": "HH (cached only)",
                    "content": "The number of ARP entries and cached routes that refer to the  hardware  header  cache\nfor  the cached route. This will be -1 if a hardware address is not needed for the in‐\nterface of the cached route (e.g. lo).\n"
                },
                {
                    "name": "Arp (cached only)",
                    "content": "Whether or not the hardware address for the cached route is up to date.\n"
                }
            ]
        },
        "FILES": {
            "content": "/proc/net/ipv6route\n/proc/net/route\n/proc/net/rtcache\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ifconfig(8), netstat(8), arp(8), rarp(8), ip(8)\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "Route for Linux was originally written by Fred N.  van  Kempen,  <waltje@uwalt.nl.mugnet.org>\nand  then modified by Johannes Stille and Linus Torvalds for pl15. Alan Cox added the mss and\nwindow options for Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Currently maintained by Phil Blundell <Philip.Blundell@pobox.com> and Bernd  Eckenfels  <net-\ntools@lina.inka.de>.\n\n\n\nnet-tools                                    2014-02-17                                     ROUTE(8)",
            "subsections": []
        }
    },
    "summary": "route - show / manipulate the IP routing table",
    "flags": [
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "use the specified address family (eg `inet'). Use route --help for a full list. You can use -6 as an alias for --inet6 and -4 as an alias for -A inet"
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "default."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "useful if you are trying to determine why the route to your nameserver has vanished."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "line with all parameters from the routing table. del delete a route. add add a new route. target the destination network or host. You can provide an addresses or symbolic network or host name. Optionally you can use /prefixlen notation instead of using the netmask op‐ tion."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "netmask NM when adding a network route, the netmask to be used. gw GW route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to. This is a BSDism compatibility hack. metric M set the metric field in the routing table (used by routing daemons) to M. If this op‐ tion is not specified the metric for inet6 (IPv6) address family defaults to '1', for inet (IPv4) it defaults to '0'. You should always specify an explicit metric value to not rely on those defaults - they also differ from iproute2. mss M sets MTU (Maximum Transmission Unit) of the route to M bytes. Note that the current implementation of the route command does not allow the option to set the Maximum Seg‐ ment Size (MSS). window W set the TCP window size for connections over this route to W bytes. This is typically only used on AX.25 networks and with drivers unable to handle back to back frames. irtt I set the initial round trip time (irtt) for TCP connections over this route to I mil‐ liseconds (1-12000). This is typically only used on AX.25 networks. If omitted the RFC 1122 default of 300ms is used. reject install a blocking route, which will force a route lookup to fail. This is for exam‐ ple used to mask out networks before using the default route. This is NOT for fire‐ walling."
        }
    ],
    "examples": [
        "adds  the  normal loopback entry, using netmask 255.0.0.0 and associated with the \"lo\"",
        "device (assuming this device was previously set up correctly with ifconfig(8)).",
        "adds a route to the local network 192.56.76.x via \"eth0\".  The word \"dev\" can be omit‐",
        "ted here.",
        "deletes the current default route, which is labeled \"default\" or 0.0.0.0 in the desti‐",
        "nation field of the current routing table.",
        "deletes the route. Since the Linux  routing  kernel  uses  classless  addressing,  you",
        "pretty  much  always have to specify the netmask that is same as as seen in 'route -n'",
        "listing.",
        "adds a default route (which will be used if no other route matches).  All packets  us‐",
        "ing  this route will be gatewayed through the address of a node named \"mango\". The de‐",
        "vice which will actually be used for that route depends on how we can reach \"mango\"  -",
        "\"mango\" must be on directly reachable route.",
        "Adds the route to the host named \"mango\" via the SLIP interface (assuming that \"mango\"",
        "is the SLIP host).",
        "This command adds the net \"192.57.66.x\" to be gatewayed through the  former  route  to",
        "the SLIP interface.",
        "This  is  an  obscure one documented so people know how to do it. This sets all of the",
        "class D (multicast) IP routes to go via \"eth0\". This is the correct normal  configura‐",
        "tion line with a multicasting kernel.",
        "This installs a rejecting route for the private network \"10.x.x.x.\"",
        "This adds a IPv6 route with the specified metric to be directly reachable via eth0."
    ],
    "see_also": [
        {
            "name": "ifconfig",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ifconfig/8/json"
        },
        {
            "name": "netstat",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/netstat/8/json"
        },
        {
            "name": "arp",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/arp/8/json"
        },
        {
            "name": "rarp",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rarp/8/json"
        },
        {
            "name": "ip",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip/8/json"
        }
    ]
}