Tip
This is the documentation for the 23.06 version. Looking for the documentation of the latest version? Have a look here.
Host Interface Static Routes¶
Static routes for host interfaces are managed separately from routes in the dataplane.
Note
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.
Note
TNSR automatically imports host OS route configuration settings from the installer or cloud deployment mechanisms, such as a default route for a static address. This allows TNSR to manage these pre-defined host routes.
Administrators can still manage host OS routes manually. To prevent TNSR from importing or altering manual host OS network settings, the settings must not be placed in common filenames used by the installer or cloud provider deployment mechanisms.
See also
Example¶
This example adds a static default route on the host interface enp2s0f1
using a gateway of 198.51.100.1
:
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.
Start Configuration¶
First, issue the command to configure host routes from config
mode:
- host route table default:
Configure routes for the default host route table, which is currently the only supported table, and enter
config-host-route-table
mode.
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
config-host-route
mode.- <host-if>:
The host interface upon which this host route will be placed.
Host Route¶
config-host-route
mode contains the following commands:
- route <to-prefix>:
Specify the destination of the route and enter
config-host-route-ip4
orconfig-host-route-ip6
mode depending on the address family of<to-prefix>
.- <to-prefix>:
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 config-host-route-ip4
or config-host-route-ip6
mode
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[46]-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.
- on-link:
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|prohibit|throw|unreachable):
Sets the type of route this entry will be in the table.
- via <gateway-ipv[46]-address>:
The gateway (next hop) through which the host OS will send packets for this destination.
Viewing Host Routes¶
The show host route
command displays the current contents of the host route
table.
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
The show host route
command supports the following optional parameters:
- <interface>:
Display routes for the specified interface. Output may also be changed with combinations of the other parameters.
- ipv4:
Only display IPv4 routes. Can be combined with
table all
.- ipv6:
Only display IPv6 routes. Can be combined with
table all
.- 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.