Route
The Mediawiki system (the 'software' that runs this site) capitalises all articles. Please note that commands on most UNIX and Unix-like systems are entered in lower case. As an example the article documenting the Ln command would be issued from the command line as 'ln'.
The route command is used to manually configure the routing on FreeBSD. It differs in usage from the Microsoft command of the same name which can confuse system administrators migrating across platforms.
Typically the route command is not required since advanced routing requirements would ordinarily be maintained by the routed daemon.
Contents |
Usage
The command itself has only a few options but makes up for this with what is described as a programmatic command language interface. The available options are as follows.
Debug
The -d option executes the request but does not implement it. It allows the request to be tested to ensure there are no issues arising from doing so.
Name resolution
The -n option instructs the route command to not resolve IP addresses to DNS names. This is useful where name resolution may slow down the presentation of information or otherwise where no DNS name servers are available or configured for use.
Verbosity
The -v option presents additional information on the screen.
Quiet
The -q option suppresses information for certain commands, namely; 'add', 'change' and 'flush' (see below).
Commands
The following commands are exist:
Add
The add command creates a new route entry into the routing table.
Flush
The flush command removes all routes from the routing table (use with caution).
Delete
The delete command removes a single route entry from the routing table.
Change
The change command changes a specific element of a route already in the routing table.
Get
The get command displays a specific entry of the routing table.
Monitor
The monitor command continuously displays changes to or queries from the routing table.
Microsoft Windows equivalents
Many system administrators from the Microsoft world will be used to the route show command. This is not available from the FreeBSD 'route' command. To show current routing information in a similar way to Microsoft Windows use the command netstat -r, as an example.
$ netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 172.27.0.1 UGS 0 1822642 fxp0 localhost localhost UH 0 3946 lo0 172.27/24 link#1 UC 0 0 fxp0 172.27.0.1 00:02:a5:77:5c:29 UHLW 2 0 fxp0 1193 mail 00:02:a5:84:d3:10 UHLW 1 22373 lo0 Internet6: Destination Gateway Flags Netif Expire localhost.domain localhost.domain UH lo0 fe80::%fxp0 link#1 UC fxp0 fe80::202:a5ff:fe8 00:02:a5:84:d3:10 UHL lo0 fe80::%lo0 fe80::1%lo0 U lo0 fe80::1%lo0 link#3 UHL lo0 ff01:1:: link#1 UC fxp0 ff01:3:: localhost.domain UC lo0 ff02::%fxp0 link#1 UC fxp0 ff02::%lo0 localhost.domain UC lo0
See also
See also the articles on netstat, Network Configuration (basic) and Network Configuration (Advanced).