Host Interface Static Routes¶
Static routes for host interfaces are managed separately from routes in the dataplane.
If a host interface is configured via DHCP, it may obtain a default route for the host namespace automatically. In this case, it may not be necessary to configure any additional host routes.
This example adds a static default route on the host interface
using a gateway of
tnsr(config)# host route table default tnsr(config-host-route-table)# description Host OS Management Routes tnsr(config-host-route-table)# interface enp2s0f1 tnsr(config-host-route)# route 0.0.0.0/0 tnsr(config-host-route-ip4)# via 198.51.100.1 tnsr(config-host-route-ip4)# end tnsr#
Host Route Configuration¶
To reach the configuration mode where route details are added takes a few steps as demonstrated in the previous example.
First, issue the command to configure host routes from
- host route table default
Configure routes for the default host route table, which is currently the only supported table, and enter
Host Route Table¶
config-host-route-table mode contains the following commands:
- description <text>
An optional description of this route table.
- interface <host-if>
Specify the interface upon which this route will be placed and enter
The host interface upon which this host route will be placed.
config-host-route mode contains the following commands:
- route <to-prefix>
Specify the destination of the route and enter
config-host-route-ip6mode depending on the address family of
An IPv4 or IPv6 prefix to which packets will be routed. Later commands must use addresses of the same family as this prefix, either IPv4 or IPv6.
IPv4/IPv6 Host Route¶
The configuration in
is the same, the only difference is the address family of prefixes and addresses
allowed in the commands. The following commands are available in these modes:
- advertised-receive-window <1..max>
Advertised receive window for packets matching this route.
- congestion-window <1..max>
Congestion window for packets matching this route.
- description <text>
Optional text describing this static host route.
- from <ipv-addr>
Source address on the host interface to use for packets from the host itself to the destination of this route.
- metric <1..max>
Relative route priority.
- mtu <1..max>
Maximum transmission unit for packets along this route.
Flag specifying if the network is directly attached to the interface. If this is present, the host will attempt to locate destination hosts via ARP.
- scope (global|link|host)
The range of the route.
- table <1..max>
Table ID in which to place the route.
- type (unicast|anycast|blackhole|broadcast|local|multicast|nat|prohibit|throw|unreachable|xresolve)
Sets the type of route this entry will be in the table.
- via <gateway-ipv-address>
The gateway (next hop) through which the host OS will send packets for this destination.
Viewing Host Routes¶
show host route command displays the current contents of the host route
tnsr(config)# show host route Interface: enp2s0f1 ------------------------------ dst 0.0.0.0/0, protocol static, metric 0, scope universe, table 254, type unicast, via 198.51.100.1, weight 0 dst 198.51.100.0/24, protocol kernel, metric 100, scope link, table 254, type unicast, via 0.0.0.0, weight 0 dst 198.51.100.1/32, metric 100, scope link, table 254, type unicast, via 0.0.0.0, weight 0 dst 2001:db8::/64, metric 100, scope universe, table 254, type unicast, via ::, weight 0 dst ::/0, metric 100, scope universe, table 254, type unicast, via fe80::208:a2ff:fe12:169e, weight 0 dst fe80::/64, protocol kernel, metric 256, scope universe, table 254, type unicast, via ::, weight 0 Interface: lo ------------------------------ dst ::1/128, protocol kernel, metric 256, scope universe, table 254, type unicast, via ::, weight 0
show host route command supports the following optional parameters:
Display routes for the specified interface. Output may also be changed with combinations of the other parameters.
Only display IPv4 routes. Can be combined with
Only display IPv6 routes. Can be combined with
- table all
Display routes from all tables instead of limiting output to the default table. In most cases this means it will also display broadcast and other similar system routes.