home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

Show Page Sections

Static routes

This section contains an overview of static routes and route configuration.

Static routes overview

An overview of static routes and their use cause.

A static route is a manually configured route, which, in general, cannot be updated dynamically from information about the network topology learned by the vRouter. However, if a link fails, the router removes the routes, including static routes, from the Routing Information Base (RIB) that use this interface to reach the next hop.

Usually, static routes should be used only for very simple network topologies, or to override the behavior of a dynamic routing protocol for a small number of routes.

The collection of all routes the router learns from its configuration, or from its dynamic routing protocols, is stored in its RIB.

Unicast routes are directly used to determine the forwarding table for unicast packet forwarding.

Blackhole routes are static unreachable routes that can be configured to send ICMP unreachable responses on packets.

Configuring static routes

Examples of static routes and their related commands.

Static routes presents sample configurations of basic static routes. When you are finished with Configuring static routes, the system is configured as shown in the figure. In the example, a static route is created that says, in effect, “any packets destined for the 11.0.0.0/8 network should be forwarded to 172.16.0.26.”

Figure 1. Static routes

This section includes the following example:

Configuring static routes shows how to create a static route to the 11.0.0.0/8 network that is directed toward 172.16.0.26.

To create a static route, perform the following steps in configuration mode.

Table 1. Creating a static route

Step

Command

Create a static route to R2.

vyatta@R1# set protocols static route 11.0.0.0/8 next-hop 172.16.0.26

Commit the configuration.

vyatta@R1# commit

View the configuration.

vyatta@R1# show protocols static route
 route 11.0.0.0/8 {
	next-hop 172.16.0.26 {
	}
}

Creating floating static routes

A description of floating static routes and how to configure them.

Usually, static routes have a relatively short administrative distance—typically 1, and normally shorter than the administrative distances for dynamic (learned) routes. A “floating” static route is a static route with an administrative distance greater than the administrative distance for dynamic routes.

You can configure a static route to be a floating route by setting the administrative distance higher than the distance applied to the routes in your dynamic routing protocol. This higher distance renders the static route less desirable than a dynamic route. At the same time, if the dynamic route is lost, the static route is available to take over traffic, which can be forwarded through the static route as an alternate path.

Note: When configuring the administrative distance (AD) of a protocol, keep in mind when you specify the distance value of 255, the router will disbelieve the source and will not add the route to the routing table.

Showing static routes in the routing table

How to show static routes in the routing table and the related commands.

To display route information, use the show ip route command. To show just static routes, use the show ip route static command, as shown in the following example.

Showing static routes in the routing table

vyatta@R1:~$ show ip route static
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route
S>* 11.0.0.0/8 [1/0] via 172.16.0.26, dp0p0p0
vyatta@R1:~$

Static IPv6 route configuration

How to configure static IPv6 routes and their related commands.

Static IPv6 routing example shows an IPv6 network with three nodes. Verify that IPv6 forwarding is enabled shows how to configure nodes that use static routes to enable R2 and R4 to communicate through R1.

Figure 2. Static IPv6 routing example

Verify that IPv6 forwarding is enabled

An overview of IPv6 forwarding and the related commands.

For R1 to be able to pass data between the dp0p0p0 and dp0p0p2 interfaces (that is, between R4 and R2), R1 must be configured to enable forwarding. To determine if forwarding is enabled, perform the following step in operational mode.

Table 2. Determining if forwarding is enabled on R1
Step Command

Display the state of IPv6 forwarding on R1.

vyatta@R1:~$ show ipv6 forwarding
ipv6 forwarding is off

If forwarding is not enabled, as in the example below, the system must be configured to enable forwarding. To enable forwarding, perform the following steps in configuration mode.

Table 3. Enable forwarding on R1
Step Command

Enable forwarding on R1.

vyatta@R1:~$ set system ipv6 disable-forwarding

Commit the change.

vyatta@R1# commit

Change to operational mode.

vyatta@R1# exit
exit
vyatta@R1:~$

Display the state of IPv6 forwarding on R1.

vyatta@R1:~$ show ipv6 forwarding
ipv6 forwarding is on

Add the default IPv6 route

How to configure the default IPv6 route and the related commands.

On R4, all traffic that is not routed elsewhere is sent to R1. To configure the default route, perform the following steps in configuration mode.

Table 4. Adding the default route on R4
Step Command

Add the default route on R4.

vyatta@R4# set protocols static route6 ::/0 next-hop 2001:db8:1::1

Commit the change.

vyatta@R4# commit

Change to operational mode.

vyatta@R4# exit
exit
vyatta@R4:~$

Verify the default route in the routing table.

vyatta@R4:~$ show ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,
       I - ISIS, B - BGP, * - FIB route.
S>* ::/0 [1/0] via 2001:db8:1::1, dp0p0p0
C>* ::1/128 is directly connected, lo
C>* 2001:db8:1::/64 is directly connected, dp0p0p0
C * fe80::/64 is directly connected, dp0p0p1
C>* fe80::/64 is directly connected, dp0p0p0
K>* ff00::/8 is directly connected, dp0p0p0

Add a static IPv6 route

As an alternative to the default route created on R4, create a static route on R2. To configure a static route to the 2001:db8:1::/64 network, perform the following steps in configuration mode.

Table 5. Adding a static IPv6 route
Step Command

Add a static route on R2.

vyatta@R1# set protocols static route6 2001:db8:1::/64 next-hop 2001:db8:2::1

Commit the change.

vyatta@R1# commit

Change to operational mode.

vyatta@R1# exit
exit
vyatta@R2:~$

Verify the static route in the routing table.

vyatta@R2:~$ show ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,
       I - ISIS, B - BGP, * - FIB route.
C>* ::1/128 is directly connected, lo
S>* 2001:db8:1::/64 [1/0] via 2001:db8:2::1, dp0p0p0
C>* 2001:db8:2::/64 is directly connected, dp0p0p0
C * fe80::/64 is directly connected, dp0p0p1
C>* fe80::/64 is directly connected, dp0p0p0
K>* ff00::/8 is directly connected, dp0p0p0

Confirm connectivity

How to confirm connectivity between R2 and R4 and the related commands.

To confirm that R2 and R4 can communicate, use the ping command. To confirm connectivity between R2 and R4, perform the following step in operational mode.

Table 6. Confirming connectivity between R2 and R4
Step Command

Ping R4 from R2.

vyatta@R2:~$ ping 2001:db8:1::4
PING 2001:db8:1::4(2001:db8:1::4) 56 data bytes
64 bytes from 2001:db8:1::4: icmp_seq=1 ttl=63 time=5.65 ms
64 bytes from 2001:db8:1::4: icmp_seq=2 ttl=63 time=0.382 ms
^C
--- 2001:db8:1::4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1011ms
rtt min/avg/max/mdev = 0.382/3.016/5.650/2.634 ms

As an alternative, use the traceroute command to verify that the route goes from R2 to R1 to R4. To confirm connectivity between R2 and R4 through R1 by using the traceroute command, perform the following step in operational mode.

Table 7. Confirming connectivity between R2 and R4 through R1
Step Command

Trace the route from R2 to R4.

vyatta@R2:~$ traceroute 2001:db8:1::4
traceroute to 2001:db8:1::4 (2001:db8:1::4), 30 hops max, 40 byte packets
 1   (2001:db8:2::1)  4.448 ms  4.148 ms  4.092 ms
 2   (2001:db8:1::4)  4.297 ms  4.306 ms  4.308 ms