?? route.8
字號:
.TH ROUTE 8 "2 January 2000" "net-tools" "Linux Programmer's Manual".SH NAMEroute \- show / manipulate the IP routing table.SH SYNOPSIS.B route.RB [ \-CFvnee ].TP.B route .RB [ \-v ].RB [ \-Afamily] .B add .RB [ \-net | \-host ] target .RB [ netmask Nm] .RB [ gw Gw] .RB [ metric N] .RB [ mss M] .RB [ window W] .RB [ irtt I].RB [ reject ].RB [ mod ].RB [ dyn ] .RB [ reinstate ] .RB [[ dev ] If].TP.B route .RB [ \-v ] .RB [ \-Afamily].B del .RB [ \-net | \-host ] target .RB [ gw Gw] .RB [ netmask Nm] .RB [ metric N] .RB [[ dev ]If].TP.B route .RB [ \-V ] .RB [ \-\-version ].RB [ \-h ].RB [ \--help ].SH DESCRIPTION.B Routemanipulates the kernel's IP routing tables. Its primary use is to setup static routes to specific hosts or networks via an interface afterit has been configured with the.BR ifconfig (8)program.When the.B addor.B deloptions are used,.B routemodifies the routing tables. Without these options,.B routedisplays the current contents of the routing tables..SH OPTIONS.TP.B \-A familyuse the specified address family (eg `inet'; use `route --help' for a full list)..TP .B -Foperate on the kernel's FIB (Forwarding Information Base) routingtable. This is the default..TP .B -Coperate on the kernel's routing cache..TP.B \-vselect verbose operation..TP.B \-nshow numerical addresses instead of trying to determine symbolic hostnames. This is useful if you are trying to determine why the route to yournameserver has vanished..TP.B \-euse.BR netstat (8)-formatfor displaying the routing table..B \-ee will generate a very long line with all parameters from the routing table..TP.B deldelete a route..TP .B add add a new route..TP.B targetthe destination network or host. You can provide IP addresses in dotteddecimal or host/network names..TP.B \-netthe.B targetis a network..TP.B -hostthe.B target is a host..TP.B netmask NMwhen adding a network route, the netmask to be used..TP.B gw GWroute packets via a gateway..B NOTE:The specified gateway must be reachable first. This usually means thatyou have to set up a static route to the gateway beforehand. If you specifythe address of one of your local interfaces, it will be used to decide aboutthe interface to which the packets should be routed to. This is a BSDismcompatibility hack..TP.B metric Mset the metric field in the routing table (used by routing daemons) to M..TP .B mss Mset the TCP Maximum Segment Size (MSS) for connections over this routeto M bytes. The default is the device MTU minus headers, or a lower MTU when path mtu discovery occured. This setting can be used to force smaller TCP packets on theother end when path mtu discovery does not work (usually because ofmisconfigured firewalls that block ICMP Fragmentation Needed).TP .B window W set the TCP window size for connections over this route to Wbytes. This is typically only used on AX.25 networks and with driversunable to handle back to back frames..TP.B irtt Iset the initial round trip time (irtt) for TCP connections over thisroute to I milliseconds (1-12000). This is typically only used onAX.25 networks. If omitted the RFC 1122 default of 300ms is used..TP.B rejectinstall a blocking route, which will force a route lookup to fail.This is for example used to mask out networks before using the defaultroute. This is NOT for firewalling..TP.B mod, dyn, reinstateinstall a dynamic or modified route. These flags are for diagnosticpurposes, and are generally only set by routing daemons..TP.B dev Ifforce the route to be associated with the specified device, as thekernel will otherwise try to determine the device on its own (bychecking already existing routes and device specifications, and wherethe route is added to). In most normal networks you won't need this.If .B dev Ifis the last option on the command line, the word .B devmay be omitted, as it's the default. Otherwise the order of the routemodifiers (metric - netmask - gw - dev) doesn't matter..SH EXAMPLES.TP.B route add -net 127.0.0.0adds the normal loopback entry, using netmask 255.0.0.0 (class A net,determined from the destination address) and associated with the "lo" device (assuming this device was prviously set up correctly with.BR ifconfig (8)). .TP .B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0adds a route to the network 192.56.76.x via "eth0". The Class C netmask modifier is not really necessary here because192.* is a Class C IP address. The word "dev" can be omitted here. .TP.B route add default gw mango-gwadds a default route (which will be used if no other route matches).All packets using this route will be gatewayed through "mango-gw". Thedevice which will actually be used for that route depends on how wecan reach "mango-gw" - the static route to "mango-gw" will have to beset up before. .TP.B route add ipx4 sl0Adds the route to the "ipx4" host via the SLIP interface (assuming that"ipx4" is the SLIP host)..TP.B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4This command adds the net "192.57.66.x" to be gatewayed through the formerroute to the SLIP interface..TP.B route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0This is an obscure one documented so people know how to do it. This setsall of the class D (multicast) IP routes to go via "eth0". This is thecorrect normal configuration line with a multicasting kernel. .TP.B route add -net 10.0.0.0 netmask 255.0.0.0 rejectThis installs a rejecting route for the private network "10.x.x.x.".LP.SH OUTPUTThe output of the kernel routing table is organized in the following columns.TP.B Destination The destination network or destination host..TP.B GatewayThe gateway address or '*' if none set..TP.B Genmask The netmask for the destination net; '255.255.255.255' for a host destinationand '0.0.0.0' for the .B defaultroute..TP.B Flags Possible flags include.br.B U(route is.BR up ).br.B H(target is a.BR host ).br.B G(use.BR gateway ).br.B R.RB ( reinstateroute for dynamic routing).br.B D.RB ( dynamicallyinstalled by daemon or redirect).br.B M.RB ( modifiedfrom routing daemon or redirect).br.B A(installed by.BR addrconf ).br.B C.RB ( cacheentry).br.B !.RB ( rejectroute).TP.B Metric The 'distance' to the target (usually counted in hops). It is not used byrecent kernels, but may be needed by routing daemons..TP.B Ref Number of references to this route. (Not used in the Linux kernel.).TP.B UseCount of lookups for the route. Depending on the use of -F and -C this willbe either route cache misses (-F) or hits (-C)..TP.B IfaceInterface to which packets for this route will be sent..TP.B MSS Default maximum segement size for TCP connections over this route..TP.B Window Default window size for TCP connections over this route..TP.B irttInitial RTT (Round Trip Time). The kernel uses this to guess about the bestTCP protocol parameters without waiting on (possibly slow) answers..TP.B HH (cached only)The number of ARP entries and cached routes that refer to the hardwareheader cache for the cached route. This will be \-1 if a hardwareaddress is not needed for the interface of the cached route (e.g. lo)..TP.B Arp (cached only)Whether or not the hardware address for the cached route is up to date..LP.SH FILES.I /proc/net/ipv6_route.br.I /proc/net/route.br.I /proc/net/rt_cache.LP.SH SEE ALSO.I ifconfig(8), netstat(8), arp(8), rarp(8).LP.SH HISTORY.B Routefor Linux was originally written by Fred N. van Kempen,<waltje@uwalt.nl.mugnet.org> and then modified by Johannes Stille andLinus Torvalds for pl15. Alan Cox added the mss and window options forLinux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels..SH AUTHORCurrently maintained by Phil Blundell <Philip.Blundell@pobox.com>.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -