{
    "mode": "info",
    "parameter": "route",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/route/json",
    "generated": "2026-08-05T04:42:27Z",
    "synopsis": "route [-CFvnNee] [-A family |-4|-6]\nroute  [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw\nGw] [metric N] [mss M] [window W] [irtt I] [reject] [mod]  [dyn]\n[reinstate] [[dev] If]\nroute  [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask\nNm] [metric M] [[dev] If]\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\nGw] [metric N] [mss M] [window W] [irtt I] [reject] [mod]  [dyn]\n[reinstate] [[dev] If]\n\nroute  [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask\nNm] [metric M] [[dev] If]\n\nroute  [-V] [--version] [-h] [--help]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Route manipulates the kernel's IP routing tables.  Its primary  use  is\nto  set up static routes to specific hosts or networks via an interface\nafter it has been configured with the ifconfig(8) program.\n\nWhen the add or del options are used, route modifies  the  routing  ta-\nbles.   Without  these  options, route displays the current contents of\nthe routing tables.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-A family\nuse the specified address family (eg `inet'). Use  route  --help\nfor  a  full list. You can use -6 as an alias for --inet6 and -4\nas an alias for -A inet\n\n-F     operate on the kernel's FIB (Forwarding Information Base)  rout-\ning table.  This is the default.\n\n-C     operate on the kernel's routing cache.\n\n-v     select verbose operation.\n\n-n     show numerical addresses instead of trying to determine symbolic\nhost names. This is useful if you are trying  to  determine  why\nthe route to your nameserver has vanished.\n\n-e     use  netstat(8)-format  for  displaying  the routing table.  -ee\nwill generate a very long line  with  all  parameters  from  the\nrouting 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\nsymbolic network or host name. Optionally you can use /prefixlen\nnotation instead of using the netmask option.\n\n-net   the target is a network.\n\n-host  the target is a host.\n\nnetmask 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 usu-\nally means that you have to set up a static route to the gateway\nbeforehand.  If you specify the address of one of your local in-\nterfaces, it will be used to decide about the interface to which\nthe  packets should be routed to. This is a BSDism compatibility\nhack.\n\nmetric M\nset the metric field in the routing table (used by routing  dae-\nmons) to M. If this option is not specified the metric for inet6\n(IPv6) address family defaults to '1', for inet  (IPv4)  it  de-\nfaults  to  '0'.  You  should  always specify an explicit metric\nvalue to not rely on those defaults  -  they  also  differ  from\niproute2.\n\nmss M  sets  MTU  (Maximum  Transmission Unit) of the route to M bytes.\nNote that the current implementation of the route  command  does\nnot allow the option to set the Maximum Segment Size (MSS).\n\nwindow W\nset  the  TCP  window  size for connections over this route to W\nbytes. This is typically only used on AX.25  networks  and  with\ndrivers unable to handle back to back frames.\n\nirtt I set  the initial round trip time (irtt) for TCP connections over\nthis route to I milliseconds (1-12000). This is  typically  only\nused on AX.25 networks. If omitted the RFC 1122 default of 300ms\nis used.\n\nreject install a blocking route, which will force  a  route  lookup  to\nfail.   This is for example used to mask out networks before us-\ning the default route. This is NOT for firewalling.\n\nmod, dyn, reinstate\ninstall a dynamic or modified route. These flags are  for  diag-\nnostic purposes, and are generally only set by routing daemons.\n\ndev If force  the  route to be associated with the specified device, as\nthe kernel will otherwise try to determine the device on its own\n(by  checking already existing routes and device specifications,\nand 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\nmay be omitted, as it's the default. Otherwise the order of  the\nroute modifiers (metric netmask gw dev) doesn't matter.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo\nadds  the normal loopback entry, using netmask 255.0.0.0 and as-\nsociated with the \"lo\" device (assuming this device  was  previ-\nously set up correctly with ifconfig(8)).\n\nroute add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0\nadds  a  route to the local network 192.56.76.x via \"eth0\".  The\nword \"dev\" can be omitted here.\n\nroute del default\ndeletes the current default route, which is labeled \"default\" or\n0.0.0.0 in the destination field of the current routing table.\n\nroute del -net 192.56.76.0 netmask 255.255.255.0\ndeletes the route. Since the Linux routing kernel uses classless\naddressing, you pretty much always have to specify  the  netmask\nthat is same as as seen in 'route -n' listing.\n\nroute add default gw mango\nadds  a  default  route  (which  will  be used if no other route\nmatches).  All  packets  using  this  route  will  be  gatewayed\nthrough  the  address  of a node named \"mango\". The device which\nwill actually be used for that route depends on how we can reach\n\"mango\" - \"mango\" must be on directly reachable route.\n\nroute add mango sl0\nAdds  the route to the host named \"mango\" via the SLIP interface\n(assuming that \"mango\" is the SLIP host).\n\nroute add -net 192.57.66.0 netmask 255.255.255.0 gw mango\nThis command adds the net \"192.57.66.x\" to be gatewayed  through\nthe former route to the SLIP interface.\n\nroute add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\nThis  is  an obscure one documented so people know how to do it.\nThis sets all of the class D (multicast) IP  routes  to  go  via\n\"eth0\".  This  is  the  correct normal configuration line with a\nmulticasting kernel.\n\nroute add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject\nThis  installs  a  rejecting  route  for  the  private   network\n\"10.x.x.x.\"\n\nroute -6 add 2001:0002::/48 metric 1 dev eth0\nThis  adds a IPv6 route with the specified metric to be directly\nreachable via eth0.\n",
            "subsections": []
        },
        "OUTPUT": {
            "content": "The output of the kernel routing table is organized  in  the  following\ncolumns\n\nDestination\nThe destination network or destination host.\n\nGateway\nThe gateway address or '*' if none set.\n\nGenmask\nThe  netmask  for  the  destination net; '255.255.255.255' for a\nhost destination and '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  ker-\nnel.)\n\nUse    Count  of lookups for the route.  Depending on the use of -F and\n-C this will be either route 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\nroute.\n\nWindow Default window size for TCP connections over this route.\n\nirtt   Initial  RTT  (Round  Trip  Time). The kernel uses this to guess\nabout the best TCP protocol parameters without waiting on  (pos-\nsibly slow) answers.\n\nHH (cached only)\nThe  number  of  ARP entries and cached routes that refer to the\nhardware header cache for the cached route. This will be -1 if a\nhardware  address  is not needed for the interface of the cached\nroute (e.g. lo).\n\nArp (cached only)\nWhether or not the hardware address for the cached route  is  up\nto date.\n",
            "subsections": []
        },
        "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,\n<waltje@uwalt.nl.mugnet.org> and then modified by Johannes  Stille  and\nLinus  Torvalds for pl15. Alan Cox added the mss and window options for\nLinux 1.1.22. irtt support and merged with netstat  from  Bernd  Ecken-\nfels.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Currently  maintained  by Phil Blundell <Philip.Blundell@pobox.com> and\nBernd Eckenfels <net-tools@lina.inka.de>.\n\nnet-tools                         2014-02-17                          ROUTE(8)",
            "subsections": []
        }
    },
    "summary": "route - show / manipulate the IP routing table",
    "flags": [],
    "examples": [
        "route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo",
        "adds  the normal loopback entry, using netmask 255.0.0.0 and as-",
        "sociated with the \"lo\" device (assuming this device  was  previ-",
        "ously set up correctly with ifconfig(8)).",
        "route add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0",
        "adds  a  route to the local network 192.56.76.x via \"eth0\".  The",
        "word \"dev\" can be omitted here.",
        "route del default",
        "deletes the current default route, which is labeled \"default\" or",
        "0.0.0.0 in the destination field of the current routing table.",
        "route del -net 192.56.76.0 netmask 255.255.255.0",
        "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.",
        "route add default gw mango",
        "adds  a  default  route  (which  will  be used if no other route",
        "matches).  All  packets  using  this  route  will  be  gatewayed",
        "through  the  address  of a node named \"mango\". The device which",
        "will actually be used for that route depends on how we can reach",
        "\"mango\" - \"mango\" must be on directly reachable route.",
        "route add mango sl0",
        "Adds  the route to the host named \"mango\" via the SLIP interface",
        "(assuming that \"mango\" is the SLIP host).",
        "route add -net 192.57.66.0 netmask 255.255.255.0 gw mango",
        "This command adds the net \"192.57.66.x\" to be gatewayed  through",
        "the former route to the SLIP interface.",
        "route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0",
        "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 configuration line with a",
        "multicasting kernel.",
        "route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject",
        "This  installs  a  rejecting  route  for  the  private   network",
        "\"10.x.x.x.\"",
        "route -6 add 2001:0002::/48 metric 1 dev eth0",
        "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"
        }
    ]
}