Static routes¶
Standard routing¶
Once the IP addresses have been configured, communication is possible between the nodes (hosts or routers) directly connected to the same IP sub-network. It is a one hop communication. To communicate with other nodes that are connected to a different sub-network, a dedicated node, the router, requires routes. For example, you can define static IP routes to link sub-networks.
Static routes do not scale and are not error-free. They should be used only when dynamic routing protocols cannot be deployed, or in case of very simple topologies.
You can implement static routing by directly manipulating the equipment routing table. It may be used with any dynamic routing protocol. When both static and dynamic routes are set, the static ones are preferred because their administrative distance is 1.
To add a static route, do:
vsr running config# / vrf main interface physical eth2 port pci-b0s5
vsr running config# / vrf main interface physical eth2 ipv4 address 10.125.0.1/24
vsr running config# / vrf main routing static ipv4-route 10.200.0.0/24 next-hop 10.125.0.2
To display the static routes state:
vsr> show state vrf main routing static
static
ipv4-route 10.200.0.0/24
next-hop 10.125.0.2
..
..
To check the route is present in the system Routing Information Base:
vsr> show state vrf main routing rib
rib
ipv4-count
connected routes 1 installed-routes 1
static routes 1 installed-routes 1
total routes 2 installed-routes 2
..
ipv6-count
connected routes 1 installed-routes 1
total routes 1 installed-routes 1
..
ipv4-route 10.125.0.0/24
next-hop eth2
protocol connected
interface eth2
selected true
fib true
directly-connected true
active true
uptime 00:00:01
..
..
ipv4-route 10.200.0.0/24
next-hop 10.125.0.2
protocol static
distance 1
interface eth2
selected true
fib true
active true
uptime 00:00:00
..
..
ipv6-route fe80::/64
next-hop fptun0
protocol connected
interface fptun0
selected true
fib true
directly-connected true
active true
uptime 00:03:18
..
..
..
To show the state in a human readable way:
vsr> show ipv4-routes vrf main
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, N - NHRP, T - Table
> - selected route, * - FIB route, r - rejected, b - backup
L3VRF default:
C>* 10.125.0.0/24 is directly connected, eth2, 00:00:02
S>* 10.200.0.0/24 [1/0] via 10.125.0.2, eth2, weight 1, 00:00:01
2 routes displayed.
The same configuration can be made using this NETCONF XML configuration:
vsr> show config xml absolute vrf main routing static
<config xmlns="urn:6wind:vrouter">
<vrf>
<name>main</name>
<routing xmlns="urn:6wind:vrouter/routing">
<static>
<ipv4-route>
<destination>10.200.0.0/24</destination>
<next-hop>
<next-hop>10.125.0.2</next-hop>
</next-hop>
</ipv4-route>
</static>
</routing>
</vrf>
</config>
See also
The command-reference for details.
Policy-Based Routing¶
Virtual Service Router supports multiple routing tables. By default, routes are set in the main table as explained above. For PBR, it is possible to specify the table to use using an identifier. See the Policy-Based Routing section for details.
To add a static route in a specific table, do:
vsr running config# / vrf main interface physical eth3 port pci-b0s6
vsr running config# / vrf main interface physical eth3 ipv4 address 10.175.0.1/24
vsr running config# / vrf main routing static table 100 ipv4-route 10.200.0.0/24 next-hop 10.175.0.2
To show the state for a specific table:
vsr> show ipv4-routes vrf main table 100
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, N - NHRP, T - Table
> - selected route, * - FIB route, r - rejected, b - backup
L3VRF default:
S>* 10.200.0.0/24 [1/0] via 10.175.0.2, eth3, weight 1, 00:00:00
1 routes displayed.
The matching NETCONF XML is as follows:
vsr> show config xml absolute vrf main routing static
<config xmlns="urn:6wind:vrouter">
<vrf>
<name>main</name>
<routing xmlns="urn:6wind:vrouter/routing">
<static>
<table>
<table-id>100</table-id>
<ipv4-route>
<destination>10.200.0.0/24</destination>
<next-hop>
<next-hop>10.175.0.2</next-hop>
</next-hop>
</ipv4-route>
</table>
</static>
</routing>
</vrf>
</config>
BFD With Static Routes¶
It is possible to enable a failover mechanism that relies on nexthops configured in static routes. By monitoring with BFD that nexthop, the route will be either validated or invalidated, according to BFD status. This mechanism enforces the reachability. To get more information on BFD, please see BFD.
Below example illustrates how a BFD peer session context is created, associated
to next-hop 10.125.0.2
.
vsr running config# / vrf customer1 routing static ipv4-route 10.200.0.0/24 next-hop 10.125.0.2 track bfd
Then you can continue the configuration as usual. For timer settings, the default emission and reception settings are set to 300000 microseconds, which may not be what is wished. In that case, it is possible to override default timers, by configuring general timer settings. More information is given in Configuring general BFD settings.
BFD Configuration And Monitoring In Static Routing Using Trackers¶
It’s also possible to configure a BFD or ICMP tracker manually. This enables using the same tracker in different services. An example is available in the BGP configuration and monitoring using trackers documentation.
More information about tracker can be found in Tracker guide.