Simple BGP Multi-home Topology Part 2 – Originate IGP

In our last session with Simple BGP Multi-Home Topology we’ve managed to get the neighbor peering working based on loopback addresses. Which adds extra stability to the BGP topology.
But in the end we had a somewhat strange output:

BGP-Topo

ISP1#sh ip bgp         
BGP table version is 13, local router ID is 3.3.3.3
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
*> 192.168.1.0      1.1.1.1                  0             0 64200 ?
*> 192.168.2.0      1.1.1.1                  0             0 64200 ?
*> 192.168.3.0      1.1.1.1                  0             0 64200 ?
*> 192.168.4.0      1.1.1.1                  0             0 64200 ?

BGP apparently doesn’t know where the prefixes originate from. This makes troubleshooting hard and it takes extra time to figure out where’s they come from. Since we’re building the topology from scratch we are going to add that info to the BGP Topology table.

Checking the interface table on CUSTOMER leads to the following:

CUSTOMER#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 172.16.1.2 YES NVRAM up up
FastEthernet0/1 172.16.1.4 YES NVRAM up up
Loopback1 1.1.1.1 YES NVRAM up up
Loopback2 1.1.1.2 YES NVRAM up up
Loopback101 192.168.1.1 YES NVRAM up up
Loopback102 192.168.2.1 YES NVRAM up up
Loopback103 192.168.3.1 YES NVRAM up up
Loopback104 192.168.4.1 YES NVRAM up up

And the BGP configuration:

CUSTOMER#sh run | sec bgp
router bgp 64200
 no synchronization
 bgp log-neighbor-changes
 redistribute ospf 1
 neighbor 3.3.3.3 remote-as 64310
 neighbor 3.3.3.3 ebgp-multihop 2
 neighbor 3.3.3.3 update-source Loopback1
 neighbor 4.4.4.4 remote-as 64510
 neighbor 4.4.4.4 ebgp-multihop 2
 neighbor 4.4.4.4 update-source Loopback2
 no auto-summary

Hey, we are distributing routes from OSPF into BGP!!!!
Let’s check the ospf config:

CUSTOMER#sh run | sec ospf
router ospf 1
 log-adjacency-changes
 network 192.168.1.0 0.0.0.255 area 100
 network 192.168.2.0 0.0.0.255 area 100
 network 192.168.3.0 0.0.0.255 area 100
 network 192.168.4.0 0.0.0.255 area 100
 redistribute ospf 1

Now we know these network originate from CUSTOMER we can give them a originate igp. We can use a route-map for this:

!
route-map CHANGE-ORIGIN permit 10
 match ip address 60
 set origin igp
!
access-list 60 permit any
!
router bgp 64200
redistribute ospf 1 route-map CHANGE-ORIGIN
!
!And there is our friend Debug applying the changes:
*Mar  1 02:16:53.171: BGP: Applying map to find origin for 192.168.4.0/24
*Mar  1 02:16:53.171: BGP: Applying map to find origin for 192.168.1.0/24
*Mar  1 02:16:53.171: BGP: Applying map to find origin for 192.168.2.0/24
*Mar  1 02:16:53.171: BGP: Applying map to find origin for 192.168.3.0/24

Let’s check ISP1 again:
>> Before the change

ISP1#sh ip bgp         
BGP table version is 21, local router ID is 3.3.3.3
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
*> 192.168.1.0      1.1.1.1                  0             0 64200 ?
*> 192.168.2.0      1.1.1.1                  0             0 64200 ?
*> 192.168.3.0      1.1.1.1                  0             0 64200 ?
*> 192.168.4.0      1.1.1.1                  0             0 64200 ?

>> After the change

ISP1#sh ip bgp
BGP table version is 25, local router ID is 3.3.3.3
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
*> 192.168.1.0      1.1.1.1                  0             0 64200 i
*> 192.168.2.0      1.1.1.1                  0             0 64200 i
*> 192.168.3.0      1.1.1.1                  0             0 64200 i
*> 192.168.4.0      1.1.1.1                  0             0 64200 i

Now when one of your colleagues needs to troubleshoot he or she can see directly where the prefix are originating from.

Access-list 60 has two functions: 1) redistributing prefixes and 2) add origin IGP.
You can also change access-list 60 to filter down the redistributed prefixes.

Advertisements

One thought on “Simple BGP Multi-home Topology Part 2 – Originate IGP

  1. Pingback: Simple BGP Multi-home Topology Part 1 – Neighboring with loopback adresses | The IT Networking Alliance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s