Guest

IP Version 6 (IPv6)

Implement Static Routes for IPv6 Configuration Example

Document ID: 113361

Updated: Dec 19, 2011

   Print

Introduction

This document describes how to configure static routes for IPv6. Static routes are manually configured routes that defines explicit path between two devices. In the case of topology change in a network, the static routes are not automatically updated like that of a dynamic protocols and must be manually reconfigured. Static routes are useful for smaller networks that has only one path to the outside networks.

The main disadvantage of the use of static routes is the lack of automatic configuration in case of topology changes. Static routes are also implemented to provide security for a certain types of traffics to other networks that need more control. The limitations that are considered in the use of static routes are the lack of redundancy and in larger networks the manual reconfiguration of routes can become a large administrative overhead.

Use the ipv6 route command in order to configure the static routing. Note that before you configure the router with a static IPv6 route, you must enable the forwarding of IPv6 packets with the ipv6 unicast-routing command in the global configuration mode.

Prerequisites

Ensure that you meet these requirements before you attempt this configuration:

  • Knowledge of IPv4 static routing

  • Knowledge of IPv6 Addressing Scheme

Components Used

The information in this document is based on the Cisco 3700 series router on Cisco IOS® Software Release 12.4 (15)T 13.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Configure

In this section, you are presented with the information to configure the features described in this document.

Note: Use the Command Lookup Tool (registered customers only) to find more information on the commands used in this document.

Network Diagram

This document uses this network setup:

ipv6-static-routes-01.gif

Configurations

This document uses these configurations:

Here is a link to a video, available on Cisco Support Community leavingcisco.com, that demonstrates how to configure static routes for IPv6 network in Cisco IOS routers:

Configuration of Static Routes for IPv6 in Cisco IOS leavingcisco.com

ipv6-static-routes-02.gif

Router R1
version 12.4
!
hostname R1
!
ip cef
!
ipv6 unicast-routing

!--- Enables the forwarding of IPv6 packets.

!
interface Loopback1
 no ip address
 ipv6 address 1010::1/128
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2000::1/126
!
ip forward-protocol nd
!
ipv6 route 2001::/126 2000::2
ipv6 route 2020::1/128 2000::2
ipv6 route 3030::1/128 2000::2

!--- Static routes are configured in router R1, 
!--- to reach the networks in router R2 and R3.
!--- This is done when you specify 
!--- the next-hop address, which in this case is
!--- 2000::2 from which the output interface 
!--- is automatically derived.


!
end

Router R2
version 12.4
!
hostname R2
!
ip cef
!
ipv6 unicast-routing
!
interface Loopback2
 no ip address
 ipv6 address 2020::1/128
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2000::2/126
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 ipv6 address 2001::1/126
!
ip forward-protocol nd
!
ipv6 route 1010::1/128 2000::1
ipv6 route 3030::1/128 2001::2

!--- Static routes are configured to reach
!--- routers R1 and R3 loopback address when you 
!--- specify the corresponding interface address.

!
end

Router R3
version 12.4
!
hostname R3
!
ip cef
!
ipv6 unicast-routing
!
interface Loopback3
 no ip address
 ipv6 address 3030::1/128
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2001::2/126
!
ip forward-protocol nd
!
ipv6 route 1010::1/128 2001::1
ipv6 route 2000::/126 2001::1
ipv6 route 2020::1/128 2001::1

!--- For router 3, to reach R1 and R2, 
!--- static routes are configured when you 
!--- mention 2001::1 as the next-hop address.

!
end

Verify

Use this section to confirm that your configuration works properly.

The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.

Use the show ipv6 route static command in order to display the contents of the IPv6 routing table, and the output is show below:

show ipv6 route static
In router R1
R1#show ipv6 route static
IPv6 Routing Table - 7 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
S   2001::/126 [1/0]
     via 2000::2
S   2020::1/128 [1/0]
     via 2000::2
S   3030::1/128 [1/0]
     via 2000::2

!--- Displays the static routes learnt by router R1 through 2000::2.

In Router R3
R3#show ipv6 route static
IPv6 Routing Table - 7 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
S   1010::1/128 [1/0]
     via 2001::1
S   2000::/126 [1/0]
     via 2001::1
S   2020::1/128 [1/0]
     via 2001::1

!--- Displays the static routes learnt by router R3 through 2001::1.

The router R1 has the routes to router R2 and R3, therefore, router R1 should be able to ping router R2's loopback address and router R3. Use the ping command in order to verify the same.

In router R1
Pinging router R2's loopback address
R1#ping 2020::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2020::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/36/104 ms

!--- Router R1 is successfully able to ping 
!--- router R2's loopback address.

Pinging router R3
R1#ping 2001::2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/40/116 ms

R1#ping 3030::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3030::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/32/84 ms

!--- Similarly R1 is also able to reach R3,
!--- for example, ping to R3's interface address
!--- and loopback address from router R1 is successful.

Note: Similarly the router R3 can also reach the routers R1's Fa0/0 address 2000::1 and its loopback address 1010::1.

Use the show ipv6 static command in order to display the current contents of the routing table and use the detail syntax in order to display more useful information, which is discussed in this example:

show ipv6 static
In router R1
R1#show ipv6 static
IPv6 Static routes
Code: * - installed in RIB
* 2001::/126 via nexthop 2000::2, distance 1
* 2020::1/128 via nexthop 2000::2, distance 1
* 3030::1/128 via nexthop 2000::2, distance 1

!--- Displays the routes that are installed in 
!--- the IPv6 Routing Information Base(RIB) marked with *!

When the detail keyword is specified, additional information are displayed. This is a sample of the output:

show ipv6 static detail
In router R2
R2#show ipv6 static detail
IPv6 Static routes
Code: * - installed in RIB
* 1010::1/128 via nexthop 2000::1, distance 1
     Resolves to 1 paths (max depth 1)

!--- Displays the output path set, and maximum 
!--- resolution depth, which in this case is 1.

     via FastEthernet0/0
* 3030::1/128 via nexthop 2001::2, distance 1
     Resolves to 1 paths (max depth 1)
     via FastEthernet0/1

!--- Displays that the route is received through 
!--- the next-hop 2000::1 through interface fa0/0.

Note: In case of invalid routes, this information is displayed:

  • For invalid recursive routes, the reason why the route is not valid.

  • For invalid direct or fully specified routes, the reason why the route is not valid.

Related Information

Updated: Dec 19, 2011
Document ID: 113361