Sunday, August 2, 2015

Unable to advertise static routes via MP BGP to PE routers

Wanted to quickly post this MP BGP MPLS config I had trouble with here. Below is the Cisco support thread that covers it.



I wanted to do a straight bgp only L3 service across my ISP PEs....using different AS for each customer site. No other core IGP is used- just BGP and static routes to form the neighborships between PE-R8 and PE-R9. In order to get full end to end connectivity for the site networks, I had to advertise the transit networks between the PE routers and the P router. (the .140 and .144) The key to get them advertised out to the CEs was first get define the static routes on the PE in the global routing table. Then redistribute those into the ipv4 BGP table. THEN...import those routes into the customer vrf using the import command that references a route-map, that references an ip prefix-list to scope the routes. After all that- they finally appeared in the vpnv4 address family on the PE routers, and in BGP on the vrf attached CEs
This was the only way I could get them to work - maybe there's an easier way !


Unable to advertise static routes via MP BGP to PE routers


PE-R8#show ip bgp
  Network          Next Hop            Metric LocPrf Weight Path
 r>i 8.8.8.8/32       152.177.58.146           0    100      0 ?
 *>  9.9.9.9/32       152.177.58.141           0         32768 ?
 r>i 152.177.58.140/30
                             152.177.58.146           0    100      0 ?
 *>  152.177.58.144/30
                             152.177.58.141          
0         32768 ?
show ip bgp all
For address family: VPNv4 Unicast
Route Distinguisher: 120:120 (default for vrf TGI)
Import Map: IMPORT_STATIC_MAP, Address-Family: IPv4 Unicast, Pfx Count/Limit: 1/1000
 *>  10.7.1.0/24          152.177.58.138    0             0 65002 i
 *>i 10.24.20.0/22      9.9.9.9                  0    100      0 65001 i
 *>i 51.64.56.252/30  9.9.9.9                  0    100      0 65001 i
 *>i 130.148.200.126/32
                                  9.9.9.9                  0    100      0 65001 i
 *>i 152.177.58.132/30
                                 9.9.9.9                  0    100      0 65001 i
 r>  152.177.58.136/30
                                152.177.58.138           0             0 65002 i
 *>  152.177.58.144/30
                       152.177.58.141          
0         32768 ?


So..to sum up...here's the config that worked: (for PE-R8....R9 config'd similarly)

ip vrf TGI
rd 120:120
import ipv4 unicast map IMPORT_STATIC_MAP
route-target export 20:20
route-target import 20:20

router bgp 65000
bgp router-id 8.8.8.8
bgp log-neighbor-changes
neighbor 9.9.9.9 remote-as 65000
neighbor 9.9.9.9 update-source Loopback8
!
address-family ipv4
redistribute static
neighbor 9.9.9.9 activate
exit-address-family
!
address-family vpnv4
neighbor 9.9.9.9 activate
neighbor 9.9.9.9 send-community both
exit-address-family
!
address-family ipv4 vrf TGI
neighbor 152.177.58.138 remote-as 65002
neighbor 152.177.58.138 activate
exit-address-family

ip route 9.9.9.9 255.255.255.255 152.177.58.141
ip route 152.177.58.144 255.255.255.252 152.177.58.141
!
!
ip prefix-list IMPORT_STATIC seq 5 permit 152.177.58.144/30
!
route-map IMPORT_STATIC_MAP permit 10
match ip address prefix-list IMPORT_STATIC