/images/logo.png
A Network Blog by a Network Engineer

IOS XR – VRF lite and dot1q Trunks


Ok, time for some VRF lite basics and we can throw in some Dot1Q trunks to go with it.
First, let’s create our VRF called LAB
RP/0/7/CPU0:R1(config)#vrf LAB
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
Now we can create our Dot1Q trunk to the other router:
RP/0/7/CPU0:R1(config-vrf-af)#int g0/3/0/3.100
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

IOS XR – Route Filtering


 
 
Ok, now that BGP has been covered, lets talk about filtering routes received from our neighbor.  Here I have created some additional Loopbacks on R2 that are being advertised to R1:
RP/0/7/CPU0:R1#sh ip route bgp
Fri Mar 30 13:13:36.797 UTC
B    200.100.200.100/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.200/32 [20/0] via 2.2.2.2, 13:45:00
B    200.200.200.203/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.204/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.205/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.206/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.207/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.208/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.209/32 [20/0] via 2.2.2.2, 00:00:42
B    200.200.200.210/32 [20/0] via 2.2.2.2, 00:00:42
RP/0/7/CPU0:R1#
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.
Ok, lets create a prefix-set for the loopback we want to permit:
RP/0/7/CPU0:R1(config)#conf t
RP/0/7/CPU0:R1(config)#prefix-set R2Loopbacks

IOS XR – iBGP and eBGP


BGP, this is where it starts to get different with IOS XR.
First up, configuring an iBGP peering with R2’s 150.1.12.2 in AS1 and advertise our loopback 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
Now, time to see if we have a neighbor established:
RP/0/7/CPU0:R1#sh bgp nei 150.1.12.2
Thu Mar 29 22:48:13.338 UTC

IOS XR – ISIS

IOS XR Fryguy

Time for some IS-IS routing! Between IS-IS and OSPF, those are the two most coming SP core routing protocols.
RP/0/7/CPU0:R1#conf t
Thu Mar 29 22:09:12.786 UTC

First we need to name our process
RP/0/7/CPU0:R1(config)#router isis LAB
Then configure our Network Entity ( Area )
RP/0/7/CPU0:R1(config-isis)#net 49.0000.0000.0001.00
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.

IOS XR – RIP

IOS XR Fryguy

Ok, time for the next routing protocol – RIP. Why would you use IOS XR for RIP? Well, if you have a CE device that only has a few networks, RIP is a perfect protocol. Keep in mind that IOS XR is code built for a Service Provider network, so PE-CE relationships are what these routers are about. Another quick note on these labs, I do not show the configuraiton of the other device (R2) as it is just a mirrored config.
Plus – it is just good to know different options.
RP/0/7/CPU0:R1#conf t
Thu Mar 29 20:37:44.801 UTC
RP/0/7/CPU0:R1(config)#router rip
RP/0/7/CPU0:R1(config-rip)#int l0
RP/0/7/CPU0:R1(config-rip-if)#int g0/3/0/2
RP/0/7/CPU0:R1(config-rip-if)#^Z
Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]:yes

Notice I did not do a COMMIT, but since the router knows I was making changes it asked me.
Let’s check our IP protocols:
RP/0/7/CPU0:R1#sh ip proto
Thu Mar 29 20:39:20.919 UTC

Routing Protocol RIP
1 VRFs (including default) configured, 1 active
6 routes, 3 paths have been allocated
Current OOM state is “Normal”
UDP socket descriptor is 42
VRF Active If-config If-active Routes Paths Updates
default Active 2 2 6 3 30s

IOS XR – EIGRP

IOS XR Fryguy

Up next is IOS XR and EIGRP
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
Once that is deleted, we can now continue with EIGRP configuration.
Just like IOS, we need to give it a process ID
RP/0/7/CPU0:R1(config)#
RP/0/7/CPU0:R1(config)#
router eigrp 1
Here is where the difference starts, we need to select the Address family first
RP/0/7/CPU0:R1(config-eigrp)#address-family ipv4
Enter no auto-summary ( this is habitual to be honest )
RP/0/7/CPU0:R1(config-eigrp-af)#no auto-summary
Then assign the interfaces you want in EIGRP
RP/0/7/CPU0:R1(config-eigrp-af)#int l0
RP/0/7/CPU0:R1(config-eigrp-af-if)#int g0/3/0/2
RP/0/7/CPU0:R1(config-eigrp-af-if)#exit
RP/0/7/CPU0:R1(config-eigrp-af)#exit
RP/0/7/CPU0:R1(config-eigrp)#exit
RP/0/7/CPU0:R1(config)#commit
Thu Mar 29 20:08:59.108 UTC
RP/0/7/CPU0:R1(config)#exit

IOS XR – OSPF Configuration

IOS XR Fryguy

 


Time for some OSPF configs, these will build off the previous configs we just did.  For this lab, the other router, R2, was
preconfigured to support the connections.

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


Defineour OSPF process name

RP/0/7/CPU0:R1(config)#
router ospf LAB

Now to define our area first
RP/0/7/CPU0:R1(config-ospf)#
area 0.0.0.0

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)#

Now to look at our IP Protocols running:
RP/0/7/CPU0:R1#
sh ip proto
Thu Mar 29 19:38:24.113 UTC
Routing Protocol OSPF LAB
Router Id: 1.1.1.1
Distance: 110
Non-Stop Forwarding: Disabled
Redistribution:
None
Area 0.0.0.0
Loopback0
GigabitEthernet0/3/0/2
RP/0/7/CPU0:R1#

IOS XR – Remote Access Services – Telnet and SSH

IOS XR Fryguy

We need to have a way to remote access this device, and by default SSH and TELNET are not enabled.
First up, the easy one – telnet.
RP/0/RSP0/CPU0:R1(config)#telnet ipv4 server max-servers 10
And like that, we can telnet.
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.

How many bits in the modulus [1024]: 2048
Generating RSA keys …
Done w/ crypto generate keypair
[OK]

RP/0/RSP0/CPU0:R1#

IOS XR – Processes


So, since IOS XR is based on QNX, the SHOW PROCESSES command is a bit different then you would see in IOS. In IOS XR, you can actually query processes and see what is going on.
Here is a way to see what BGP is doing :
RP/0/RSP0/CPU0:R2#sh processes bgp
Tue Apr 24 01:23:06.343 UTC
Job Id: 1039
PID: 2941214
Executable path: /disk0/iosxr-routing-4.1.2/bin/bgp
Instance #: 1
Version ID: 00.00.0000
Respawn: ON
Respawn count: 4
Max. spawns per minute: 12
Last started: Tue Apr 10 05:31:26 2012
Process state: Run
Package state: Normal
Started on config: ipc/gl/ip-bgp/meta/speaker/default
core: MAINMEM
Max. core: 0
Placement: Placeable
startup_path: /pkg/startup/bgp.startup
Ready: 0.338s
Available: 25.582s
Process cpu time: 63.719 user, 1.074 kernel, 64.793 total
JID TID CPU Stack pri state TimeInState HR:MM:SS:MSEC NAME
1039 1 1 312K 10 Receive 0:01:01:0795 0:00:00:0249 bgp
1039 2 1 312K 10 Receive 331:51:39:0224 0:00:00:0000 bgp
1039 3 0 312K 10 Receive 331:51:39:0223 0:00:00:0001 bgp
1039 4 1 312K 10 Sigwaitinfo 331:51:39:0129 0:00:00:0000 bgp
1039 5 0 312K 10 Receive 0:00:01:0764 0:00:00:0005 bgp
1039 6 1 312K 10 Receive 0:00:01:0760 0:00:00:0016 bgp
1039 7 0 312K 10 Receive 0:00:23:0239 0:00:02:0242 bgp
1039 8 0 312K 10 Receive 0:00:03:0321 0:00:02:0280 bgp

IOS XR – Wildcard Masks


Sorry for the lapse in posting. I am working on something that I think is pretty cool. Should be ready for publication soon!
But back to IOS XR for a quick post!
A really cool thing with IOS XR is interface wildcards.
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#