Application Hosting Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

Application Hosting Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

Programme routes in the kernel

Want to summarize with AI?

Log in

Programme default and connected routes into the Linux kernel to allow Linux applications to send and receive traffic through the IOS XR network stack using the to_xr interface.


Use this procedure to configure the Linux kernel routing table so that Linux applications can communicate over the IOS XR network stack. Because IOS XR acts as the network stack for the system, the Linux kernel needs basic routes to connect into and use the IOS XR network stack.

Two types of routes can be programmed in the kernel:

  • Default route: Sends traffic destined to unknown subnets out of the kernel through the to_xr interface to IOS XR for routing. Because to_xr has no associated IP address, a source hint is required to set the source IP address for outgoing packets.

  • Local or connected routes: Routes associated with the subnet configured on interfaces. For example, the 10.1.1.0/24 network is associated with the Hu0_0_0_24 interface.

Procedure

1.

View the current routes from the bash shell.

Example:

[ios:~]$ip route
default dev to_xr scope link src 10.1.1.10 metric 2048
10.1.1.0/24 dev Hu0_0_0_24 proto kernel scope link src 10.1.1.10
192.168.122.0/24 dev Mg0_RP0_CPU0_0 proto kernel scope link src 192.168.122.22
2.

Update the source hint for the default route to use the management port IP address.

Example:

Router#bash

[ios:~]$ip route replace default dev to_xr scope link src 192.168.122.22 metric 2048

[ios:~]$ip route
default dev to_xr scope link src 192.168.122.22 metric 2048
10.1.1.0/24 dev Hu0_0_0_24 proto kernel scope link src 10.1.1.10
192.168.122.0/24 dev Mg0_RP0_CPU0_0 proto kernel scope link src 192.168.122.22

With this updated source hint, any default traffic exiting the system uses the management port IP address as the source IP address.

The Linux kernel routing table is updated with a default route through to_xr and connected routes for each configured interface, enabling Linux applications to send and receive traffic through the IOS XR network stack.