GNS3-Cisco Configuration: Inter-vrf Routing with MP-BGP

Address-Family in BGP has given immense power to bgp, the most important thing is simplicity of the solutions. One example of this is inter-vrf routing with the help of address family. Following is the configuration.

Tools : GNS3, Router: IOSv Router.

In the above diag Cus1 and Cus2 are two separate vrfs on PE router. These two vrfs connect to Cus1 and Cus2 router. We need to make sure that we have connection between these two different sites. This will be achieved with the help of BGP in this post. Below are the configuration. I have highlighted the critical config parts.

hostname Cus1
!
 interface GigabitEthernet0/0
  ip address 192.168.10.1 255.255.255.252
!
 router bgp 200
  neighbor 192.168.10.2 remote-as 100

 hostname Cus2
 !
 interface GigabitEthernet0/0
  ip address 20.20.20.2 255.255.255.252
!
 router bgp 400
  neighbor 20.20.20.1 remote-as 100


hostname PE
 !
vrf definition Cus1
  rd 100:2
  route-target export 100:2
  route-target import 100:1
  !        
  address-family ipv4
  exit-address-family
!
 vrf definition Cus2
  rd 100:1
  route-target export 100:1
  route-target import 100:2
  !
  address-family ipv4
  exit-address-family
!
interface GigabitEthernet0/0
  vrf forwarding Cus1
  ip address 192.168.10.2 255.255.255.252
 !
 interface GigabitEthernet0/2
  vrf forwarding Cus2
  ip address 20.20.20.1 255.255.255.252
 !
router bgp 100
!
  address-family ipv4 vrf Cus1
   redistribute connected
   neighbor 192.168.10.1 remote-as 200
   neighbor 192.168.10.1 activate
   neighbor 192.168.10.1 send-community
  exit-address-family
  !
  address-family ipv4 vrf Cus2
   redistribute connected
   neighbor 20.20.20.2 remote-as 400
   neighbor 20.20.20.2 activate
   neighbor 20.20.20.2 send-community
  exit-address-family
 !         

You can verify the routes on both the router’s to make sure if both are learning each others subnet.

Cus1#sh ip route bgp 
 Codes: L - local, 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, H - NHRP, l - LISP
        a - application route
        + - replicated route, % - next hop override, p - overrides from PfR
 Gateway of last resort is not set
   20.0.0.0/30 is subnetted, 1 subnets
 B        20.20.20.0 [20/0] via 192.168.10.2, 00:32:09
 Cus1#

Cus2#sh ip route bgp 
 Codes: L - local, 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, H - NHRP, l - LISP
        a - application route
        + - replicated route, % - next hop override, p - overrides from PfR
 Gateway of last resort is not set
   192.168.10.0/30 is subnetted, 1 subnets
 B        192.168.10.0 [20/0] via 20.20.20.1, 00:33:03
 Cus2#

Further you can verify the connectivity with ping.

Cus1#ping 20.20.20.1 rep 10
 Type escape sequence to abort.
 Sending 10, 100-byte ICMP Echos to 20.20.20.1, timeout is 2 seconds:
 !!!!!!!!!!
 Success rate is 100 percent (10/10), round-trip min/avg/max = 1/3/18 ms
 Cus1#

Stay tuned for more posts like this.


Leave a Reply