IOS XR Basic Lab
IOS XR Basic Lab
Examples 1
Network Diagram
CDP
XR
conf t
cdp
interface GigabitEthernet0/0/0/0
cdp
-------------------------
Device ID: R1
SysName :
Entry address(es):
IPv4 address: 172.16.0.1
1
Platform: Cisco 3725, Capabilities: Router Switch IGMP
Interface: GigabitEthernet0/0/0/0
Port ID (outgoing port): FastEthernet0/0
Holdtime : 165 sec
Version :
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version
12.4(15)T10, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2009 by Cisco Systems, Inc.
Compiled Mon 14-Sep-09 15:53 by prod_rel_team
advertisement version: 2
Duplex: half
OSPFv2
We will start by configuring loopback0 interfaces on both devices and advertise these
networks in area 0
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.255
router ospf 1
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 0
network 172.16.0.1 0.0.0.0 area 0
XR
RP/0/0/CPU0:XR1interface loopback 0
RP/0/0/CPU0:XR1(config-if)#ipv4 address 2.2.2.2/32
router ospf 1
router-id 2.2.2.2
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
2
O 2.2.2.2 [110/11] via 172.16.0.2, 00:31:22, FastEthernet0/0
3
172.16.0.1 1.1.1.1 37 0x80000002 0x0076f4
* Indicates MADJ interface, (P) Indicates fast detect hold down state
4
Next 0(0)/0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 3
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 1.1.1.1 (Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Let us change the network type for the interfaces running OSPF
R1
int f0/0
ip ospf network point-to-point
RP/0/0/CPU0:XR1(config)#router ospf 1
RP/0/0/CPU0:XR1(config-ospf)#area 0
RP/0/0/CPU0:XR1(config-ospf-ar)#interface gigabitEthernet 0/0/0/0
RP/0/0/CPU0:XR1(config-ospf-ar-if)#network point-to-point
RP/0/0/CPU0:XR1(config-ospf-ar-if)#commit
5
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/ - 00:00:33 172.16.0.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:00:30
R1(config)#int f0/0
R1(config-if)#ip ospf cost 20
RP/0/0/CPU0:XR1(config)#router ospf 1
RP/0/0/CPU0:XR1(config-ospf)#area 0
RP/0/0/CPU0:XR1(config-ospf-ar)#interface gigabitEthernet 0/0/0/0
RP/0/0/CPU0:XR1(config-ospf-ar-if)#cost 20
RP/0/0/CPU0:XR1(config-ospf-ar-if)#commit
Tue Apr 22 14:33:50.254 UTC
R1(config)#int f0/0
R1(config-if)#ip ospf authentication
R1(config-if)#ip ospf authentication-key cisco
RP/0/0/CPU0:XR1(config)#router ospf 1
RP/0/0/CPU0:XR1(config-ospf)#area 0
RP/0/0/CPU0:XR1(config-ospf-ar)#interface gigabitEthernet 0/0/0/0
RP/0/0/CPU0:XR1(config-ospf-ar-if)#authentication
RP/0/0/CPU0:XR1(config-ospf-ar-if)#authentication-key cisco
RP/0/0/CPU0:XR1(config-ospf-ar-if)#commit
6
Clear text authentication enabled
R1(config)#int f0/0
R1(config-if)#ip ospf authentication message-digest
R1(config-if)#ip ospf message-digest-key 1 md5 cisco
RP/0/0/CPU0:XR1(config)#router ospf 1
RP/0/0/CPU0:XR1(config-ospf)#area 0
RP/0/0/CPU0:XR1(config-ospf-ar)#interface gigabitEthernet 0/0/0/0
RP/0/0/CPU0:XR1(config-ospf-ar-if)#authentication message-digest
RP/0/0/CPU0:XR1(config-ospf-ar-if)#message-digest-key 1 md5 cisco
RP/0/0/CPU0:XR1(config-ospf-ar-if)#commit
Tue Apr 22 14:41:27.962 UTC
IPv6 Addressing
R1(config)#int f0/0
R1(config-if)#ipv6 address 2001:172:16::1/64
R1(config-if)#int lo0
R1(config-if)#ipv6 address 2001::1/128
RP/0/0/CPU0:XR1(config)#int g0/0/0/0
RP/0/0/CPU0:XR1(config-if)#ipv6 address 2001:172:16::2/64
RP/0/0/CPU0:XR1(config-if)#int lo0
RP/0/0/CPU0:XR1(config-if)#ipv6 address 2001::2/128
7
RP/0/0/CPU0:XR1(config-if)#commit
R1#ping 2001:172:16::2
8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:172:16::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/14/36 ms
OSPFv3
Let us turn OSPFv3 in order to exchange the loopback 0 networks between the two
devices
R1(config)#ipv6 unicast-routing
R1(config)#ipv6 router ospf 1
R1(config-rtr)#router-id 1.1.1.1
R1(config-rtr)#int lo0
R1(config-if)#ipv6 ospf 1 area 0
R1(config-if)#int f0/0
R1(config-if)#ipv6 ospf 1 area 0
9
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
O 2001::2/128 [110/10]
via FE80::A00:27FF:FE1F:7011, FastEthernet0/0
As we can see from the outputs above, R1 is the DR for our shared segment
Let us increase the priority from XR side so that it will take the DR role
10
RP/0/0/CPU0:XR1(config)#router ospfv3 OSPFv3_PROCESS
RP/0/0/CPU0:XR1(config-ospfv3)#area 0
RP/0/0/CPU0:XR1(config-ospfv3-ar)#interface gigabitEthernet 0/0/0/0
RP/0/0/CPU0:XR1(config-ospfv3-ar-if)#priority 10
RP/0/0/CPU0:XR1(config-ospfv3-ar-if)#commit
EIGRP
Ok, let us move now to another routing protocol; let us choose EIGRP AS 1
R1(config)#router eigrp 1
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.0.1 0.0.0.0
R1(config-router)#network 1.1.1.1 0.0.0.0
11
R1#sh ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.16.0.2 Fa0/0 14 00:00:42 31 200 0 3
EIGRP6
12
R1(config-rtr)#int lo0
R1(config-if)#ipv6 eigrp 1
R1(config-if)#int f0/0
R1(config-if)#ipv6 eigrp 1
13
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 Link Local Address: Gi0/0/0/0 12 00:00:51 1602 5000 0 3
fe80::c000:aff:fe84:0
D 2001::1/128
[90/2570240] via fe80::c000:aff:fe84:0, 00:00:53, GigabitEthernet0/0/0/0
Let us change the metric EIGRP lies on (by default K1=K3=1 which means that only
bandwidth and delay will be considered from the composite metric)
R1(config)#router eigrp 1
R1(config-router)#metric weights 0 0 0 1 0 0
BGP IPv4
R1(config)#router bgp 1
R1(config-router)#no bgp default ipv4-unicast
R1(config-router)#neighbor 172.16.0.2 remote-as 2
R1(config-router)#address-family ipv4
R1(config-router-af)#neighbor 172.16.0.2 activate
R1(config-router-af)#network 1.1.1.1 mask 255.255.255.255
14
RP/0/0/CPU0:XR1(config)#router bgp 2
RP/0/0/CPU0:XR1(config-bgp)#address-family ipv4 unicast
RP/0/0/CPU0:XR1(config-bgp-af)#network 2.2.2.2/32
RP/0/0/CPU0:XR1(config-bgp-af)#exit
RP/0/0/CPU0:XR1(config-bgp)#neighbor 172.16.0.1
RP/0/0/CPU0:XR1(config-bgp-nbr)#remote-as 1
RP/0/0/CPU0:XR1(config-bgp-nbr)#address-family ipv4 unicast
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#commit
R1#sh ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
15
Some configured eBGP neighbors (under default or non-default vrfs)
do not have both inbound and outbound policies configured for IPv4 Unicast
address family. These neighbors will default to sending and/or
receiving no routes and are marked with '!' in the output below.
Use the 'show bgp neighbor <nbr_address>' command for details.
As we can see from the IOS side we are advertising the prefix (loopback 0 network)
But nothing from the IOS XR side is advertised (in the previous output we can see the
2.2.2.2 prefix is already in the BGP table)
The reason behind this is that the IOS XR will not advertise or receive any route from
external BGP peer unless specified by route-policy, let us configure one
16
RP/0/0/CPU0:XR1#sh run router bgp
Tue Apr 22 17:05:10.072 UTC
router bgp 2
address-family ipv4 unicast
network 2.2.2.2/32
!
neighbor 172.16.0.1
remote-as 1
address-family ipv4 unicast
RP/0/0/CPU0:XR1(config)#route-policy PASS
RP/0/0/CPU0:XR1(config-rpl)#pass
RP/0/0/CPU0:XR1(config)#router bgp 2
RP/0/0/CPU0:XR1(config-bgp)# neighbor 172.16.0.1
RP/0/0/CPU0:XR1(config-bgp-nbr)#address-family ipv4 unicast
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#route-policy PASS in
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#route-policy PASS out
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#commit
R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
17
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 172.16.0.1 0 01i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
BGP IPv6
R1(config)#router bgp 1
R1(config-router)#neighbor 2001:172:16::2 remote-as 2
R1(config-router)#address-family ipv6
R1(config-router-af)#neighbor 2001:172:16::2 activate
R1(config-router-af)#network 2001::1/128
RP/0/0/CPU0:XR1(config)#router bgp 2
RP/0/0/CPU0:XR1(config-bgp)#address-family ipv6 unicast
RP/0/0/CPU0:XR1(config-bgp-af)#network 2001::2/128
RP/0/0/CPU0:XR1(config-bgp-af)#exit
RP/0/0/CPU0:XR1(config-bgp)#neighbor 2001:172:16::1
RP/0/0/CPU0:XR1(config-bgp-nbr)#remote-as 1
RP/0/0/CPU0:XR1(config-bgp-nbr)#address-family ipv6 unicast
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#commit
R1#
*Mar 1 04:25:26.478: %BGP-5-ADJCHANGE: neighbor 2001:172:16::2 Up
18
Tue Apr 22 17:42:33.038 UTC
BGP router identifier 2.2.2.2, local AS number 2
BGP generic scan interval 60 secs
BGP table state: Active
Table ID: 0xe0800000 RD version: 3
BGP main routing table version 3
BGP scan interval 60 secs
The same route-policy concept applies here, we already configured a route-policy, and
we need only to apply
RP/0/0/CPU0:XR1(config)#router bgp 2
RP/0/0/CPU0:XR1(config-bgp)#neighbor 2001:172:16::1
RP/0/0/CPU0:XR1(config-bgp-nbr)#address-family ipv6 unicast
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#route-policy PASS in
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#route-policy PASS out
RP/0/0/CPU0:XR1(config-bgp-nbr-af)#commit
19
Network Next Hop Metric LocPrf Weight Path
*> 2001::1/128 2001:172:16::1 0 01i
*> 2001::2/128 :: 0 32768 i
20