bgp route-map setting

Answered Question
May 14th, 2007
User Badges:

Dear Sir,


I config the router with BGP and and try to announce the provider A routes. What I want to do is that


1. announce the 192.68.83.0 to provider A with longer as-path

2. annouce the 192.68.80.0, 192.68.81.0 and 192.68.82.0 routes to proiders with normal as-path

3. announce the routes that from my AS number only

4. deny all routes which is NOT from my AS


there are two setting, do both of them can meeting this requirement? which one is better? Please advices. Thanks


Best regards

CM Leung


------- router config ----


access-list 40 permit 192.68.83.0 0.0.0.255


!

access-list 50 permit 192.68.80.0 0.0.0.255

access-list 50 permit 192.68.81.0 0.0.0.255

access-list 50 permit 192.68.82.0 0.0.0.255


ip as-path access-list 100 permit ^$

!

ip as-path access-list 200 permit ^$

ip as-path access-list 210 deny .*


------ setting A -----

!

route-map Set_ASN_provider_a permit 10

match ip address 40

set as-path prepend 235 235 235 235 235 235

!

route-map Set_ASN_provider_a permit 20

match ip address 50

!

route-map Set_ASN_provider_a permit 30

match as-path 200

!

!

route-map Set_ASN_provider_a deny 40

!


---setting B ---



route-map Set_ASN_provider_a permit 10

match ip address 40

set as-path prepend 235 235 235 235 235 235

!

route-map Set_ASN_provider_a permit 20

match ip address 50

!

route-map Set_ASN_provider_a permit 30

match as-path 200

!

!

route-map Set_ASN_provider_a permit 40

match as-path 210

!


Correct Answer by Harold Ritter about 9 years 11 months ago

This will do it. You could simplify the inbound route-map a bit by removing the as-path list to match the first AS, as this first AS in the AS path will always be the AS of the provider. You can also remove the statement where you set the local-pref to 200 and let it default to 100, which is also less than the 300 on the other side.


route-map SetLocalPref_provider_a permit 10

set local-preference 300

!

route-map SetLocalPref_provider_b permit 10

match ip address 35

set local-preference 350

route-map SetLocalPref_provider_b permit 20


Hope this helps,



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
mohammedmahmoud Mon, 05/14/2007 - 10:36
User Badges:
  • Green, 3000 points or more

Hi,


Without adding any route-map statements after the

"route-map Set_ASN_provider_a permit 30

match as-path 200 "


The route-map will deny any routes that didn't match the above statements implicitly by default without the need to add any statement to explicit deny.



HTH, please do rate all helpful replies,

Mohammed Mahmoud.

leungcm Thu, 05/17/2007 - 07:45
User Badges:

Dear Sir,


following is the full config of bgp setting. we would like "202.43.220.0" traffic go provider B, other than that, go second provider. Any comments on it?


Best regards

CM Leung


----


router bgp 38

bgp log-neighbor-changes

!

! provider_a

neighbor 192.68.1.1 remote-as 1111

neighbor 192.68.1.1 description connect to provider_a bgp

neighbor 192.68.1.1 version 4

!

! provider_b

neighbor 192.68.2.2 remote-as 2222

neighbor 192.68.2.2 description connect to provider_b

neighbor 192.68.2.2 version 4

!

!

address-family ipv4

neighbor 192.68.1.1 activate

neighbor 192.68.1.1 soft-reconfiguration inbound

neighbor 192.68.1.1 route-map SetLocalPref_provider_a in

neighbor 192.68.1.1 route-map Set_ASN_provider_a out

!

neighbor 192.68.2.2 activate

neighbor 192.68.2.2 soft-reconfiguration inbound

neighbor 192.68.2.2 route-map SetLocalPref_provider_b in

neighbor 192.68.2.2 route-map Set_ASN_provider_b out

!

no auto-summary

no synchronization

network 172.16.180.0

network 172.16.181.0

network 172.16.182.0

network 172.16.183.0

exit-address-family

!

!

ip as-path access-list 100 permit ^$

!

!announce the route to provider_a

ip as-path access-list 200 permit ^$

!

ip as-path access-list 20 permit ^2222_

ip as-path access-list 10 permit ^1111_

!

!

access-list 35 permit 202.43.220.0 0.0.0.255

!

access-list 40 permit 172.16.183.0 0.0.0.255

!

access-list 50 permit 172.16.180.0 0.0.0.255

access-list 50 permit 172.16.181.0 0.0.0.255

access-list 50 permit 172.16.182.0 0.0.0.255

!

!

!

route-map SetLocalPref_provider_a permit 10

match as-path 10

set local-preference 300

!

route-map SetLocalPref_provider_a permit 20

!

!

!

route-map SetLocalPref_provider_b permit 10

match ip address 35

set local-preference 350

!

!

route-map SetLocalPref_provider_b permit 20

match as-path 20

set local-preference 200

!

route-map SetLocalPref_provider_b permit 30

!

!

route-map Set_ASN_provider_a permit 10

match ip address 40

set as-path prepend 38 38 38 38 38 38

!

route-map Set_ASN_provider_a permit 20

match ip address 50

!

route-map Set_ASN_provider_a permit 30

match as-path 200

!

!

!

!

route-map Set_ASN_provider_b permit 10

match ip address 40

!

route-map Set_ASN_provider_b permit 20

match ip address 50

set as-path prepend 38 38 38 38 38 38

!

route-map Set_ASN_provider_b permit 30

match as-path 100

!


-----

Correct Answer
Harold Ritter Thu, 05/17/2007 - 10:23
User Badges:
  • Cisco Employee,

This will do it. You could simplify the inbound route-map a bit by removing the as-path list to match the first AS, as this first AS in the AS path will always be the AS of the provider. You can also remove the statement where you set the local-pref to 200 and let it default to 100, which is also less than the 300 on the other side.


route-map SetLocalPref_provider_a permit 10

set local-preference 300

!

route-map SetLocalPref_provider_b permit 10

match ip address 35

set local-preference 350

route-map SetLocalPref_provider_b permit 20


Hope this helps,



Actions

This Discussion