cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3596
Views
0
Helpful
4
Replies

IOS XR AS-PAth Prepending route-policy

 

Sorry I put the wront policy in my question; here is my corrected version:

Hi,

we are multihomed with two diefferent ISPs (i.e. ISP1 with AS 1100, ISP2 with AS 2200); our own AS is i.e. 5000. We are running  IOS XR 6.6.3 using the following configuration

router bgp 5000
address-family ipv4 unicast
neighbor 10.100.83.1
remote-as 1100
ebgp-multihop 2
update-source Loopback0
address-family ipv4 unicast

route-policy rp-filter-out out

neighbor 10.200.80.1
remote-as 2200
ebgp-multihop 2
update-source Loopback0
address-family ipv4 unicast

route-policy rp-filter-out out


rout-policy filter:

route-policy rp-filter-out
  # bgp out policy
  if as-path in (ios-regex '^$') then
    pass
  endif
end-policy

 

We want to add an AS PATH prepend to our peering with ISP1(AS 1100); is the following RP correct or not ?

route-policy rp-asp-prepend
# prepend 5000 5000
prepend as-path 5000 2
end-policy
 
route-policy rp-filter-out
# bgp out policy
if as-path is-local and as-path neighbor-is '1100' then
apply rp-asp-prepend
pass
elseif as-path is-local then
  pass
else
  drop
end-policy
1 Accepted Solution

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

Hi @MANFRED LIEBCHEN ,

 

Your RP will not accomplish what you want, as the following condition applies to the as-path in the route, rather than the peer-as.

 

as-path neighbor-is '1100'

 

The following RP should work for you. Please test it in you lab first.

 

route-policy rp-filter-out($peeras)
var globalVar1 $peeras
if globalVar1 eq 1100 and as-path is-local then
prepend as-path 5000 2
else
if as-path is-local then
pass
endif
endif
end-policy
!

router bgp 5000
neighbor 10.100.83.1
address-family ipv4 unicast

route-policy rp-filter-out(1100) out

neighbor 10.200.80.1
address-family ipv4 unicast

route-policy rp-filter-out(2200) out


Regards,

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

4 Replies 4

With out pass the route will drop not advertise even if it not modify.
by the way this guide is wonderful for IOS XR it have many many LAB.

https://www.ciscolive.com/c/dam/r/ciscolive/us/docs/2019/pdf/5eU6DfQV/LTRARC-2002-LG.pdf

 

Hi

  Sticking with Cisco configuration guide example, you dont need:

 

The following example shows how to prepend the autonomous system number 666.1 to the AS path three times:

RP/0/0/CPU0:router(config-rpl)# prepend as-path 666.1 3 

The following example shows how to prepend the autonomous system number 666.0 to the AS path one time:

RP/0/0/CPU0:router(config-rpl)# prepend as-path 666.0 1

Harold Ritter
Cisco Employee
Cisco Employee

Hi @MANFRED LIEBCHEN ,

 

Your RP will not accomplish what you want, as the following condition applies to the as-path in the route, rather than the peer-as.

 

as-path neighbor-is '1100'

 

The following RP should work for you. Please test it in you lab first.

 

route-policy rp-filter-out($peeras)
var globalVar1 $peeras
if globalVar1 eq 1100 and as-path is-local then
prepend as-path 5000 2
else
if as-path is-local then
pass
endif
endif
end-policy
!

router bgp 5000
neighbor 10.100.83.1
address-family ipv4 unicast

route-policy rp-filter-out(1100) out

neighbor 10.200.80.1
address-family ipv4 unicast

route-policy rp-filter-out(2200) out


Regards,

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

Thanks very much, your hint works fine

Review Cisco Networking for a $25 gift card