{"id":339,"date":"2019-10-21T19:49:49","date_gmt":"2019-10-21T17:49:49","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=339"},"modified":"2019-10-21T19:49:49","modified_gmt":"2019-10-21T17:49:49","slug":"route","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=339","title":{"rendered":"ROUTE"},"content":{"rendered":"<p>ROUTE(8)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux System Administrator&#8217;s Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ROUTE(8)<\/p>\n<p>NAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>route &#8211; show \/ manipulate the IP routing table<\/p>\n<p>SYNOPSIS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>route [-CFvnNee] [-A family |-4|-6]<\/p>\n<p>route\u00a0 [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm]<br \/>\n[gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod]<br \/>\n[dyn] [reinstate] [[dev] If]<\/p>\n<p>route\u00a0 [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw]<br \/>\n[netmask Nm] [metric M] [[dev] If]<\/p>\n<p>route\u00a0 [-V] [&#8211;version] [-h] [&#8211;help]<\/p>\n<p>DESCRIPTION\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>Route manipulates the kernel&#8217;s IP routing tables.\u00a0 Its primary use is<br \/>\nto set up static routes to specific hosts or networks via an<br \/>\ninterface after it has been configured with the ifconfig(8) program.<\/p>\n<p>When the add or del options are used, route modifies the routing<br \/>\ntables.\u00a0 Without these options, route displays the current contents<br \/>\nof the routing tables.<\/p>\n<p>OPTIONS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>-A family<br \/>\nuse the specified address family (eg `inet&#8217;). Use route &#8211;help<br \/>\nfor a full list. You can use -6 as an alias for &#8211;inet6 and -4<br \/>\nas an alias for -A inet<\/p>\n<p>-F\u00a0\u00a0\u00a0\u00a0 operate on the kernel&#8217;s FIB (Forwarding Information Base)<br \/>\nrouting table.\u00a0 This is the default.<\/p>\n<p>-C\u00a0\u00a0\u00a0\u00a0 operate on the kernel&#8217;s routing cache.<\/p>\n<p>-v\u00a0\u00a0\u00a0\u00a0 select verbose operation.<\/p>\n<p>-n\u00a0\u00a0\u00a0\u00a0 show numerical addresses instead of trying to determine<br \/>\nsymbolic host names. This is useful if you are trying to<br \/>\ndetermine why the route to your nameserver has vanished.<\/p>\n<p>-e\u00a0\u00a0\u00a0\u00a0 use netstat(8)-format for displaying the routing table.\u00a0 -ee<br \/>\nwill generate a very long line with all parameters from the<br \/>\nrouting table.<\/p>\n<p>del\u00a0\u00a0\u00a0 delete a route.<\/p>\n<p>add\u00a0\u00a0\u00a0 add a new route.<\/p>\n<p>target the destination network or host. You can provide an addresses<br \/>\nor symbolic network or host name. Optionally you can use<br \/>\n\/prefixlen notation instead of using the netmask option.<\/p>\n<p>-net\u00a0\u00a0 the target is a network.<\/p>\n<p>-host\u00a0 the target is a host.<\/p>\n<p>netmask NM<br \/>\nwhen adding a network route, the netmask to be used.<\/p>\n<p>gw GW\u00a0 route packets via a gateway.<br \/>\nNOTE: The specified gateway must be reachable first. This<br \/>\nusually means that you have to set up a static route to the<br \/>\ngateway beforehand. If you specify the address of one of your<br \/>\nlocal interfaces, it will be used to decide about the<br \/>\ninterface to which the packets should be routed to. This is a<br \/>\nBSDism compatibility hack.<\/p>\n<p>metric M<br \/>\nset the metric field in the routing table (used by routing<br \/>\ndaemons) to M. If this option is not specified the metric for<br \/>\ninet6 (IPv6) address family defaults to &#8216;1&#8217;, for inet (IPv4)<br \/>\nit defaults to &#8216;0&#8217;. You should always specify an explicit<br \/>\nmetric value to not rely on those defaults &#8211; they also differ<br \/>\nfrom iproute2.<\/p>\n<p>mss M\u00a0 sets MTU (Maximum Transmission Unit) of the route to M bytes.<br \/>\nNote that the current implementation of the route command does<br \/>\nnot allow the option to set the Maximum Segment Size (MSS).<\/p>\n<p>window W<br \/>\nset the TCP window size for connections over this route to W<br \/>\nbytes. This is typically only used on AX.25 networks and with<br \/>\ndrivers unable to handle back to back frames.<\/p>\n<p>irtt I set the initial round trip time (irtt) for TCP connections<br \/>\nover this route to I milliseconds (1-12000). This is typically<br \/>\nonly used on AX.25 networks. If omitted the RFC 1122 default<br \/>\nof 300ms is used.<\/p>\n<p>reject install a blocking route, which will force a route lookup to<br \/>\nfail.\u00a0 This is for example used to mask out networks before<br \/>\nusing the default route. This is NOT for firewalling.<\/p>\n<p>mod, dyn, reinstate<br \/>\ninstall a dynamic or modified route. These flags are for<br \/>\ndiagnostic purposes, and are generally only set by routing<br \/>\ndaemons.<\/p>\n<p>dev If force the route to be associated with the specified device, as<br \/>\nthe kernel will otherwise try to determine the device on its<br \/>\nown (by checking already existing routes and device<br \/>\nspecifications, and where the route is added to). In most<br \/>\nnormal networks you won&#8217;t need this.<\/p>\n<p>If dev If is the last option on the command line, the word dev<br \/>\nmay be omitted, as it&#8217;s the default. Otherwise the order of<br \/>\nthe route modifiers (metric netmask gw dev) doesn&#8217;t matter.<\/p>\n<p>EXAMPLES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo<br \/>\nadds the normal loopback entry, using netmask 255.0.0.0 and<br \/>\nassociated with the &#8220;lo&#8221; device (assuming this device was<br \/>\npreviously set up correctly with ifconfig(8)).<\/p>\n<p>route add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0<br \/>\nadds a route to the local network 192.56.76.x via &#8220;eth0&#8221;.\u00a0 The<br \/>\nword &#8220;dev&#8221; can be omitted here.<\/p>\n<p>route del default<br \/>\ndeletes the current default route, which is labeled &#8220;default&#8221;<br \/>\nor 0.0.0.0 in the destination field of the current routing<br \/>\ntable.<\/p>\n<p>route add default gw mango<br \/>\nadds a default route (which will be used if no other route<br \/>\nmatches).\u00a0 All packets using this route will be gatewayed<br \/>\nthrough the address of a node named &#8220;mango&#8221;. The device which<br \/>\nwill actually be used for that route depends on how we can<br \/>\nreach &#8220;mango&#8221; &#8211; &#8220;mango&#8221; must be on directly reachable route.<\/p>\n<p>route add mango sl0<br \/>\nAdds the route to the host named &#8220;mango&#8221; via the SLIP<br \/>\ninterface (assuming that &#8220;mango&#8221; is the SLIP host).<\/p>\n<p>route add -net 192.57.66.0 netmask 255.255.255.0 gw mango<br \/>\nThis command adds the net &#8220;192.57.66.x&#8221; to be gatewayed<br \/>\nthrough the former route to the SLIP interface.<\/p>\n<p>route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0<br \/>\nThis is an obscure one documented so people know how to do it.<br \/>\nThis sets all of the class D (multicast) IP routes to go via<br \/>\n&#8220;eth0&#8221;. This is the correct normal configuration line with a<br \/>\nmulticasting kernel.<\/p>\n<p>route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject<br \/>\nThis installs a rejecting route for the private network<br \/>\n&#8220;10.x.x.x.&#8221;<\/p>\n<p>route -6 add 2001:0002::\/48 metric 1 dev eth0<br \/>\nThis adds a IPv6 route with the specified metric to be<br \/>\ndirectly reachable via eth0.<\/p>\n<p>OUTPUT\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>The output of the kernel routing table is organized in the following<br \/>\ncolumns<\/p>\n<p>Destination<br \/>\nThe destination network or destination host.<\/p>\n<p>Gateway<br \/>\nThe gateway address or &#8216;*&#8217; if none set.<\/p>\n<p>Genmask<br \/>\nThe netmask for the destination net; &#8216;255.255.255.255&#8217; for a<br \/>\nhost destination and &#8216;0.0.0.0&#8217; for the default route.<\/p>\n<p>Flags\u00a0 Possible flags include<br \/>\nU (route is up)<br \/>\nH (target is a host)<br \/>\nG (use gateway)<br \/>\nR (reinstate route for dynamic routing)<br \/>\nD (dynamically installed by daemon or redirect)<br \/>\nM (modified from routing daemon or redirect)<br \/>\nA (installed by addrconf)<br \/>\nC (cache entry)<br \/>\n!\u00a0 (reject route)<\/p>\n<p>Metric The &#8216;distance&#8217; to the target (usually counted in hops).<\/p>\n<p>Ref\u00a0\u00a0\u00a0 Number of references to this route. (Not used in the Linux<br \/>\nkernel.)<\/p>\n<p>Use\u00a0\u00a0\u00a0 Count of lookups for the route.\u00a0 Depending on the use of -F<br \/>\nand -C this will be either route cache misses (-F) or hits<br \/>\n(-C).<\/p>\n<p>Iface\u00a0 Interface to which packets for this route will be sent.<\/p>\n<p>MSS\u00a0\u00a0\u00a0 Default maximum segment size for TCP connections over this<br \/>\nroute.<\/p>\n<p>Window Default window size for TCP connections over this route.<\/p>\n<p>irtt\u00a0\u00a0 Initial RTT (Round Trip Time). The kernel uses this to guess<br \/>\nabout the best TCP protocol parameters without waiting on<br \/>\n(possibly slow) answers.<\/p>\n<p>HH (cached only)<br \/>\nThe number of ARP entries and cached routes that refer to the<br \/>\nhardware header cache for the cached route. This will be -1 if<br \/>\na hardware address is not needed for the interface of the<br \/>\ncached route (e.g. lo).<\/p>\n<p>Arp (cached only)<br \/>\nWhether or not the hardware address for the cached route is up<br \/>\nto date.<\/p>\n<p>FILES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>\/proc\/net\/ipv6_route<br \/>\n\/proc\/net\/route<br \/>\n\/proc\/net\/rt_cache<\/p>\n<p>SEE ALSO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>ifconfig(8), netstat(8), arp(8), rarp(8), ip(8)<\/p>\n<p>HISTORY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>Route for Linux was originally written by Fred N.\u00a0 van Kempen,<br \/>\n&lt;waltje@uwalt.nl.mugnet.org&gt; and then modified by Johannes Stille and<br \/>\nLinus Torvalds for pl15. Alan Cox added the mss and window options<br \/>\nfor Linux 1.1.22. irtt support and merged with netstat from Bernd<br \/>\nEckenfels.<\/p>\n<p>AUTHOR\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>Currently maintained by Phil Blundell &lt;Philip.Blundell@pobox.com&gt; and<br \/>\nBernd Eckenfels &lt;net-tools@lina.inka.de&gt;.<\/p>\n<p>COLOPHON\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>This page is part of the net-tools (networking utilities) project.<br \/>\nInformation about the project can be found at<br \/>\n\u27e8http:\/\/net-tools.sourceforge.net\/\u27e9.\u00a0 If you have a bug report for<br \/>\nthis manual page, see \u27e8http:\/\/net-tools.sourceforge.net\/\u27e9.\u00a0 This page<br \/>\nwas obtained from the project&#8217;s upstream Git repository<br \/>\n(git:\/\/git.code.sf.net\/p\/net-tools\/code) on 2014-12-30.\u00a0 If you dis\u2010<br \/>\ncover any rendering problems in this HTML version of the page, or you<br \/>\nbelieve there is a better or more up-to-date source for the page, or<br \/>\nyou have corrections or improvements to the information in this<br \/>\nCOLOPHON (which is not part of the original manual page), send a mail<br \/>\nto\u00a0man-pages@man7.org<\/p>\n<p>net-tools\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2014-02-17\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ROUTE(8)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ROUTE(8)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux System Administrator&#8217;s Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ROUTE(8) NAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top route &#8211; show \/ manipulate the IP routing table SYNOPSIS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top route [-CFvnNee] [-A family |-4|-6] route\u00a0 [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] route\u00a0 [-v] [-A family |-4|-6] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-339","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}