cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
433
Views
0
Helpful
3
Replies

bgp route-map setting

leungcm
Level 1
Level 1

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

!

1 Accepted Solution

Accepted Solutions

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,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

3 Replies 3

mohammedmahmoud
Level 11
Level 11

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
Level 1
Level 1

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

!

-----

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,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
Review Cisco Networking products for a $25 gift card