Tuesday, July 20, 2010

Find AS-Number BGP Neighbor without Ask Administrator

I have topology with 2 router (router A & router B) :

(A) 172.16.0.1 ---- 172.16.0.2 (B)
ASN.65000 ---- ASN.65535

- (A) already config BGP with
router bgp 65000
neighbor 172.16.0.2 remote-as 65535

- (B) want to connect with A via BGP
- (B) not yet get information ASN (A)
- (B) how to find AS-Number (A) without ask administrator ?

1. config AS-Number (B)
router bgp 65535 ---> ASN (B)

2. config neighbor valid IP (A) & whatever AS-Number (A)
neighbor 172.16.0.1 remote-as 1 ---> ASN.1 is whatever AS-Number, just trigger log error

3. config bgp-log
router bgp 65535
bgp log-neighbor-changes ---> to show notification log error

- in router (B) will generate log :
%BGP-3-NOTIFICATION: sent to neighbor 172.16.0.1 2/2 (peer in wrong AS) 2 bytes FDE8

chars FDE8 is hexadecimal AS-Number (A)
convert hexadecimal FDE8 to decimal = 65000

- change your config
neighbor 172.16.0.1 remote-as 65000

- in router (B) will generate log :
%BGP-5-ADJCHANGE: neighbor 172.16.0.1 Up

Now you can find AS-Number BGP neighbor without ask administrator ;)

No comments: