Programme basic routes into the Linux kernel to allow applications to send or receive traffic using the IOS XR network stack.
The basic routes required to allow applications to send or receive traffic can be programmed into the kernel. The Linux network stack that is part of the kernel is used by normal Linux applications to send/receive packets. In an IOS XR stack, IOS XR acts as the network stack for the system. Therefore to allow the Linux network stack to connect into and use the IOS XR network stack, basic routes must be programmed into the Linux Kernel.
Follow these steps to programme routes in the kernel.
Procedure
|
1. |
View the routes from the bash shell.
-
Enter the bash shell.
Example:
RP/0/RP0/CPU0:NE_173#bash
Tue Oct 28 18:17:47.331 IST
-
In the bash shell, view the IP routes used by the to_xr interfaces.
Example:
[ios:~]$ ip route
default dev to_xr proto static scope link src 10.127.60.173 metric 2048 mtu 1500 advmss 1460
10.127.59.46 via 10.127.60.1 dev Mg0_RP0_CPU0_0 proto static metric 2048
10.127.60.0/24 dev Mg0_RP0_CPU0_0 proto static scope link src 10.127.60.173
|
|
2. |
Programme the routes in the kernel.
Two types of routes can be programmed in the kernel:
-
Default Route: The default route sends traffic destined to unknown subnets out of the kernel using a special to_xr interface. This interface sends packets to IOS XR for routing using the routing state in XR RIB (Routing Information Base) or FIB (Forwarding Information Base). The to_xr interface does not have an associated IP address. In Linux, most applications expect the outgoing packets to use the IP address of the outgoing interface as the source IP address. With the to_xr interface, because there is no IP address, a source hint is required. The source hint can be changed to use the IP address another physical interface IP or loopback IP address. In this example, the source hint is set to 10.127.60.173, which is the IP address of the management interface. To use the Management port IP address, change the source hint: RP/0/RP0/CPU0:ios#configure
RP/0/RP0/CPU0:ios(config)#linux networking
RP/0/RP0/CPU0:ios(config-lnx-net)#vrf default
RP/0/RP0/CPU0:ios(config-lnx-vrf)#address-family ipv4
RP/0/RP0/CPU0:ios(config-lnx-af)# default-route software-forwarding
RP/0/RP0/CPU0:ios(config-lnx-af)# source-hint management-route interface MgmtEth0/RP0/CPU0/0
RP/0/RP0/CPU0:ios(config-lnx-af)# source-hint default-route interface MgmtEth0/RP0/CPU0/0
RP/0/RP0/CPU0:ios(config-lnx-af)#commit
RP/0/RP0/CPU0:ios(config-lnx-af)# This output shows the configurations for Linux network. RP/0/RP0/CPU0:ios#show running-config linux networking
linux networking
vrf default
address-family ipv4
default-route software-forwarding
source-hint management-route interface MgmtEth0/RP0/CPU0/0
source-hint default-route interface MgmtEth0/RP0/CPU0/0
!
!
!
!
! With this updated source hint, any default traffic exiting the system uses the Management port IP address as the source IP address.
-
Local or Connected Routes: The routes are associated with the subnet configured on interfaces. For example, the 10.127.60.173 network is associated with the Mg0_RP0_CPU0 interface.
|