Cisco-IOS-XR-Introduction-Ver-1
Cisco-IOS-XR-Introduction-Ver-1
Jeffrey Fry
© October 2012
FryGuy.Net
Table of Contents
1. Cisco IOS XR Introduction and Comparison to IOS
2. Cisco IOS XR Prompt and Hostname Differences
3. Basic Configuration Options
4. Configuring an Interface - Basic IPv4 and IPv6 address
5. Bundled Interfaces
6. Software Installation and PIE packages
7. Licensing
8. Aliases
9. Wildcard Masks
10.Processes
11.Remote Access Services – Telnet and SSH
12.TACACS Configuration ( default and non-default VRF)
13.Access Lists
14.OSPF
15.EIGRP
16.RIP
17.IS-IS
18.BGP - iBGP and eBGP
19.Route Filtering
20.VRF lite and Dot1Q Trunks
21.Basic MPLS - LDP
22.MPLS VPN
23.L2VPN
24.NHRP (HSRP/VRRP)
CE1 / R3 CE2 / R4
S S
S L S L
L O R L O R
O T O T
2
A= ACT F= FDX Cisco 2811 2
A= ACT F= FDX Cisco 2811
T S= SPEED L= LINK T S= SPEED L= LINK
3 3
FE 0/1 FE 0/0 A FE 0/1 FE 0/0 A
A A
F F F F
S S S S S S
L S L S
L L
O O L L O O L L
T T T T
NME0 1 0 NME0 1 0
PVDM1 PVDM2 AIM1 AIM0 PVDM1 PVDM2 AIM1 AIM0
F0/0 F0/0
1 3 5 7 9 11 13 15 17 19
G0/1/0/11 G0/1/0/11 1 3 5 7 9 11 13 15 17 19
A9K- 2T- 20GE
0 2 4 6 8 10 12 14 16 18 0 2 4 6 8 10 12 14 16 18
G0/0/0/11
1 3 5 7 9 11 13 15 17 19 1 3 5 7 9 11 13 15 17 19
G0/0/0/11
A9K- 2T- 20GE
0 2 4 6 8 10 12 14 16 18 0 2 4 6 8 10 12 14 16 18
E SB E SB
FAIL
FAIL
MAJ
CRIT
MAJ
CRIT
MIN
MIN
A9K-RSP-4G
A9K-RSP-4G
TEST
LAMP
TEST
LAMP
ACO
ACO
ALARM OUT SYNC 1 SYNC 0 AUX CONSOLE MGT LAN 1 MGT LAN 0 ALARM OUT SYNC 1 SYNC 0 AUX CONSOLE MGT LAN 1 MGT LAN 0
2
2
ACO
CF
HDD
SYNC
ACO
CF
HDD
SYNC
1
0
PE1 / R1 PE2 / R2
Cisco 12000
R1
R2
Cisco 12000 SERIES
Cisco 12000 SERIES
0 1 2 3 CSCO CSC1 4 5 6 7
0 1 2 3 CSCO CSC1 4 5 6 7
LINK
LINK
3
AUX
AUX
AUX
AUX
CONSOLE
CONSOLE
LINK
CONSOLE
CONSOLE
5 LINK
LINK
TX RX
COLL LINK
TX RX
COLL
G0/3/0/3 G0/5/0/3 LINK COLL LINK COLL
TX RX TX RX
ROUTE PROCESSOR
8 FAST ETHERNET FX
ROUTE PROCESSOR
ROUTE PROCESSOR
8 FAST ETHERNET FX
LINK
In Cisco IOS XR, the kernel is based on an OS called QNX Neutrino that runs
some very powerful and reliable systems. QNX runs – per their News Release at
http://www.qnx.com/news/pr_1329_3.html - things from EKG machines, to Air
Traffic Control systems, and among other things – automated beer bottle
inspection systems. IOS XR offers modularity and memory protection between
processes, threads and supports preemptive scheduling as well as the ability
to restart a failed process. Protocols like BGP, OSPF, OSPFv3, RIBv4, RIBv6,
etc all run in separate spaces – if one has a fault, it will not impact the
others. Also, an added bonus, if you run multiple routing protocol instances
(like OSPF), each process will run in its own memory space – this is an
important feature of Service Providers – any fault with one customer process
will not impact another.
Another big difference between IOS and IOS XR is the configuration model. IOS
is a single stage model meaning that as soon as you make a change, it is
applied to the active running config. With IOS XR, you have a running
(active) config that you cannot modify directly, all your changes are made in
a staging area first before being committed to the running config. After you
make your changes, you commit them and promote the staging config to the
active config. Before the change is made active, the IOS XR will run a sanity
check on it making sure that the commands are correct to a certain degree, if
there is a problem it will tell you so that you can correct the error
% Failed to commit one or more configuration items. Please use 'show configuration failed' to view the
errors
IOS XR IOS
Config changes do not Configuration changes take
take place immediately place immediately
Let’s look at the standard IOS prompt vs. the IOS XR prompt.
IOS: Router#
IOS-XR: RP/0/7/CPU0:ios#
As you can see the prompt is a bit different. In standard IOS you have the
hostname, but in IOS XR you get a bit more information. It breaks down as
follows:
Prompt Syntax:
Type – type of interface card (Usually RP for Route Processor)
Rack – What Rack number this is installed in in a multishelf
system, typically 0 if standalone
Slot – Slot the RP is installed in (7 in this example)
Module – What execute the user commands or port interface.
Usually CPU0 or CPU1
Name – Hostname of the router, default here is IOS
Ok, now let’s change the hostname on typical IOS so you can see the
difference. Going forward, BLUE text is prompts and router feedback, RED are
commands entered.
Router#
Router#conf t
*Mar 29 16:32:51.507: %SYS-5-CONFIG_I: Configured from console by console
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#
As you can see, in IOS the hostname changed immediately after hitting Enter.
RP/0/7/CPU0:ios(config)#
Pretty cool, the router will show you the changes you are about to make, this
is your staging config changes.
RP/0/7/CPU0:ios(config)#commit
Thu Mar 29 16:03:04.182 UTC
RP/0/7/CPU0:R1(config)#
See, once you entered COMMIT, the hostname change from IOS to R1.
First, what if I am making changes and decide I don’t want them? You have a
few options. First you could just exit all the way out.
RP/0/7/CPU0:R1(config)#exit
Uncommitted changes found, commit them before exiting(yes/no/cancel)?
[cancel]: no
And once you exit out, all your changes are lost.
RP/0/7/CPU0:R1(config-if)#
OK, we have it in the candidate configuration now. We changed our mind about
that – so lets clear it.
RP/0/7/CPU0:R1(config-if)#clear
RP/0/7/CPU0:R1(config)#
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:23:01.154 UTC
RP/0/7/CPU0:R1(config)#int loop 666
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.6/32
RP/0/7/CPU0:R1(config-if)#
Yup, its there. Now we can wait a few seconds (30 or so) and do the show
interface command again.
RP/0/7/CPU0:R1(config-if)#do show int loop666
Sun Apr 1 22:25:09.361 UTC
Interface not found (Loopback666)
RP/0/7/CPU0:R1(config-if)#
All gone!
RP/0/7/CPU0:R1#
Look at that, IOS XR has a commit confirmed – just like someone else does as
well.
You can configure the system in exclusive mode, this way only you can be
making changes and nobody else. To do this, just enter configure exclusive
RP/0/7/CPU0:R1#configure exclusive
You can add comments and notations to your commit that will show up in the
rollback.
RP/0/7/CPU0:R1#conf t
Sun Apr 1 22:32:23.941 UTC
RP/0/7/CPU0:R1(config)#int loop 667
RP/0/7/CPU0:R1(config-if)#ip add 6.6.6.7/32
RP/0/7/CPU0:R1(config-if)#exit
RP/0/7/CPU0:R1(config)#commit comment Created Loopback 667 For Testing
Sun Apr 1 22:33:34.589 UTC
RP/0/7/CPU0:R1(config)#
Now, if a comment has been added, you can see it via the show configuration
history last x detail command
RP/0/7/CPU0:R1#sh configuration history last 1 detail
Sun Apr 1 22:36:04.053 UTC
1) Event: commit Time: Sun Apr 1 22:33:36 2012
Commit ID: 1000000230 Label:
User: user Line: con0_7_CPU0
Client: CLI Comment: Created Loopback 667 For Testing
RP/0/7/CPU0:R1#
Ok, let’s quickly look at loading a configuration from the disk and
overwriting an existing configuration.
This commit will replace or remove the entire running configuration. This
operation can be service affecting.
Do you wish to proceed? [no]: y
RP/0/RSP0/CPU0:ios(config)#
RP/0/RSP0/CPU0:ios(config)#exit
RP/0/RSP0/CPU0:ios(config)#load disk0a:/newconfig.txt
Loading.
204 bytes parsed in 1 sec (203)bytes/sec
The configuration is now loaded into the candidate config. Let us check what
is there and then commit it.
RP/0/RSP0/CPU0:ios(config)#show confi
Wed Oct 17 01:26:17.539 UTC
Building configuration...
!! IOS XR Configuration 4.1.2
hostname R1
domain name lab.cfg
interface Loopback100
ipv4 address 100.100.100.100 255.255.255.255
!
end
RP/0/RSP0/CPU0:ios(config)#commit
Wed Oct 17 01:26:22.174 UTC
RP/0/RSP0/CPU0:R1(config)#
RP/0/RSP0/CPU0:R1#conf t
Wed Oct 17 01:37:23.638 UTC
RP/0/RSP0/CPU0:R1(config)#load disk0a:/ReplaceConfig.txt
Loading.
283 bytes parsed in 1 sec (282)bytes/sec
RP/0/RSP0/CPU0:R1(config)#show config
Wed Oct 17 01:37:38.571 UTC
Building configuration...
!! IOS XR Configuration 4.1.2
hostname Router1
domain name NewLab.CFG
interface Loopback100
ipv4 address 101.101.101.101 255.255.255.255
!
interface TenGigE0/0/0/0
ipv4 address 200.200.200.202 255.255.255.0
!
end
This commit will replace or remove the entire running configuration. This
operation can be service affecting.
Do you wish to proceed? [no]: y
RP/0/RSP0/CPU0:Router1(config)#
What other options to loaf configuration are there? Well, here is a list:
RP/0/RSP0/CPU0:Router1(config)#load ?
WORD Load from file
bootflash: Load from bootflash: file system
commit Load commit changes
compactflash: Load from compactflash: file system
compactflasha: Load from compactflasha: file system
configuration Contents of configuration
diff Load from diff file
disk0: Load from disk0: file system
disk0a: Load from disk0a: file system
disk1: Load from disk1: file system
disk1a: Load from disk1a: file system
ftp: Load from ftp: file system
harddisk: Load from harddisk: file system
harddiska: Load from harddiska: file system
harddiskb: Load from harddiskb: file system
lcdisk0: Load from lcdisk0: file system
lcdisk0a: Load from lcdisk0a: file system
nvram: Load from nvram: file system
rcp: Load from rcp: file system
rollback Load rollback changes
tftp: Load from tftp: file system
RP/0/RSP0/CPU0:Router1(config)#
You can load from the local disk, RCP, TFTP, FTP, etc if you want.
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#sh ip int br
Thu Mar 29 18:12:04.883 UTC
Here you can see that we have an RP in Slot 6 and 7 (Mgmt) and a 4-port Gig
card in Slot 3. For this lab, interfaces G0/3/0/2 and G0/3/0/3 are pre-
cabled to another router and are currently UP/UP right now.
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#conf t
Thu Mar 29 18:38:31.891 UTC
RP/0/7/CPU0:R1(config)#int g0/3/0/2
RP/0/7/CPU0:R1(config-if)#ip add 150.1.12.1/24
Another cool thing with IOS-XR is you can find out where you are any time you
want just by entering PWD
RP/0/7/CPU0:R1(config-if)#pwd
RP/0/7/CPU0:R1#
Let’s add one under our loopback interface as well – well use 2001::1/128
RP/0/7/CPU0:R1#conf t
RP/0/7/CPU0:R1(config)#int l0
RP/0/7/CPU0:R1(config-if)#ipv6 add 2001::1/128
RP/0/7/CPU0:R1(config-if)#commit
Thu Mar 29 19:30:49.920 UTC
RP/0/7/CPU0:R1(config-if)#
And with IOS XR, it is a bit different again. So, for this example we will
configure Ethernet Bundle 200
First on PE2:
RP/0/RSP0/CPU0:PE2#conf t
First up though, let’s reset the interfaces back to factory by using the no
interface command:
RP/0/RSP0/CPU0:PE2(config)#no int g0/0/0/11
RP/0/RSP0/CPU0:PE2(config)#commit
Now let’s take a quick look at our load balancing hash options:
RP/0/RSP0/CPU0:PE2(config-if)#bundle load-balancing hash ?
dst-ip Use the destination IP as the hash function
src-ip Use the source IP as the hash function
Just like port-channels, the bundle ID should match the interface number you
created. But here we will also look at what bundle options we have:
RP/0/RSP0/CPU0:PE2(config-if)#bundle id 200 mode ?
active Run LACP in active mode over the port.
on Do not run LACP over the port.
passive Run LACP in passive mode over the port.
RP/0/RSP0/CPU0:PE2(config)#commit
Fri Apr 27 01:46:44.692 UTC
RP/0/RSP0/CPU0:PE1(config)#commit
Fri Apr 27 01:50:37.705 UTC
RP/0/RSP0/CPU0:PE1(config)#
Bundle-Ether200
Status: Up
Local links <active/standby/configured>: 2 / 0 / 2
Local bandwidth <effective/available>: 2000000 (2000000) kbps
MAC address (source): 6c9c.ed2d.0bab (Chassis pool)
Minimum active links / bandwidth: 1 / 1 kbps
Maximum active links: 2
Wait while timer: 2000 ms
Load balancing:
Link order signaling: Not configured
Hash type: Src-IP
LACP: Operational
Flap suppression timer: Off
Cisco extensions: Disabled
mLACP: Not configured
IPv4 BFD: Not configured
Bundle-Ether200
You can get the main image from CCO Support and Downloads. To navigate to
the download, select:
Products -> Routers -> Service Provider Edge Routers -> ASR 9000 -> ASR 9006
Then select IOS XR Software for the main images or IOS XR Software
Maintenance Upgrades (SMU) for patches for caveats fixes.
Once you select the IOS XR Software, the most recent version of code will be
presented on the screen. Select the version that you need and proceed to
download it. If you get an error that a contract is required, please open a
Cisco TAC case requesting access, they will need the serial number of the
chassis in order to prove support.
Once you have the image on your computer, we will now need to transfer it.
Since the image is over 400 Megs as of 4.1.2, and 4.2.0 is over 700 Megs,
TFTP is probably not going to cut it (most TFTP apps do not support files
over 32 megs). What you might need to do is find an FTP server program to
use - I recommend FileZilla – but that is ultimately up to you. Once you
have your FTP server setup and ready to go, we now need to get the image
copied. For this example, I am using a username of Cisco and a password of
cisco
The file copy will now start and will take some time (you will see
CCCCCCCCCCCCCCCCCCC) – these are large images, so patience is a virtue.
Once the file copy is complete, check the compact flash to make sure the
images transferred successfully.
RP/0/RSP0/CPU0:R2#dir compactflash:
Tue Apr 10 02:01:37.766 UTC
Directory of compactflash:
Now that we have the image, we need to extract the tar file. That is done
from ADMIN mode. You enter admin mode by typing admin at the command promt.
RP/0/RSP0/CPU0:R2#admin
Tue Apr 10 02:03:27.052 UTC
RP/0/RSP0/CPU0:R2(admin)#
Once there, we can install the tar image using the install command:
RP/0/RSP0/CPU0:ios(admin)#install add tar compactflash:ASR9K-iosxr-k9-
4.1.2.tar
Once you enter that command, the system will start to process the file and
show output:
Mon Apr 9 21:29:41.420 UTC
Install operation 1 '(admin) install add tar
/compactflash:ASR9K-iosxr-k9-4.1.2.tar' started by user 'admin' via CLI at
21:29:41 UTC Mon Apr 09 2012.
Info: The following files were extracted from the tar file
Info: '/compactflash:ASR9K-iosxr-k9-4.1.2.tar' and will be added to the
Info: entire router:
Info:
Info: asr9k-mcast-p.pie-4.1.2
Info: asr9k-mpls-p.pie-4.1.2
Info: asr9k-mini-p.pie-4.1.2
Info: asr9k-mini-p.vm-4.1.2 (skipped - not a pie)
Info: asr9k-doc-p.pie-4.1.2
This operation will happen in the background, you will be returned to the
command prompt. Once the process is finished, the similar text will appear
on the prompt:
P/0/RSP0/CPU0:ios(admin)#Info: The following packages are now available
to be activated:
Info:
Info: disk0:asr9k-mcast-p-4.1.2
Info: disk0:asr9k-mpls-p-4.1.2
Info: disk0:asr9k-mini-p-4.1.2
Info: disk0:asr9k-doc-p-4.1.2
Info: disk0:asr9k-video-p-4.1.2
Info: disk0:asr9k-mgbl-p-4.1.2
Info: disk0:asr9k-optic-4.1.2
Info: disk0:asr9k-upgrade-p-4.1.2
Info: disk0:asr9k-k9sec-p-4.1.2
Info:
Info: The packages can be activated across the entire router.
Info:
Install operation 1 completed successfully at 21:38:52 UTC Mon Apr 09 2012.
Now that we have the image there, we need to see what inactive PIEs we have
to install and activate. The command here is show install inactive summary
RP/0/RSP0/CPU0:ios(admin)#sh install inactive summary
Mon Apr 9 21:59:10.354 UTC
Default Profile:
SDRs:
Owner
Inactive Packages:
disk0:asr9k-upgrade-p-4.1.2
disk0:asr9k-optic-4.1.2
disk0:asr9k-doc-p-4.1.2
disk0:asr9k-k9sec-p-4.1.2
disk0:asr9k-video-p-4.1.2
disk0:asr9k-mpls-p-4.1.2
disk0:asr9k-mgbl-p-4.1.2
disk0:asr9k-mcast-p-4.1.2
Ahh, we got an error! The error output tells us that we need to remove the
upgrade package from the disk via the install remove command:
RP/0/RSP0/CPU0:ios(admin)#install remove disk0:asr9k-upgrade-p-4.1.2
Mon Apr 9 22:00:13.538 UTC
Install operation 3 '(admin) install remove disk0:asr9k-upgrade-p-4.1.2'
started by user 'admin' via CLI at 22:00:13 UTC Mon Apr 09 2012.
Info: This operation will remove the following package:
Info: disk0:asr9k-upgrade-p-4.1.2
If you want to see the status of the install, you can use the show install
request command and it will show you the percentage complete.
RP/0/RSP0/CPU0:c20.newthk01(admin)#sh install request
Sat May 12 00:43:54.386 UTC
Install operation 4 '(admin) install activate disk0:asr9k-mpls-p-4.1.2'
started
by user 'neteng' via CLI at 00:42:50 UTC Sat May 12 2012.
The operation is 85% complete
The operation can still be aborted.
RP/0/RSP0/CPU0:c20.newthk01(admin)#
RP/0/RSP0/CPU0:R2(admin)#
When it comes to patches, they are rather easy as well. They pretty much
follow the same process as packages. Copy the file to flash, install the
tar, then activate the patch.
For this example, we will copy the CSCtu30994 -
rn_preorder_key_successor_int function is constantly looping per the readme
file.
First up, lets copy it from the TFTP server to our CompactFlash card:
RP/0/RSP0/CPU0:ASR01#copy tftp: compactflash:
Tue May 15 06:12:19.645 UTC
Address or name of remote host [192.168.1.1]? (enter)
Source filename [/tftp:]?asr9k-p-4.1.2.CSCtu30994.tar
Destination filename [/compactflash:/asr9k-p-4.1.2.CSCtu30994.tar]?
Accessing tftp://10.100.100.17/asr9k-p-4.1.2.CSCtu30994.tar
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
911360 bytes copied in 6 sec ( 134936)bytes/sec
And once the TAR has been added, the following message will appear:
Info: The following package is now available to be activated:
Info:
Info: disk0:asr9k-p-4.1.2.CSCtu30994-1.0.0
Info:
Info: The package can be activated across the entire router.
Info:
Install operation 27 completed successfully at 06:15:39 UTC Tue May 15 2012.
Once the install is complete, the router will reload and you will need to
relogin. Do not forget to do INSTALL COMMIT!!!
RP/0/RSP0/CPU0:R2(admin)#
Once you have the file, you will need to copy it to the router via TFTP or
some other method. The license file will also include the instructions to
add it, I have included them here as well.
Now we need to see if is has been added via the show license command
RP/0/1/CPU0:CRS(admin)#show license
Once the license has been successfully added, we now need to assign it to a
line card slot. Again, this is done from Admin config mode
RP/0/RSP0/CPU0:R1(admin)#config
Now we can apply the licenses that we have to 0/0 and 0/1:
RP/0/RSP0/CPU0:R1(admin-config)#license A9K-iVRF-LIC location 0/0/CPU0
RP/0/RSP0/CPU0:R1(admin-config)#license A9K-iVRF-LIC location 0/1/CPU0
RP/0/RSP0/CPU0:R1(admin-config)#commit
Thu Apr 19 03:13:44.883 UTC
RP/0/RSP0/CPU0:R1(admin-config)#exit
RP/0/RSP0/CPU0:R1(admin)#exit
RP/0/RSP0/CPU0:R1#
There they are, assigned to 0/1 and 0/0 as requested.
For this example, we can create an alias to show all the IPV4 interfaces in a
brief using a single command, SHV4BR
RP/0/7/CPU0:R1#conf t
Mon Apr 16 15:05:26.064 UTC
RP/0/7/CPU0:R1(config)#alias SHV4BR show ipv4 int brief
RP/0/7/CPU0:R1(config)#commit
Mon Apr 16 15:05:44.043 UTC
As you can seem the system will re-enter the command from the alias
RP/0/7/CPU0:R1#show ipv4 int brief
Mon Apr 16 15:05:49.094 UTC
Pretty neat, but it gets better – we can actually configure that alias as
well!
RP/0/7/CPU0:R1#conf t
Mon Apr 16 15:24:06.626 UTC
RP/0/7/CPU0:R1(config)#int r2connection
RP/0/7/CPU0:R1(config)#int gig0/3/0/2
RP/0/7/CPU0:R1(config-if)#exit
RP/0/7/CPU0:R1(config)#exit
RP/0/7/CPU0:R1#
Now, there is another trick with IOS XR, and that is variables!
So, what can we do with Variables and Aliases? Well, if there is a command
that you use quite often – say show interface, why not change it to an alias
with a variable.
For this example, we will create sint (show interface) and use variable
(var1).
But first, let us look at what happens when you add a question mark (?) to
the end of the command in configuration mode:
RP/0/RSP0/CPU0:c21.lab(config)#alias sint ?
LINE Alias body with optional parameters e.g,(name) show $name
As you can see, it even tells you that you can use variables, might not be
obvious, that that is what (name) is.
RP/0/RSP0/CPU0:c21.lab#
RP/0/RSP0/CPU0:c21.lab#
As you can see, it did the show interface bundle-eth100 and show run
interface bundle-eth100
If you want to only see the Loopback interfaces, all of them. Normally you
would do something like Show int br | in Loop, but with XR you can use a
wildcard (*)
RP/0/7/CPU0:R1#sh int l* br
Mon Apr 16 17:21:08.088 UTC
Intf Intf LineP Encap MTU BW
Name State State Type (byte) (Kbps)
----------------------------------------------------------------------
Lo0 up up Loopback 1500 0
Lo100 up up Loopback 1500 0
Lo666 up up Loopback 1500 0
Lo667 up up Loopback 1500 0
Lo1000 up up Loopback 1500 0
RP/0/7/CPU0:R1#
This works the same if you want to see this in the running config:
RP/0/7/CPU0:R1#sh run in l*
Mon Apr 16 17:21:53.360 UTC
interface Loopback0
ipv4 address 1.1.1.1 255.255.255.255
ipv6 address 2001::1/128
!
interface Loopback100
ipv4 address 100.100.100.100 255.255.255.255
!
interface Loopback666
ipv4 address 6.6.6.6 255.255.255.255
!
interface Loopback667
ipv4 address 6.6.6.7 255.255.255.255
!
interface Loopback1000
vrf LAB
ipv4 address 111.111.111.111 255.255.255.255
!
RP/0/7/CPU0:R1#
RP/0/RSP0/CPU0:R2#monitor processes
Tue Apr 24 01:27:41.959 UTC
Computing times...
287 processes; 1320 threads; 1086 timers, 6265 channels, 8489 fds
CPU states: 99.6% idle, 0.2% user, 0.1% kernel
Memory: 4096M total, 2762M avail, page size 4K
Ok, onto SSH – but before setting up SSH, we need to generate an RSA key.
This is a bit different as you do not do this from config mode.
First up, add your domain-name if you do not have one:
RP/0/RSP0/CPU0:R1(config)#domain name fryguy.net
RP/0/RSP0/CPU0:R1(config)#commit
RP/0/RSP0/CPU0:R1#crypto key generate rsa
Sat Apr 21 00:36:07.790 UTC
The name for the keys will be: the_default
Choose the size of the key modulus in the range of 512 to 2048 for your
General Purpose Keypair. Choosing a key modulus greater than 512 may take a
few minutes.
RP/0/RSP0/CPU0:R1#
Once we have generated the RSA key, we can now enable the SSH service:
RP/0/RSP0/CPU0:R1#conf t
Sat Apr 21 00:40:33.845 UTC
RP/0/RSP0/CPU0:R1(config)#ssh server v2
RP/0/RSP0/CPU0:R1(config)#commit
Sat Apr 21 00:40:39.939 UTC
Ok, but what if we wanted to limit who has access to the box by IP address,
that is where control-plane security comes in. For this example, I will
allow 10/8 to access the device.
RP/0/RSP0/CPU0:R1(config)#control-plane
RP/0/RSP0/CPU0:R1(config-ctrl)#management-plane
RP/0/RSP0/CPU0:R1(config-mpp-inband)#int g0/1/0/18
RP/0/RSP0/CPU0:R1(config-mpp-inband-if)#allow SSH peer
RP/0/RSP0/CPU0:R1(config-ssh-peer)# address ipv4 10.0.0.0/8
There you go, SSH access from only the 10.0.0.0/8 subnet.
And, when it comes close the expiry timer, you will get a message:
RP/0/RSP0/CPU0:R1#
*
* The idle timeout is soon to expire on this line
*
First up, we need to configure our source interface for TACACS, here we will
use loopback0 and the default VRF.
RP/0/RSP0/CPU0:PE2(config)#tacacs source-interface Loopback0 vrf default
Time to create a local console authenticaion method, this way console does
not rely on TACACS.
You may or may not want to do this, but I am showing it for these examples.
RP/0/RSP0/CPU0:PE2(config)#aaa authentication login console local
RP/0/RSP0/CPU0:PE2(config)#aaa authorization commands console none
Now we can start to configure our AAA for login, here I am using default
RP/0/RSP0/CPU0:PE2(config)#aaa authentication login default group tacacs+ local
Since this is IOS XR, I strongly suggest using a commit confirmed here!
RP/0/RSP0/CPU0:PE2(config)#commit confirmed minutes 2
Thu Oct 18 03:22:57.487 UTC
RP/0/RSP0/CPU0:PE2(config)#
First up, we need to set our source interface, for this one I will use a
different Loopback, Lo100 and use VRF CustA
RP/0/RSP0/CPU0:PE2(config)#tacacs source-interface Loopback100 vrf CustA
Now we need to create a server group for the ACS box. This tells it what VRF
the server is in.
RP/0/RSP0/CPU0:PE2(config)#aaa group server tacacs+ ACS
RP/0/RSP0/CPU0:PE2(config-sg-tacacs)# server 192.168.100.100
RP/0/RSP0/CPU0:PE2(config-sg-tacacs)# vrf CustA
Test remote access via SSH, and if all works - commit it to save
RP/0/RSP0/CPU0:PE2(config)#commit
Sorry, not much to say here but you should already be familiar with these.
We will place our loopback and out g0/3/0/2 interface into OSPF process LAB
and area 0.0.0.0
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#conf t
Thu Mar 29 19:37:52.671 UTC
Now we can place the interfaces into the area, no need to entering subnets
RP/0/7/CPU0:R1(config-ospf-ar)#inter loo0
RP/0/7/CPU0:R1(config-ospf-ar-if)#inter g0/3/0/2
RP/0/7/CPU0:R1(config-ospf-ar-if)#exit
RP/0/7/CPU0:R1(config-ospf-ar)#exit
RP/0/7/CPU0:R1(config-ospf)#exit
RP/0/7/CPU0:R1(config)#commit
Thu Mar 29 19:38:15.182 UTC
RP/0/7/CPU0:R1(config)#
We can see what we have OSPF LAB running with a RouterID of 1.1.1.1 (our
loopback). It tells us what interfaces are in Area 0.0.0.0 as well.
I just wanted to take a minute and discuss some of the other features
available for OSPF.
As you can see, all the normal OSPF network interface types are there. You
just need to configure them under the OSPF process instead of the interface
like in normal IOS.
Authentication
IOS XR also supports OSPF authentication, both area and interface. In this
example we will create an MD5 interface authentication.
RP/0/7/CPU0:R1(config)#router ospf LAB
RP/0/7/CPU0:R1(config-ospf)#area 0.0.0.0
RP/0/7/CPU0:R1(config-ospf-ar)#int g0/3/0/2
Now, lets look at the interface and make sure we have MD5 authentication
enabled.
RP/0/7/CPU0:R1#sh ospf LAB int g0/3/0/2
Sun Apr 1 18:31:01.235 UTC
Cost
Just like normal IOS, we can change the OSPF cost on an interface – but same
thing here; it is done under the OSPF process
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#conf t
Sun Apr 1 18:35:17.061 UTC
RP/0/7/CPU0:R1(config)#router ospf LAB
RP/0/7/CPU0:R1(config-ospf)#area 0.0.0.0
RP/0/7/CPU0:R1(config-ospf-ar)#int loop0
RP/0/7/CPU0:R1(config-ospf-ar-if)#cost ?
<1-65535> Cost
RP/0/7/CPU0:R1#conf t
Thu Mar 29 20:07:53.797 UTC
RP/0/7/CPU0:R1(config)#no router ospf LAB
RP/0/7/CPU0:R1(config)#commit
Here is where the difference starts, we need to select the Address family
first
RP/0/7/CPU0:R1(config-eigrp)#address-family ipv4
When you issue the same command under IOS, you have Routing for Networks
instead of Interfaces:
R1#sh ip protocols
Routing Protocol is "eigrp 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: eigrp 1
EIGRP NSF-aware route hold timer is 240s
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
1.1.1.1/32
150.1.12.0/24
Routing Information Sources:
Gateway Distance Last Update
(this router) 90 00:00:22
150.1.12.2 90 00:00:04
Distance: internal 90 external 170
R1#
There, we have a route to R2’s loopback. Lets PING it from our loopback to
test connectivity.
RP/0/7/CPU0:R1#ping 2.2.2.2 so l0
Thu Mar 29 20:09:36.232 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/5 ms
RP/0/7/CPU0:R1#
I will be honest here; the correct command to show routes is show route
Protocol. Once you add IPv6, you really should to start to use the correct
commands.
Now here is something interesting, the RIP version is 2, yet I did not
specify it in the config. This is because IOS XR code only supports v2.
RP/0/7/CPU0:R1(config)#router rip
RP/0/7/CPU0:R1(config-rip)#ver?
^
% Invalid input detected at '^' marker.
Now, let’s look at the routing table using the proper command:
RP/0/7/CPU0:R1#sh route ipv4
Thu Mar 29 20:40:08.877 UTC
Codes: C - connected, S - static, R - RIP, B – BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E – EGP
i - ISIS, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, su - IS-IS summary null, * - candidate default
U - per-user static route, o - ODR, L - local, G - DAGR
A - access/subscriber, (!) - FRR Backup path
Gateway of last resort is not set
L 1.1.1.1/32 is directly connected, 01:14:39, Loopback0
R 2.2.2.2/32 [120/1] via 150.1.12.2, 00:01:25, GigabitEthernet0/3/0/2
C 150.1.12.0/24 is directly connected, 02:01:22, GigabitEthernet0/3/0/2
L 150.1.12.1/32 is directly connected, 02:01:22, GigabitEthernet0/3/0/2
RP/0/7/CPU0:R1#
As you can see, we have a RIP route to R2 L0 2.2.2.2/32 interface. Time for
a PING!
RP/0/7/CPU0:R1#ping 2.2.2.2 so l0
Thu Mar 29 20:40:15.606 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/3/4 ms
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#conf t
Thu Mar 29 22:09:12.786 UTC
Then we assign the interfaces to the process, as well as the address family.
RP/0/7/CPU0:R1(config-isis)#int l0
RP/0/7/CPU0:R1(config-isis-if)#address-family ipv4
RP/0/7/CPU0:R1(config-isis-if-af)#exit
RP/0/7/CPU0:R1(config-isis-if)#address-family ipv6
RP/0/7/CPU0:R1(config-isis-if-af)# exit
RP/0/7/CPU0:R1(config-isis-if)#int g0/3/0/2
RP/0/7/CPU0:R1(config-isis-if)#address-family ipv4
RP/0/7/CPU0:R1(config-isis-if-af)# exit
RP/0/7/CPU0:R1(config-isis-if)#address-family ipv6
RP/0/7/CPU0:R1(config-isis-if-af)# exit
RP/0/7/CPU0:R1(config-isis-if)#exit
Notice I did not specify an IS-IS Level when I started, but we can set this
to Level-2
RP/0/7/CPU0:R1(config-isis)#is-type level-2-only
Now, when we show the config, you will notice Level-2 is set to the top of
the config when applied, not in the order I entered it. This is the beauty
of a staging config, you can enter some things in the wrong order but they
will be applied in the correct order.
RP/0/7/CPU0:R1(config-isis)#sh config
Thu Mar 29 22:10:22.326 UTC
Building configuration...
!! IOS XR Configuration 4.1.1
router isis LAB
is-type level-2-only
net 49.0000.0000.0001.00
interface Loopback0
address-family ipv4 unicast
!
address-family ipv6 unicast
!
!
We can see we are adjacent with R2 via IPv4 and IPv6. Lets look at the IPv4
IS-IS routing table and then PING the loopback of R2:
RP/0/7/CPU0:R1#sh route ipv4 isis
Thu Mar 29 22:17:15.545 UTC
i L2 2001::2/128
[115/20] via fe80::2d0:79ff:fe01:3a78, 00:07:05, GigabitEthernet0/3/0/2
RP/0/7/CPU0:R1#ping 2001::2 so 2001::1
Thu Mar 29 22:17:49.763 UTC
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 = 3/9/34 ms
RP/0/7/CPU0:R1#
Then change context to the G0/1 interface and enable ISIS for IPv4 and IPv6
R1(config-router)#int g0/1
R1(config-if)#ip router isis
R1(config-if)#ipv6 router isis
Then change context to the Loop0 interface and enable ISIS for IPv4 and IPv6
R1(config-if)#int l0
R1(config-if)#ip router isis
R1(config-if)#ipv6 router isis
R1(config-if)#^Z
Few more steps, and configuring things under the process make much more sense
than under an interface.
RP/0/7/CPU0:R1(config)#
RP/0/7/CPU0:R1(config)#router bgp 1
Let’s define the network we want to advertise, under the address family:
RP/0/7/CPU0:R1(config-bgp)#address-family ipv4 unicast
RP/0/7/CPU0:R1(config-bgp-af)#net 1.1.1.1/32
RP/0/7/CPU0:R1(config-bgp-af)#exit
Now, we can configure the neighbor. Notice all the commands for the neighbor
are under the neighbor now – not next to the neighbor.
RP/0/7/CPU0:R1(config-bgp)#nei 150.1.12.2
RP/0/7/CPU0:R1(config-bgp-nbr)#remote-as 1
RP/0/7/CPU0:R1(config-bgp-nbr)#address-family ipv4 unicast
RP/0/7/CPU0:R1(config-bgp-nbr-af)#exit
RP/0/7/CPU0:R1(config-bgp-nbr)#comm
Thu Mar 29 22:47:05.147 UTC
RP/0/7/CPU0:R1(config-bgp)#exit
RP/0/7/CPU0:R1(config)#exit
We have connectivity!
RP/0/7/CPU0:R1#
Here is the same IOS config. With a single neighbor it is pretty simple.
router bgp 1
network 1.1.1.1 mask 255.255.255.255
neighbor 150.1.12.2 remote-as 1
Ok, now that we have that configured – time to look at our routing table, we
should see a route to 200.200.200.200/32.
RP/0/7/CPU0:R1#sh ip route
Thu Mar 29 23:24:25.533 UTC
RP/0/7/CPU0:R1#
Yup, we are up for over 3 minutes now – but wait, we have an ! mark there –
no routes received.
It says to use the show bgp neighbors address for details. Let’s see what
that says.
Instead of a route-map like IOS, IOS XR uses a Route Policy Language (RPL) –
that is more powerful and easier than IOS. Let’s configure a very simple one
to pass everything:
RP/0/7/CPU0:R1(config)#route-policy PASS
RP/0/7/CPU0:R1(config-rpl)#pass
RP/0/7/CPU0:R1(config-rpl)#exit
RP/0/7/CPU0:R1(config)#commit
Thu Mar 29 23:28:08.400 UTC
Cool – that was easy. Now lets apply that to the eBGP neighbor:
RP/0/7/CPU0:R1(config)#router bgp 1
RP/0/7/CPU0:R1(config-bgp)#nei 2.2.2.2
RP/0/7/CPU0:R1(config-bgp-nbr)#address-family ipv4 unicast
RP/0/7/CPU0:R1(config-bgp-nbr-af)#route-policy PASS out
RP/0/7/CPU0:R1(config-bgp-nbr-af)#route-policy PASS in
RP/0/7/CPU0:R1(config-bgp-nbr-af)#commit
Thu Mar 29 23:28:32.865 UTC
router bgp 1
no synchronization
bgp log-neighbor-changes
network 100.100.100.100 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 route-map PASS in
neighbor 2.2.2.2 route-map PASS out
As you can see, we are getting a bunch of 200.200.200.x/32 routes now as well
as a 200.100.200.100/32 route. For this exercise, lets filter our all the
200.200.200.x routes we are receiving from our neighbor.
Now that we have the prefix-set done we can create the route-policy
RP/0/7/CPU0:R1(config)#route-policy R2Loopbacks
Notice that IOS XR can use IF statements, you can just imagine how powerful
IF and ELSE statements can be when route filtering.
RP/0/7/CPU0:R1(config-rpl)#if destination in R2Loopbacks then
RP/0/7/CPU0:R1(config-rpl-if)#pass
RP/0/7/CPU0:R1(config-rpl-if)#endif
RP/0/7/CPU0:R1(config-rpl)#end-policy
While that might not be so bad, the power of RPL grows. This is just a quick
intro; future posts will have more and more about RPL. Some other things that
we might see are:
Now we need to enable the address family for this VRF, there IPv4 Unicast
RP/0/7/CPU0:R1(config-vrf)#address-family ipv4 un
RP/0/7/CPU0:R1(config-vrf-af)#exit
Now we need to enable the IPv6 address family for this VRF
RP/0/7/CPU0:R1(config-vrf)#address-family ipv6 unicast
Little different then IOS, but this actually makes more sense
RP/0/7/CPU0:R1(config-subif)#dot1q vlan 100
RP/0/7/CPU0:R1(config-subif)#ip add 150.1.21.1/24
RP/0/7/CPU0:R1(config-subif)#ipv6 add 2001:1:1:21::1/64
RP/0/7/CPU0:R1(config-subif)#vrf LAB
Notice that I applied the VRF LAB command after configuring the IP addresses.
If this was IOS, I would have lost all that work – but since its IOS XR,
nothing takes effect until after you COMMIT the changes.
Now we should try to PING over the VRF. Remember, when PINGing over a VRF you
need to specify the VRF in the PING command.
RP/0/7/CPU0:R1#ping vrf LAB 2001:1:1:21::2
Fri Mar 30 14:17:37.291 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:1:1:21::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/13/49 ms
RP/0/7/CPU0:R1#conf t
Fri Mar 30 14:39:31.441 UTC
RP/0/7/CPU0:R1(config)#int loop1000
RP/0/7/CPU0:R1(config-if)#ip add 111.111.111.111/32
RP/0/7/CPU0:R1(config-if)#vrf LAB
RP/0/7/CPU0:R1#
First up, lets enabled LDP on all OSPF interfaces. Normally you would do
this under each interface, but here we will use the MPLS LDP AUTOCONFIG
command. This is a good command to use as it ensures that you do not miss
configuring LDP on an interface.
RP/0/7/CPU0:R1#
RP/0/7/CPU0:R1#conf t
Sun Apr 1 18:58:04.084 UTC
RP/0/7/CPU0:R1(config)#router ospf LAB
Under the OSPF LAB process, we need to configure mpls ldp autoconfig and then
commit it.
RP/0/7/CPU0:R1(config-ospf)#mpls ldp auto
RP/0/7/CPU0:R1(config-ospf)#commit
Sun Apr 1 18:58:12.277 UTC
RP/0/7/CPU0:R1(config-ospf)#exit
RP/0/7/CPU0:R1(config)#exit
Ahh, we configured the command but never enabled MPLS LDP. Remember, if a
process is not needed – it does not run. So, lets enable the process
RP/0/7/CPU0:R1#conf t
Sun Apr 1 18:58:22.811 UTC
RP/0/7/CPU0:R1(config)#mpls ldp
Now, one thing to note on IOS XR, LDP is the only label protocol supported,
TDP is not available.
RP/0/7/CPU0:R1(config-ldp)#label ?
accept Configure inbound label acceptance control
advertise Configure outbound label advertisement control
allocate Configure label allocation control
<cr>
RP/0/7/CPU0:R1(config-ldp-lbl)#tag?
^
% Invalid input detected at '^' marker.
RP/0/7/CPU0:R1(config-ldp)#comm
RP/0/7/CPU0:R1#
There you can see we have LDP neighbor with router-id 2.2.2.2 (R2) on
G0/3/0/2. You can also see the ports we are using for this communication.
Our local port is 646 and the remote port is 35051.
LDP Authentication
Ok, now onto neighbor password for LDP (both directed and all)
Ok, I made the change to R2 so the passwords match, now we can look at our
neighbor
RP/0/7/CPU0:R1#sh mpls ldp neighbor
Sun Apr 1 19:40:33.961 UTC
RP/0/7/CPU0:R1#
As you can see, next to the TCP connection, it now says MD5 on. Previously
nothing was after the port number.
You can also configure a password for any LDP session, that is done like
follows:
RP/0/7/CPU0:R1#conf t
Sun Apr 1 19:40:45.561 UTC
RP/0/7/CPU0:R1(config)#mpls ldp
RP/0/7/CPU0:R1(config-ldp)#neighbor ?
A.B.C.D IP address of neighbor
password Configure password for MD5 authentication for all neighbors
RP/0/7/CPU0:R1(config-ldp)#neighbor password cisco
RP/0/7/CPU0:R1(config-ldp)#comm
Sun Apr 1 19:40:57.167 UTC
Now any LDP session must have a password. Now remember this in case you need
to do directed LDP session some time down the road.
And to check:
RP/0/7/CPU0:R1#sh isis interface g0/3/0/2
Sun Apr 1 22:42:11.124 UTC
GigabitEthernet0/3/0/2 Enabled
Adjacency Formation: Enabled
Prefix Advertisement: Enabled
<--SNIP – Information removed for brevity -->
As you can see, IPv4 now has a metric of 20 whereas IPv6 has the default
metric of 10.
Authentication
Time to configure IS-IS authentication. Again, all this is done under the
routing process – makes keeping all relevant changes very close together.
Once I configured the password on the other router, we have neighbors again!
RP/0/7/CPU0:R1#sh isis neighbors
Sun Apr 1 22:55:55.066 UTC
So we have this diagram below – CE1 and CE2 are the customer routers and both
are running OSPF in Area 0. Then need to talk to each other but do not have
a direct connection available, so they have contracted us to provide
connectivity via MPLS between them. What we will now do is build a pseudo
MPLS network between PE1 and PE2, establish an iBGP peering, create the
associated customer VRF and then peer with the customer via OSPF Area 0.
CE1 CE2
Router Router
OSPF OSPF
Area 0 Area 0
ISIS Level 2
MPLS
Router Router
PE1 PE2
So, first up lets configure CE1 using an IP of 10.3.3.3/32 for the loopback
and 10.1.13.3/24 for the link facing PE1.
CE1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
First up, Loopback 0. Since this is IOS, you will need to use the full dotted
decimal subnet mask
CE1(config)#int loop0
CE1(config-if)#ip add 10.3.3.3 255.255.255.255
Ok, now lets get CE2 done since it basically the same – but here we will use
10.4.4.4/32 and 10.4.24.4/24
CE2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
First up, Loopback 0. Since this is IOS, you will need to use the full dotted
decimal subnet mask
CE2(config)#int loop0
CE2(config-if)#ip add 10.3.4.4 255.255.255.255
Now we can do the OSPF configs for these routers. Since this is a lab, I am
just going to put the 10/8 network in Area 0. So, first up - CE1
CE1(config)#router ospf 1
CE1(config-router)#net 10.0.0.0 0.255.255.255 a 0
CE1(config-router)#
For the PE network we are going to use ISIS for our internal routing protocol
and then use BGP on top of that to connect the routers together to pass the
VPNv4 routes. Why ISIS you ask? It is because you can use one process for
IPv4 and IPv6 traffic. With OSPF you need to run two processes, OSPF for
IPv4 and OSPFv3 for IPv6. A single process makes it easier to support as
well as if new protocols come around, ISIS won’t really care since it is not
IP based (CLNS based).
RP/0/RSP0/CPU0:R1#conf t
Fri Apr 20 00:34:18.971 UTC
RP/0/RSP0/CPU0:R1(config)#int g0/1/0/11
RP/0/RSP0/CPU0:R1(config-if)#ip add 150.1.12.1/24
RP/0/RSP0/CPU0:R1(config-if)#no shut
RP/0/RSP0/CPU0:R1(config-if)#commit
Fri Apr 20 00:34:25.555 UTC
RP/0/RSP0/CPU0:R1(config-if)#
RP/0/RSP0/CPU0:R1(config-if)#int loop0
RP/0/RSP0/CPU0:R1(config-if)#ip add 150.1.1.1/32
RP/0/RSP0/CPU0:R1(config-if)#commit
Fri Apr 20 00:34:39.839 UTC
RP/0/RSP0/CPU0:R1(config-if)#
Ok, lets get PE2 done now and test the interface connectivity. After we
confirm that, we can do ISIS.
RP/0/RSP0/CPU0:R2#conf t
Fri Apr 20 00:35:39.031 UTC
RP/0/RSP0/CPU0:R2(config)#int g0/1/0/11
RP/0/RSP0/CPU0:R2(config-if)#ip add 150.1.12.2/24
RP/0/RSP0/CPU0:R2(config-if)#no shut
RP/0/RSP0/CPU0:R2(config-if)#int loop0
RP/0/RSP0/CPU0:R2(config-if)#ip add 150.2.2.2/32
RP/0/RSP0/CPU0:R2(config-if)#comm
Fri Apr 20 00:35:54.565 UTC
RP/0/RSP0/CPU0:R2(config-if)#
PE1:
Lets define the routing process - Core
RP/0/RSP0/CPU0:R1(config)#router isis Core
Set the loopback interface into ISIS and place it in PASSIVE mode
RP/0/RSP0/CPU0:R1(config-isis)#int loop0
RP/0/RSP0/CPU0:R1(config-isis-if)#passive
RP/0/RSP0/CPU0:R1(config-isis-if)#address-family ipv4 un
RP/0/RSP0/CPU0:R1(config-isis-if-af)#exit
Like all other IOS XR commands, you assign the interfaces under the protocol.
RP/0/RSP0/CPU0:R1(config-ldp)#int g0/1/0/11
RP/0/RSP0/CPU0:R1(config-ldp-if)#comm
Fri Apr 20 01:18:00.216 UTC
RP/0/RSP0/CPU0:R1(config-ldp-if)#
Ok, PE2
RP/0/RSP0/CPU0:R2(config)#mpls ldp
RP/0/RSP0/CPU0:R2(config-ldp)#int g0/1/0/11
RP/0/RSP0/CPU0:R2(config-ldp-if)#comm
Fri Apr 20 01:18:08.116 UTC
RP/0/RSP0/CPU0:R2#
Cool, we have a LDP session with PE1 and we can see the IPs bound to the
peer.
We are getting there, we still have BGP, VRF, and the OSPF configuration to
do yet. We will save the BGP part until last – so for now, VRF time.
Now we need to define our route-targets that we are going to import, and
export. What is a route-target? Quickly it is a 64-bit BGP community that is
used for tagging prefixes, making every prefix unique and also allows the
remote PE routers to know what routes belong to what VRF (import).
For this example, we will use 100:100 for both.
Now we can create the same VRF with the same route-targets:
RP/0/RSP0/CPU0:R2(config)#vrf R3R4
RP/0/RSP0/CPU0:R2(config-vrf)# address-family ipv4 unicast
RP/0/RSP0/CPU0:R2(config-vrf-af)# import route-target
RP/0/RSP0/CPU0:R2(config-vrf-export-rt)# 100:100
RP/0/RSP0/CPU0:R2(config-vrf-export-rt)# export route-target
RP/0/RSP0/CPU0:R2(config-vrf-export-rt)# 100:100
RP/0/RSP0/CPU0:R2(config-vrf-export-rt)#comm
Fri Apr 20 01:45:18.380 UTC
Yup, we have a VRF. Now we can assign the interfaces facing the CE routers
to the appropriate VRF, configure the IP addresses, and then do a PING test
across the interface.
Configure our IP
RP/0/RSP0/CPU0:R1(config-if)# ipv4 address 10.1.13.1 255.255.255.0
Since this is a 100M link, we will need to hard code it for the GBICs sake.
RP/0/RSP0/CPU0:R1(config-if)# speed 100
Now we can test a ping from PE1 to CE1 and PE2 to CE2.
RP/0/RSP0/CPU0:R1#ping 10.1.13.3
Fri Apr 20 01:57:01.969 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.13.3, timeout is 2 seconds:
UUUUU
Success rate is 0 percent (0/5)
RP/0/RSP0/CPU0:R1#
Hmm, that failed – why? Well, when an interface lives in a VRF, you need to
PING from that VRF. Lets try that again using VRF R3R4
RP/0/RSP0/CPU0:R1#ping vrf R3R4 10.1.13.3
Fri Apr 20 01:57:11.522 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.13.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
Ok, we have connectivity. Now we can get OSPF working between the PE and the
CEs.
We only see our local routes, nothing from CE2 yet. This is because we have
not built the VPNv4 session between PE1 and PE2 yet. We need to configure
BGP VPNv4 in order to get the two PE routers to pass the tagged routes to
each other. So, onto BGP we go!
Now we can configure the VRF parameters that BGP needs to know
First define our VRF
RP/0/RSP0/CPU0:R1(config-bgp-nbr-af)# vrf R3R4
And finally redistribute our OSPF learned routes into BGP VRF R3R4
RP/0/RSP0/CPU0:R1(config-bgp-vrf-af)# redistribute ospf R3R4 match internal
external
RP/0/RSP0/CPU0:R1(config-bgp-vrf-af)# ^Z
RP/0/RSP0/CPU0:R2#
Yup, we are up and we can see what we are receiving 2 prefixes as well!
Wonder what they are? To find out, use the show bgp vpnv4 unicast command
RP/0/RSP0/CPU0:R2#sh bgp vpnv4 unicast
Fri Apr 20 02:29:01.202 UTC
BGP router identifier 150.2.2.2, local AS number 1
BGP generic scan interval 60 secs
CE1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static
route
o - ODR, P - periodic downloaded static route
Nope, hmm. What did we forget? I know, we redistributed OSPF into BGP, but
we did not redistribute BGP into OSPF. Lets get that fixed.
PE1:
RP/0/RSP0/CPU0:R1(config)#router ospf R3R4
RP/0/RSP0/CPU0:R1(config-ospf)#vrf R3R4
RP/0/RSP0/CPU0:R1(config-ospf-vrf)# redistribute bgp 1
RP/0/RSP0/CPU0:R1(config-ospf-vrf)#comm
Fri Apr 20 02:31:44.637 UTC
RP/0/RSP0/CPU0:R1(config-ospf-vrf)#
Now, one other thing that you should notice with the CE1 routing table,
routes to CE2 are seen as O IA, OSPF InterArea routes. This is what is
expected when you run the same CE OSPF process ID over a MPLS network – the
BGP will carry the extra attributes creating what is called a Super Backbone.
When we decode the BGP route information using the show bgp vpnv4 unicast vrf
R3R4 10.1.13.0/24 command, we get the following output - notice the extended
community information, this is where the extra information is carried. We
will actually pull up both 10.1.13.0 and 10.1.14.0 so you can see.
There is a way to prevent this from happening and that is to create a Domain-
ID for the OSPF process on one of the PE routers.
RP/0/RSP0/CPU0:R2#conf t
Fri Apr 20 03:30:11.463 UTC
Now, lets see what Domain-id types we have – See RFC 4577 for more info on
these.
RP/0/RSP0/CPU0:R2(config-ospf-vrf)#domain-id type ?
0005 Type 0x0005
0105 Type 0x0105
0205 Type 0x0205
8005 Type 0x8005
RP/0/RSP0/CPU0:R2(config-ospf-vrf)#domain-id type 0005 value ?
WORD OSPF domain ID ext. community value in Hex (6 octets)
This can also work in reverse, if you want to create a SuperBackbone but the
OSPF processes are different, you can set the domain-id to be the same.
RP/0/RSP0/CPU0:R1(config-ospf-vrf)#domain-id type 0105 value AABBCCDDEEFF
CE1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
ia - IS-IS inter area, * - candidate default, U - per-user
o - ODR, P - periodic downloaded static route
Now CE2
Now, this is unique to our CE devices, we need to specify the speed in order
to get the interfaces up as the CE routers here do not support Gigabit
Ethernet
RP/0/RSP0/CPU0:PE2(config-if)#int g0/1/0/19
RP/0/RSP0/CPU0:PE2(config-if)#spee 100
RP/0/RSP0/CPU0:PE2(config-if)#comm
There you go, that looks good. Now, can we PING between CE1 and CE2?
CE1#p 10.1.34.4
All neighbored up! That means we should be able to PING between loopback
interfaces:
CE1#p 10.4.4.4 so l0
Like everything else with IOS XR, NHRP is handled a little differently. With
IOS, you configure your standby commands under the interfaces; in IOS XR you
use ROUTER HSRP or Router VRRP.
For this lab we will use interface Te0/1/0/0 and a subnet of 150.1.12.0/24.
First up R1:
RP/0/RSP0/CPU0:R1(config)#int tenGigE 0/1/0/0
RP/0/RSP0/CPU0:R1(config-if)#ip add 150.1.12.1/24
RP/0/RSP0/CPU0:R1(config-if)#no shut
RP/0/RSP0/CPU0:R1(config-if)#commit
RP/0/RSP0/CPU0:R1(config-if)#
Now R2:
RP/0/RSP0/CPU0:R2(config)#int tenGigE 0/1/0/0
RP/0/RSP0/CPU0:R2(config-if)#ip add 150.1.12.2/24
RP/0/RSP0/CPU0:R2(config-if)#no shut
RP/0/RSP0/CPU0:R2(config-if)#commit
RP/0/RSP0/CPU0:R2(config)#router hsrp
RP/0/RSP0/CPU0:R2(config-hsrp)#interface tenGigE 0/1/0/0
RP/0/RSP0/CPU0:R2(config-hsrp-if)#hsrp 100 ipv4 150.1.12.100
RP/0/RSP0/CPU0:R2(config-hsrp-if)#hsrp preempt
RP/0/RSP0/CPU0:R2(config-hsrp-if)#hsrp authentication cisco
RP/0/RSP0/CPU0:R2(config-hsrp-if)#comm
One thing cool about VRRP, you don’t have to burn an IP address just for the
virtual. You can use an actual physical IP address of a router. If that
router goes off-line, then the other router will just assume the IP address.
R1 up first, and we will use the R1 Te0/1/0/0 IP address for the virtual.
First though, we need to remove HSRP and save the changes.
RP/0/RSP0/CPU0:R1(config)#no router hsrp
RP/0/RSP0/CPU0:R1(config)#commit
Assign the IP, here I am using the same IP as our physical interface
RP/0/RSP0/CPU0:R1(config-vrrp-virtual-router)#address 150.1.12.1
RP/0/RSP0/CPU0:R1(config-vrrp-virtual-router)#text-authentication cisco
RP/0/RSP0/CPU0:R1(config-vrrp-virtual-router)#commit
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#
Now for R2, but this time we will decrease the priority so that R1 is the
active router
RP/0/RSP0/CPU0:R2(config)#no router hsrp
RP/0/RSP0/CPU0:R2(config)#commit
RP/0/RSP0/CPU0:R2(config)#router vrrp
RP/0/RSP0/CPU0:R2(config-vrrp)#interface tenGigE 0/1/0/0
RP/0/RSP0/CPU0:R2(config-vrrp-if)#address-family ipv4
RP/0/RSP0/CPU0:R2(config-vrrp-address-family)#vrrp 1
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#address 150.1.12.1
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#text-authentication cisco
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#priority 50
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#commit
RP/0/RSP0/CPU0:R2(config-vrrp-virtual-router)#
RP/0/RSP0/CPU0:R2#