1

I am trying to understand the difference between address-family vpnv4 and address-family ipv4 vrf

So to test the scenario, i connected 2 routers(R1 and R2) linearly back to back. R1 has the loopback as 11.11.11.11

R2 has the loopback address as 22.22.22.22

On R2, i have the vrf TEST22. On R2, i also have a static route to network 100.0.0.0 in vrf TEST22 as shown below

ip route vrf TEST22 100.0.0.0 255.0.0.0 null 0

I want this route to be learnt on R1.

On R1, i have the vrf TEST11.

Configuration and command outputs on R1:

R1#sho ip bgp vpnv4 all summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2      17      16        1    0    0 00:03:18        0
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip vrf TEST11
R1(config-vrf)#route
R1(config-vrf)#route-target im
R1(config-vrf)#route-target import 2:2
R1(config-vrf)#end
R1#
*Mar  1 00:20:32.703: %SYS-5-CONFIG_I: Configured from console by console
R1#sho ip bgp vpnv4 all summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2      19      18        1    0    0 00:04:04        0
R1#sho ip bgp vpnv4 all summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2      19      18        1    0    0 00:04:06        0

R1#
R1#sho run | sec vrf
ip vrf TEST11
 rd 1:1
 route-target import 2:2
 address-family ipv4 vrf TEST11
  no synchronization
R1#
R1#
R1#sho ip bgp vpnv4 all summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 3, main routing table version 3
2 network entries using 280 bytes of memory
2 path entries using 136 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
1 BGP extended community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 712 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 15 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2      20      18        3    0    0 00:04:42        1
R1#
R1#


R1#sho ip bgp vpnv4 vrf TEST11
BGP table version is 3, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf TEST11)
*> 100.0.0.0        22.22.22.22            100             0 2 ?
R1#E{M'}T
R1#p}
R1#
R1#
R1#ter len 0
R1#sho run | sec bgp
router bgp 1
 bgp log-neighbor-changes
 neighbor 22.22.22.22 remote-as 2
 neighbor 22.22.22.22 ebgp-multihop 2
 neighbor 22.22.22.22 update-source Loopback0
 !
 address-family ipv4
  neighbor 22.22.22.22 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 22.22.22.22 activate
  neighbor 22.22.22.22 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf TEST11
  no synchronization
 exit-address-family
R1#
R1#
R1#sho run | sec vrf
ip vrf TEST11
 rd 1:1
 route-target import 2:2
 address-family ipv4 vrf TEST11
  no synchronization
R1#
R1#
R1#sho ip bgp sum
R1#sho ip bgp summary
BGP router identifier 11.11.11.11, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2      27      25        1    0    0 00:11:06        0
R1#


R1#sho ip bgp vpnv4 vrf TEST11 summary


R1#
R1#sho 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

Gateway of last resort is not set

C    1.0.0.0/8 is directly connected, FastEthernet0/0
S    22.0.0.0/8 is directly connected, FastEthernet0/0
C    11.0.0.0/8 is directly connected, Loopback0
R1#
R1#sho ip route vr
R1#sho ip route vrf TEST11

Routing Table: TEST11
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

Gateway of last resort is not set

B    100.0.0.0/8 [20/100] via 22.22.22.22, 00:07:57
R1#
R1#sho ip bgp vpn
R1#sho ip bgp vpnv4 vr
R1#sho ip bgp vpnv4 vrf TEST11
BGP table version is 3, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf TEST11)
*> 100.0.0.0        22.22.22.22            100             0 2 ?
R1#

Configuration and command output on R2:

R2#
R2#
R2#sho run | sec router bgp
router bgp 2
 bgp log-neighbor-changes
 neighbor 11.11.11.11 remote-as 1
 neighbor 11.11.11.11 ebgp-multihop 2
 neighbor 11.11.11.11 update-source Loopback0
 !
 address-family ipv4
  neighbor 11.11.11.11 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 11.11.11.11 activate
  neighbor 11.11.11.11 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf TEST22
  redistribute static metric 100
  no synchronization
 exit-address-family
R2#
R2#
R2#sho ip bgp summ
R2#sho ip bgp summary
BGP router identifier 1.1.1.2, local AS number 2
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4     1      68      70        1    0    0 00:54:37        0
R2#
R2#
R2#sho ip bgp vpn
R2#sho ip bgp vpnv4 vr
R2#sho ip bgp vpnv4 vrf TEST22
BGP table version is 4, local router ID is 1.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 2:2 (default for vrf TEST22)
*> 100.0.0.0        0.0.0.0                100         32768 ?
R2#
R2#
R2#sho run | sec vrf
ip vrf TEST22
 rd 2:2
 route-target export 2:2
 address-family ipv4 vrf TEST22
  redistribute static metric 100
  no synchronization
ip route vrf TEST22 100.0.0.0 255.0.0.0 Null0
R2#
R2#sho ip bgp vpn
R2#sho ip bgp vpnv4 al
R2#sho ip bgp vpnv4 all summ
R2#sho ip bgp vpnv4 all summary
BGP router identifier 1.1.1.2, local AS number 2
BGP table version is 4, main routing table version 4
1 network entries using 140 bytes of memory
1 path entries using 68 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP extended community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of memory
BGP using 512 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 15 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4     1      71      73        4    0    0 00:57:28        0
R2#
R2#
R2#

Q1:As you see R1, learns the route 100.0.0.0 in the vrf TEST11. Even though i did not activate the neighbor 1.1.1.1 under address-family ipv4 vrf <vrf name>, but still R1 learns that route. How? Is the address-family vpnv4 acting as the transport carrier for that route?

Q2:In another scenario, i removed the neighbor from the vpnv4 address family on both R1 and R2 as seen below

On R1

    R1#sho run | sec router bgp
router bgp 1
 bgp log-neighbor-changes
 neighbor 22.22.22.22 remote-as 2
 neighbor 22.22.22.22 ebgp-multihop 2
 neighbor 22.22.22.22 update-source Loopback0
 !
 address-family ipv4
  neighbor 22.22.22.22 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family ipv4 vrf TEST22
  neighbor 22.22.22.22 remote-as 2
  neighbor 22.22.22.22 ebgp-multihop 2
  neighbor 22.22.22.22 update-source Loopback0
  neighbor 22.22.22.22 activate
  no synchronization
 exit-address-family
 !
 address-family ipv4 vrf TEST11
  no synchronization
 exit-address-family
R1#sho ip bgp vpnv4 vrf TEST22 summary | b Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2       0       0        0    0    0 never    Active
R1#
R1#sho run | sec vrf
ip vrf TEST11
 rd 1:1
 route-target import 2:2
ip vrf TEST22
 rd 1:2
 route-target import 2:2
 address-family ipv4 vrf TEST22
  neighbor 22.22.22.22 remote-as 2
  neighbor 22.22.22.22 ebgp-multihop 2
  neighbor 22.22.22.22 update-source Loopback0
  neighbor 22.22.22.22 activate
  no synchronization
 address-family ipv4 vrf TEST11
  no synchronization
R1#

R1#sho ip bgp vpnv4 vrf TEST22 summary | b Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.22     4     2       0       0        0    0    0 never    Active
R1#

R1#sho ip bgp vpnv4 vrf TEST22

R1#

On R2:

R2#sho run | sec bgp
router bgp 2
 bgp log-neighbor-changes
 neighbor 11.11.11.11 remote-as 1
 neighbor 11.11.11.11 ebgp-multihop 2
 neighbor 11.11.11.11 update-source Loopback0
 !
 address-family ipv4
  neighbor 11.11.11.11 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family ipv4 vrf TEST22
  redistribute static metric 10
  neighbor 11.11.11.11 remote-as 1
  neighbor 11.11.11.11 ebgp-multihop 2
  neighbor 11.11.11.11 update-source Loopback0
  neighbor 11.11.11.11 activate
  no synchronization
 exit-address-family
R2#
R2#sho run | i null
R2#sho run | i route
ip route 11.0.0.0 255.0.0.0 FastEthernet0/0
ip route vrf TEST22 100.0.0.0 255.0.0.0 Null0
R2#
R2#
R2#sho ip bgp vpnv4 vrf TEST22 summary | b Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4     1       0       0        0    0    0 never    Active
R2#sho ip bgp summ
R2#sho ip bgp summary | b Neigh
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.11     4     1     203     205        1    0    0 00:01:42        0
R2#

As you see, on R1, the route to 100.0.0.0 no longer exists. Moreover, the BGP vrf peering is in Active state. Why is this happening ? is there any relation between address-family vpnv4 and address-family ipv4 vrf <vrf name>? Is it mandatory for address-family vpnv4 to have neighbor activated for vrf routes to be exchanged?

6
  • In your last two configurations, you have two different VRFs: TEST11 on R1 and TEST22 on R2.
    – Ron Maupin
    Commented May 21, 2017 at 14:22
  • @RonMaupin i have created the same vrf on R1 and R2 now, please see updated config
    – fsociety
    Commented May 21, 2017 at 15:01
  • Did you then reset BGP? After you make changes to BGP, you must often reset it in order for it to start working correctly.
    – Ron Maupin
    Commented May 21, 2017 at 15:04
  • @RonMaupin yes i did, thrice (still in Active state), reachability to loopbacks is ok, ping works fine
    – fsociety
    Commented May 21, 2017 at 15:05
  • OK, then advertise something in the VRF.
    – Ron Maupin
    Commented May 21, 2017 at 15:07

2 Answers 2

5
  1. VPNv4 is the "transport". Your VRF route-targets match on both devices. Long story short, RT is extcommunity that is sent over VPNv4 session in BGP update. If one of local import RTs matches received extcommunity, routes are being imported in VRF with this RT configured. Actually VPNv4 is quite complex and complete explanation is beyond the scope of this site.

  2. VPNv4 is not required in order to run routing protocol inside VRF. Cisco calls it VRF-lite. Your problem with Active state here is related to routing.

    address-family ipv4
     neighbor 11.11.11.11 activate
     no auto-summary
     no synchronization
    exit-address-family
    !
    address-family ipv4 vrf TEST22
     redistribute static metric 10
     neighbor 11.11.11.11 remote-as 1
     neighbor 11.11.11.11 ebgp-multihop 2
     neighbor 11.11.11.11 update-source Loopback0
     neighbor 11.11.11.11 activate
     no synchronization
    exit-address-family
    

Both IPv4 and IPv4 vrf TEST22 address families have Lo0 as the source. As long as IPv4 adjacency is Established I assume Lo0 is not in VRF. That makes your BGP source inaccessible.

0

This is quite messed up. When we talk about MP-BGP here we need to have the basics right.

To start off, vpnv4 = ipv4 + RD + RT.

As long as you don't have a interface under a VRF (NAME), you can't call it in the neighbor statement in AF ipv4 vrf (NAME).

BGP forms only one session with with one IP irrespective of the AF. you can have your IP 11.11.11.11 globally and you can decide on what AF you can have the routes exchanged, either it can be in IPV4 AF or VPNV4 AF but not in ipv4 vrf(NAME).

If you are going to advertise VPNV4 routes then you need to have "vrf definition" configured globally, in which you can have your neighbor statements under AF IPV4 and VPNV4. If your intension is just to run VRF-Lite, then you can have "ip vrf" configured globally.

Note : If you are going for "vrf definition" then keep an eye on BGP's global statement "no bgp default ipv4-unicast".

Cheers,

Raj.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.