Managing Routes

Routes are entered into TNSR using the route (ipv4|ipv6) table <name> command in configuration mode. When using the route command for this purpose, the address family and 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.

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. 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. This is the most commonly used form for routes. 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.

Route modifiers

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

preference

Sets the administrative distance preference. Helps to choose between multiple possible destinations when routing protocols are used. This is only a local value, and a lower value is taken as being more reliable (closer).

weight

The weight of routes to the same destination. Acts as a ratio of packets to deliver to each next hop.

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 preference must be set first.

Example

IPv4 example:

tnsr(config)# route ipv4 table ipv4-VRF:0
tnsr(config-route-table-v4)# route 10.2.10.0/24
tnsr(config-rttbl4-next-hop)# next-hop 0 via 10.2.0.2 GigabitEthernet0/14/2

IPv6 Example:

tnsr(config)# route ipv6 table ipv6-VRF:0
tnsr(config-route-table-v6)# route fc07:b337:c4f3::/48
tnsr(config-rttbl6-next-hop)# next-hop 0 via 2001:db8:1::2 GigabitEthernet0/14/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.

Note

When entering a next hop for a route in this way, both the IP address of the destination router and the interface must be given.

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.