Tuesday, June 16, 2009

Router-ID

Router-id is important :

BGP & OSPF router-id & Synchonization Rule :

ALL router running OSPF
R3(300)=====R4(100)=======R5(100)
dis syn dis syn

R5
router bgp 100
synchronization ( only apply to IBGP)
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 update-source Loopback5
no auto-summary

R4
router bgp 100
synchronization
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 update-source Loopback4
neighbor 172.16.34.3 remote-as 300
no auto-summary

R3 (ASBR)
router ospf 1
log-adjacency-changes
redistribute connected subnets

int lo3
ip add 3.3.3.3 255.255.255.0

router bgp 300
no synchronization
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
neighbor 172.16.34.4 remote-as 100
no auto-summary
==================================================
Now Check the routing table : 3.3.3.0 is advertised as expected :
R4#sh ip bgp
BGP table version is 2, local router ID is 4.4.4.4
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
*> 3.3.3.0/24 172.16.34.3 0 0 300 i
R4#
==========================================================
Received by R5 as expected :
R5#sh ip bgp
BGP table version is 1, local router ID is 5.5.5.5
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
* i3.3.3.0/24 172.16.34.3 0 100 0 300 i

R5#sh ip bgp 3.3.3.0
BGP routing table entry for 3.3.3.0/24, version 0
Paths: (1 available, no best path)
Not advertised to any peer
300
172.16.34.3 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, internal, not synchronized ( hum....)

Per Synchonization rule router should have learn the route through IGP( in our Case OSPF)

Let's check :

R5#sh ip route 3.3.3.0
Routing entry for 3.3.3.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 65
Last update from 172.17.45.4 on FastEthernet0/0, 00:11:46 ago
Routing Descriptor Blocks:
* 172.17.45.4, from 3.3.3.3, 00:11:46 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1

Hum.. Route is indeed learn by IGP( OSPF)


Well, Not only route need to learn through IGP , but Router-id needs to match as well:
In our Case ASBR Router ID(3.3.3.3) & IBGP peer Router-id (4.4.4.4) not matching.
Please not that this is trying to match router-id on the route(3.3.3.0) learn & with different routing protocol :
R4

router ospf 1
router-id 44.44.44.44 ( I have to change router-id otherwise it will give issue with OSPF neighbor between R3 & R4)
log-adjacency-changes

router bgp 100
synchronization
bgp router-id 4.4.4.4 ( IBGP router-id)
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 update-source Loopback4
neighbor 172.16.34.3 remote-as 300
no auto-summary

R3
router ospf 1
router-id 4.4.4.4 ( this is not typo I am setting ASBR router id to match IBGP router-id)
log-adjacency-changes
redistribute connected subnets
router bgp 300
no synchronization
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
neighbor 172.16.34.4 remote-as 100
no auto-summary
==========================================================================
After chaning the this router-id
R5#sh ip bgp 3.3.3.0
BGP routing table entry for 3.3.3.0/24, version 6
Paths: (1 available, best #1, table Default-IP-Routing-Table, RIB-failure(17))
Flag: 0x820
Not advertised to any peer
300
172.16.34.3 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, internal, synchronized, best

R5#sh ip route 3.3.3.0
Routing entry for 3.3.3.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 65
Last update from 172.17.45.4 on FastEthernet0/0, 00:00:07 ago
Routing Descriptor Blocks:
* 172.17.45.4, from 4.4.4.4, 00:00:07 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1

No comments: