PE-CE Communication via RIP
Problem
You want to use RIP to exchange routing information between the CE and PE routers.
Solution
You can use RIP to exchange customer routing information between the CE and PE routers at each site. The advantage to doing this is that any customer routes at one site can be automatically propagated to other customer sites. This requires a normal RIP configuration on the CE router:
Router-CE-A2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router-CE-A2(config)#router rip Router-CE-A2(config-router)#version 2 Router-CE-A2(config-router)#network 10.0.0.0 Router-CE-A2(config-router)#network 192.168.3.0 Router-CE-A2(config-router)#end Router-CE-A2#
And there must be a matching RIP configuration for this VRF on the PE router:
Router-PE2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router-PE2(config)#router rip Router-PE2(config-router)#version 2 Router-PE2(config-router)#address-family ipv4 vrf NetworkA Router-PE2(config-router-af)#version 2 Router-PE2(config-router-af)#redistribute bgp 100 metric 4 Router-PE2(config-router-af)#network 192.168.3.0 Router-PE2(config-router-af)#exit-address-family Router-PE2(config-router)#exit Router-PE2(config)#router bgp 100 Router-PE2(config-router)#address-family ipv4 vrf NetworkA Router-PE2(config-router-af)#redistribute rip metric 4 Router-PE2(config-router-af)#end Router-PE2#
Discussion
There are a few key points to note in this configuration. First, this just configures RIP between the CE and PE routers at this site. It doesn't configure RIP end-to-end across the MPLS cloud. The customer VRF routing prefixes are carried through the MPLS cloud by BGP. In this case, the customer network is called NetworkA, and the BGP ASN is 100, both of which we previously configured in Recipes 26.1, 26.2, and 26.3. This is important because it means that we could potentially use different routing protocols for the communication between the PE and CE routers at each customer site.
The second important point, which follows from the first one, is that we must only make sure the routing protocol parameters match between the PE and CE routers at this site. In our example, we demonstrate this by setting both routers to RIP Version 2. You could just as easily use RIP Version 1, which we would configure as follows:
Router-CE-A2(config)#router rip Router-CE-A2(config-router)#version 1
In this case, we would have to make the corresponding change to the PE router:
Router-PE2(config)#router rip Router-PE2(config-router)#version 1 Router-PE2(config-router)#address-family ipv4 vrf NetworkA Router-PE2(config-router-af)#version 1
The third important point is that on the PE router, you must be careful to configure the PE-to-CE routing protocol for the required VRF only, and not globally. This is accomplished using the address-family ipv4 vrf command on the PE router:
Router-PE2(config-router)#address-family ipv4 vrf NetworkA
Note, however, that the CE router doesn't know anything about MPLS or VRF tables, so this router uses the same RIP configuration that we saw in Chapter 6.
The next key issue that we need to point out is that we are using redistribution between BGP and RIP on the PE router. This means that we must redistribute from RIP into BGP, as well as from BGP into RIP, as shown in this excerpt:
Router-PE2(config)#router rip Router-PE2(config-router)#address-family ipv4 vrf NetworkA Router-PE2(config-router-af)#redistribute bgp 100 metric 4 Router-PE2(config-router-af)#exit-address-family Router-PE2(config-router)#exit Router-PE2(config)#router bgp 100 Router-PE2(config-router)#address-family ipv4 vrf NetworkA Router-PE2(config-router-af)#redistribute rip metric 4
In this example, we have set a redistribution metric of 4 in both directions. This is not necessary. By default you can use a RIP metric of 1, but it can be useful to give a higher metric to these redistributed routes, particularly when there are other paths to the remote network.
If we now look at the routing table for this VRF on the PE, we see a mixture of RIP and BGP routes:
Router-PE2#show ip route vrf NetworkA Codes: C - connected, S - static, I - IGRP, 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, E - EGP 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 Gateway of last resort is not set B 192.168.57.0/24 [200/4] via 10.0.0.2, 00:01:14 B 192.168.5.0/24 [200/4] via 10.0.0.2, 00:02:14 10.0.0.0/32 is subnetted, 1 subnets R 10.8.8.8 [120/1] via 192.168.3.8, 00:00:21, FastEthernet0/0.2 B 192.168.1.0/24 [200/0] via 10.0.0.2, 03:53:27 B 192.168.2.0/24 [200/0] via 10.0.0.3, 03:53:27 C 192.168.3.0/24 is directly connected, FastEthernet0/0.2 Router-PE2#
And the standard show ip route command on the CE router gives us:
Router-CE-A2#show ip route Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 Gateway of last resort is not set R 192.168.57.0/24 [120/4] via 192.168.3.1, 00:00:17, Ethernet0 R 192.168.5.0/24 [120/4] via 192.168.3.1, 00:00:17, Ethernet0 10.0.0.0/32 is subnetted, 1 subnets C 10.8.8.8 is directly connected, Loopback0 R 192.168.1.0/24 [120/4] via 192.168.3.1, 00:00:17, Ethernet0 R 192.168.2.0/24 [120/4] via 192.168.3.1, 00:00:17, Ethernet0 C 192.168.3.0/24 is directly connected, Ethernet0 Router-CE-A2#
In this example, we are also using RIP to communicate between the CE and PE at Site 1 for Customer A. This is where we are getting the prefixes 192.168.1.0/24 and 192.168.57.0/24. However, it is worth noting that 192.168.57.0/24 is actually on an internal C router that is one hop behind the CE router. But looking at the routing table, you can see that all of the RIP routes have exactly the same metric of 4, which was our redistribution metric. So, because of the redistribution, we have actually lost all metric information from the other sites. In a simple network, like the one in our example, this isn't important, but if there were other links between these sites, it might cause routing problems.
If you need to see real metrics between the sites, then the simplest solution using RIP is to use a static route between the CE and PE routers at each site and create a GRE tunnel between your CE routers. On the first CE router you would create a Tunnel interface, add a static route to the CE router at the other site, and then configure RIP to send updates over the Tunnel interface. Note, however, that this doesn't scale very well if you have a large number of CE sites. Because MPLS implicitly meshes the customer sites that are members of the same VRF, the number of tunnels required for N sites is N(N-1)/2. So this is not always a practical solution:
Router-CE-A1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router-CE-A1(config)#interface Tunnel1 Router-CE-A1(config-if)#ip address 192.168.152.1 255.255.255.252 Router-CE-A1(config-if)#tunnel source 192.168.1.5 Router-CE-A1(config-if)#tunnel destination 192.168.3.8 Router-CE-A1(config-if)#exit Router-CE-A1(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.0 Router-CE-A1(config)#router rip Router-CE-A1(config-router)#version 2 Router-CE-A1(config-router)#network 192.168.5.0 Router-CE-A1(config-router)#network 192.168.152.0 Router-CE-A1(config-router)#exit Router-CE-A1(config)#end Router-CE-A1#
And on the other CE router, you would configure the other end of the tunnel and a static route to go back to the first site:
Router-CE-A2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router-CE-A2(config)#interface Tunnel1 Router-CE-A2(config-if)#ip address 192.168.152.2 255.255.255.252 Router-CE-A2(config-if)#tunnel source 192.168.3.8 Router-CE-A2(config-if)#tunnel destination 192.168.1.5 Router-CE-A2(config-if)#exit Router-CE-A2(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1 Router-CE-A2(config)#router rip Router-CE-A2(config-router)#version 2 Router-CE-A2(config-router)#network 10.0.0.0 Router-CE-A2(config-router)#network 192.168.152.0 Router-CE-A2(config-router)#end Router-CE-A2#
Now when we look at the routing table we see more realistic metrics:
Router-CE-A2#show ip route Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 Gateway of last resort is not set R 192.168.57.0/24 [120/2] via 192.168.152.1, 00:00:23, Tunnel1 R 192.168.5.0/24 [120/1] via 192.168.152.1, 00:00:23, Tunnel1 10.0.0.0/32 is subnetted, 1 subnets C 10.8.8.8 is directly connected, Loopback0 192.168.152.0/30 is subnetted, 1 subnets C 192.168.152.0 is directly connected, Tunnel1 S 192.168.1.0/24 [1/0] via 192.168.3.1 C 192.168.3.0/24 is directly connected, Ethernet0 Router-CE-A2#
For more information on tunnels, please refer to Chapter 12, and for a more detailed example of tunneling between CE routers, please refer to Recipe 26.12.
Finally, it is one of the more interesting quirks of MPLS that this route redistribution between MP-BGP and an IGP on the PE router doesn't behave the way that redistribution normally does. In particular, none of the routes that we redistribute into the IGP appear as external. This will become critically important in situations where you have backup links between your sites because all IGPs prefer internal to external routes by default. If MP-BGP redistributed routes as external, it would be extremely difficult to make a robust IGP design without resorting to tunnels.
See Also
Chapter 6; Chapter 12; Recipe 26.1; Recipe 26.2; Recipe 26.3; Recipe 26.12