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.”
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.
Step | Command |
---|---|
Create a static route to R2. |
|
Commit the configuration. |
|
View the configuration. |
|
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.
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.
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.
Step | Command |
---|---|
Display the state of IPv6 forwarding on R1. |
|
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.
Step | Command |
---|---|
Enable forwarding on R1. |
|
Commit the change. |
|
Change to operational mode. |
|
Display the state of IPv6 forwarding on R1. |
|
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.
Step | Command |
---|---|
Add the default route on R4. |
|
Commit the change. |
|
Change to operational mode. |
|
Verify the default route in the routing table. |
|
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.
Step | Command |
---|---|
Add a static route on R2. |
|
Commit the change. |
|
Change to operational mode. |
|
Verify the static route in the routing table. |
|
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.
Step | Command |
---|---|
Ping R4 from R2. |
|
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.
Step | Command |
---|---|
Trace the route from R2 to R4. |
|