Routes are entered into TNSR using the
route table <name> command in
configuration mode. When using the
route command for this purpose, the table
name must be specified in order to establish the routing context. This command
config-route-table mode. From there, individual routes can be
config-route-table mode, the following commands are available:
Sets a description for the route table.
- id <id>
A required numeric ID associated with this route table. It must be an unsigned 32-bit integer, greater than
1-4294967295) and cannot overlap any other VRF ID.
0is reserved for use by the default route tables.
- route <destination-prefix>
Configures a route to the specified destination network. This enters
config-rttbl-next-hopmode where the remaining parameters for the route are set.
For a single address, use a
/32mask for IPv4 or
config-rttbl-next-hop mode, the following commands are available:
Sets a description for this route.
- next-hop <hop-id> via <action|gateway>
Configures how TNSR will handle traffic to this destination. This may be repeated multiple times with unique hop-id values to specify multiple destinations.
Take care when crafting
next-hopentries for VRF route tables. Traffic matching this route will exit this VRF if the next hop is in a different VRF.
The following parameters are available to control the route behavior:
The ID of the next hop. Must be unique between entries in the same route.
- via <ip-address>
Sets the next hop for this route as an IP address. Additional modifiers are possible for any
viaform using an IP address destination, see Route modifiers.
- via <ip-address> <interface>
Configures both the IP address and interface for the next hop. May use modifiers, see Route modifiers.
To add a route using an interface as a destination without a specific IP address, use
0.0.0.0as the next hop along with the target interface. This is primarily used in VRFs to allow communication between networks directly attached to interfaces in different VRFs (Communicate Between VRFs).
- via <ip-address> next-hop-table <route-table-name>
Configures a recursive route lookup using a different route table. May use modifiers, see Route modifiers.
The IP address in this command may be
0.0.0.0, in which case the specified table will be consulted to locate the next hop instead of hardcoding the value.
- via classify <classify-name>
Reserved for future use.
- via drop
Drops traffic to this destination (null route).
- via local
The destination is local to TNSR, such as an interface address or loopback.
- via null-send-prohibit
Packets matching this route will be dropped by TNSR, and TNSR will send an ICMP “Destination administratively prohibited” message back to the source address.
- via null-send-unreach
Packets matching this route will be dropped by TNSR, and TNSR will send an ICMP “Destination unreachable” message back to the source address.
Sets the metric for this route, which is used by routing daemons. This value helps routing protocols choose between multiple possible routes. This is only a local value. Lower metric value routes are considered preferable over higher value routes. The same priority is used for all next-hop entries.
For routes set with a next hop using
via <ip-address>, additional modifiers
control how TNSR resolves the route destination.
The weight of routes to the same destination. Acts as a ratio of packets to deliver to each next hop. Value must be from
Equal weights will deliver the same amount of traffic to all next hops for this destination prefix, uneven weights will deliver more traffic via the higher weighted connection. If one path has a weight of
1, and the other has a weight of
3, then the first path will receive 25% (
1/(1+3)) of the traffic and the other will receive 75% (
Sets a constraint on recursive route resolution via attached network. The next hop is unknown, but destinations in this prefix may be located via ARP.
Sets a constraint on recursive route resolution via host. The next hop is known, but the interface is not.
Multiple modifiers may be used together, but when doing so,
priority must be set first.
tnsr(config)# route table ipv4-VRF:0 tnsr(config-route-table)# route 10.2.10.0/24 tnsr(config-rttbl4-next-hop)# next-hop 0 via 10.2.0.2
tnsr(config)# route table ipv6-VRF:0 tnsr(config-route-table)# route fc07:b337:c4f3::/48 tnsr(config-rttbl6-next-hop)# next-hop 0 via 2001:db8:1::2
Breaking down the examples above, first the route table is specified. Within that context a destination network route is given. The destination network establishes a sub-context for a specific route. From there, the next hop configuration is entered.
To specify more than one route, exit out of the
next-hop context so that
TNSR is in the correct context for the route table itself, then enter an
additional destination and next-hop.