Managing Routes

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 enters config-route-table mode. From there, individual routes can be managed.

Inside config-route-table mode, the following commands are available:

description

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 0 (1-4294967295) and cannot overlap any other VRF ID.

Note

The ID 0 is reserved for use by the default route tables.

route <destination-prefix>

Configures a route to the specified destination network. This enters config-rttbl-next-hop mode where the remaining parameters for the route are set.

Tip

For a single address, use a /32 mask for IPv4 or /128 for IPv6.

Inside config-rttbl-next-hop mode, the following commands are available:

description

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.

Note

Take care when crafting next-hop entries 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:

hop-id

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 via form 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.

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.

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.

priority

Sets the administrative distance priority for this route. This value Helps routing protocols choose between multiple possible destinations. This is only a local value, and a lower value is taken as being more reliable (closer). The same priority is used for all next-hop entries.

Route modifiers

For routes set with a next hop using via <ip-address>, additional modifiers control how TNSR resolves the route destination.

weight

The weight of routes to the same destination. Acts as a ratio of packets to deliver to each next hop. Value must be from 1 to 255.

Tip

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% (3/(1+3)).

resolve-via-attached

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.

resolve-via-host

Sets a constraint on recursive route resolution via host. The next hop is known, but the interface is not.

Tip

Multiple modifiers may be used together, but when doing so, weight and priority must be set first.

Example

IPv4 example:

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

IPv6 Example:

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.