○
○
○
○
○
A- Commonly Used Commands
A-9
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
○
A.1.9
route
Syntax:
route
route add <name> <dest> <relay> [<mask> [<cost> [<timeout>]]]
route delete <name>
route flush
Description:
Lists routes; adds or deletes a static route; or deletes all routes.
<name>
is an arbitrary name specified to
route add
that can be used to delete the
route using
route delete
.
<dest>
is the IP address of the network being routed to (only those bits of
<dest>
corresponding to bits set in
<mask>
are relevant).
<relay>
is the IP address of the next-hop gateway for the route.
<mask>
(default ff:ff:ff:00) is the subnet mask of the network being routed to,
specified as four hexadecimal numbers separated by colons. For example, 0:0:0:0
is a default route (matches everything without a more specific route), ff:ff:ff:0 would
match a Class C network, and ff:ff:ff:ff is a route to a single host. (Note: the default
is not always sensible; in particular, if
<dest>
is 0.0.0.0 then it would be better
for the mask to default to 0:0:0:0. This may change in future versions.)
<cost>
(default 1) is the number of hops counted as the cost of the route, which may
affect the choice of route when the route is competing with routes acquired from RIP.
(But note that using a mixture of RIP and static routing is not advised.)
<timeout>
(default 0, meaning that the route does not time out) is the number of
seconds that the route will remain in the routing table.
Note that the routing table does not contain routes to the directly connected
networks, without going through a gateway. TCP/IP routes packets to such destinations
by using the information in the device and subnet tables instead.
The
route
command (with no parameters) displays the routing table. It adds a
comment to each route with the following information:
How the route was obtained; one of
MAN
configured by the
route
command
RIP
obtained from RIP
ICMP
obtained from an ICMP redirect message
SNMP configured by SNMP network management;
The time-out, if the route is not permanent;