.TH ROUTE 8C "5 May 1983" .UC 4 .SH NAME route \- manually manipulate the routing tables .SH SYNOPSIS .B /etc/route [ .B \-f ] [ .I command args ] .SH DESCRIPTION .I Route is a program used to manually manipulate the network routing tables. It normally is not needed, as the system routing table management daemon, .IR routed (8C), should tend to this task. .PP .I Route accepts three commands: .IR add , to add a route; .IR delete , to delete a route; and .IR change , to modify an existing route. .PP All commands have the following syntax: .PP .ti +0.5i .B /etc/route .I command .B destination gateway [ .B metric ] .PP where .I destination is a host or network for which the route is ``to'', .I gateway is the gateway to which packets should be addressed, and .I metric is an optional count indicating the number of hops to the .IR destination . If no metric is specified, .I route assumes a value of 0. Routes to a particular host are distinguished from those to a network by interpreting the Internet address associated with .IR destination . If the .I destination has a ``local address part'' of INADDR_ANY, then the route is assumed to be to a network; otherwise, it is presumed to be a route to a host. If the route is to a destination connected via a gateway, the .I metric should be greater than 0. All symbolic names specified for a .I destination or .I gateway are looked up first in the host name database, .IR hosts (5). If this lookup fails, the name is then looked for in the network name database, .IR networks (5). .PP .I Route uses a raw socket and the SIOCADDRT and SIOCDELRT .IR ioctl 's to do its work. As such, only the super-user may modify the routing tables. .PP If the .B \-f option is specified, .I route will ``flush'' the routing tables of all gateway entries. If this is used in conjunction with one of the commands described above, the tables are flushed prior to the command's application. .SH DIAGNOSTICS .B ``add %s: gateway %s flags %x'' .br The specified route is being added to the tables. The values printed are from the routing table entry supplied in the .I ioctl call. .PP .B ``delete %s: gateway %s flags %x'' .br As above, but when deleting an entry. .PP .B ``%s %s done'' .br When the .B \-f flag is specified, each routing table entry deleted is indicated with a message of this form. .PP .B ``not in table'' .br A delete operation was attempted for an entry which wasn't present in the tables. .PP .B ``routing table overflow'' .br An add operation was attempted, but the system was low on resources and was unable to allocate memory to create the new entry. .SH "SEE ALSO" intro(4N), routed(8C) .SH BUGS The change operation is not implemented, one should add the new route, then delete the old one.