Introduction:
In this document we will see Comparision of basic Static route Configuartion between cisco IOS and IOS XR.
Configuration Example:
In this example we have R1 running Cisco IOS and PE1 IOS XR.
In IOS XR static route is configure under router subsection called "router static”. Static route can point to a next-hop interface, next-hop IP address, or both. In this example we have pointed to both next-hop IP address as well to interface.
R1PE1
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)# *May 6 16:12:52.187: %SYS-5-CONFIG_I: Configured from console by console R1(config)#ip route 1.1.1.1 255.255.255.255 fa0/0 10.1.1.1
R1(config)#do wr Building configuration... [OK] R1(config)# | RP/0/0/CPU0:PE1#conf t Mon May 6 10:42:14.853 UTC RP/0/0/CPU0:PE1(config)#router static RP/0/0/CPU0:PE1(config-static)#address-family ipv4 unicast RP/0/0/CPU0:PE1(config-static-afi)#1.1.1.1/32 gig0/0/0/1 10.1.1.1 RP/0/0/CPU0:PE1(config-static-afi)#commit Mon May 6 10:42:39.561 UTC RP/0/0/CPU0:PE1(config-static-afi)# |
You can also use floating route as well enable permant option to static route as shown below:
R1PE1
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 1.1.1.1 255.255.255.255 fa0/0 10.1.1.1 permanent 200 R1(config)#end R1#wr Building configuration... [OK] R1# | RP/0/0/CPU0:PE1#conf t Mon May 6 10:42:14.853 UTC RP/0/0/CPU0:PE1(config)#router static RP/0/0/CPU0:PE1(config-static)#address-family ipv4 unicast RP/0/0/CPU0:PE1(config-static-afi)#1.1.1.1/32 gig0/0/0/1 10.1.1.1 permanent 200 RP/0/0/CPU0:PE1(config-static-afi)#commit Mon May 6 10:42:39.561 UTC RP/0/0/CPU0:PE1(config-static-afi)# |
To configure IPv6 static route you just need to change address-family as show below:
IPv6 static route:
R1PE1
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ipv6 route 2001:1:1:1::/64 fa0/0 fe80::2 R1(config)#end R1#wr Building configuration... [OK] R1# | RP/0/0/CPU0:PE1#conf t Mon May 6 12:38:55.043 UTC RP/0/0/CPU0:PE1(config)#router static RP/0/0/CPU0:PE1(config-static)#address-family ipv6 unicast RP/0/0/CPU0:PE1(config-static-afi)#2001:1:1:1::/64 gig0/0/0/1 fe80::1 RP/0/0/CPU0:PE1(config-static-afi)#commit Mon May 6 12:39:31.311 UTC RP/0/0/CPU0:PE1(config-static-afi)# |
You can also specify Static route for VRF instance. The VRF can be the default VRF or a specified VRF. Specifying a VRF, using the vrf vrf-name command, allow you to enter VRF configuration mode for a specific VRF where you can configure a static route. If a VRF is not specified, a default VRF static route is configured.
R1
PE1
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route vrf Cust_A 1.1.1.1 255.255.255.255 10.1.1.2 R1(config)#do wr Building configuration... [OK] R1(config)#end R1# | RP/0/0/CPU0:PE1#conf t Sun May 5 16:22:45.272 UTC RP/0/0/CPU0:PE1(config)#router static vrf Cust_A RP/0/0/CPU0:PE1(config-static-vrf)#address-family ipv4 unicast RP/0/0/CPU0:PE1(config-static-vrf-afi)#1.1.1.1 255.255.255.255 10.1.1.2 RP/0/0/CPU0:PE1(config-static-vrf-afi)#commit Sun May 5 16:23:29.529 UTC RP/0/0/CPU0:PE1(config-static-vrf-afi)#end RP/0/0/CPU0:PE1# |
Verification:
You can verify your static route configuration there is only single command you can use to verify IPv4/IPv6 and specific VRF route as shown below.
R1
PE1
R1#sh ip route static R1#sh ip route vrf Cust_A static R1#sh ipv6 route static | P/0/0/CPU0:PE1#sh running-config router static Mon May 6 13:10:22.244 UTC router static address-family ipv4 unicast 1.1.1.1/32 10.1.1.2 1.1.1.1/32 GigabitEthernet0/0/0/1 10.1.1.1 200 permanent ! address-family ipv6 unicast 2001:1:1:1::/64 GigabitEthernet0/0/0/1 fe80::1 ! vrf Cust_A address-family ipv4 unicast 1.1.1.1/32 GigabitEthernet0/0/0/2 ! ! ! RP/0/0/CPU0:PE1# |
Related Information:
Implementing Static Routes on Cisco IOS XR Software