Jump to content
Калькуляторы

mikrotik bgp as-override

Есть небольшой вопрос по принципам работы bgp as-override в микротиках.

Вот типовой конфиг, на рисунке схема подключения: post-120330-064773500 1399288453_thumb.jpeg

 

RB450

AS100

 

/routing bgp instance
name="default" as=100 router-id=1.1.1.1 
     redistribute-connected=yes redistribute-static=yes redistribute-rip=no 
     redistribute-ospf=no redistribute-other-bgp=no out-filter="" 
     client-to-client-reflection=no ignore-as-path-len=no routing-table=""

/routing bgp peer
name="RB750" instance=default 
    remote-address=1.1.1.2 remote-as=200 tcp-md5-key="" 
    nexthop-choice=default multihop=no route-reflect=no hold-time=15s 
    ttl=default in-filter=RB750_in out-filter=RB750_out 
    address-families=ip default-originate=never remove-private-as=no 
    as-override=yes passive=no use-bfd=no

/routing filter
chain=RB750_out prefix=0.0.0.0/0 prefix-length=16-32 invert-match=no 
    action=accept set-bgp-prepend-path=""
chain=RB750_in prefix=0.0.0.0/0 prefix-length=16-32 invert-match=no
    action=discard set-bgp-prepend-path=""
chain=RB750_in prefix=0.0.0.0/0 invert-match=no action=accept 
    set-bgp-weight=300 set-bgp-prepend-path=""

 

RB750

AS200

 

/routing bgp instance
name="default" as=200 router-id=2.2.2.1
     redistribute-connected=yes redistribute-static=yes redistribute-rip=no 
     redistribute-ospf=no redistribute-other-bgp=no out-filter="" 
     client-to-client-reflection=no ignore-as-path-len=no routing-table="" 

/routing bgp peer
name=RB450 instance=default remote-address=1.1.1.1
remote-as=100 tcp-md5-key="" nexthop-choice=default multihop=no route-reflect
=no hold-time=15s ttl=default in-filter=RB450_in out-filter=RB450_out
address-families=ip default-originate=always remove-private-as=no 
as-override=yes passive=no use-bfd=no 

name=cisco instance=default remote-address=2.2.2.2 remote-as=300
tcp-md5-key="" nexthop-choice=default multihop=no route-reflect=no hold-time=15s 
ttl=default in-filter=cisco_in out-filter=cisco_out address-families=ip 
default-originate=never remove-private-as=no as-override=yes passive=no 
use-bfd=no

/routing filter
chain=RB450_in prefix=0.0.0.0/0 prefix-length=16-32 invert-ma
tch=no action=accept set-bgp-prepend-path=""
chain=RB450_out prefix=0.0.0.0/0 prefix-length=16-32 bgp-as-path=
^300,.*$ invert-match=no action=discard set-bgp-prepend-path=""
chain=RB450_out prefix=0.0.0.0/0 prefix-length=16-32 invert-match
=no action=accept set-bgp-prepend-path="" 

chain=cisco_in prefix=0.0.0.0/0 prefix-length=24-32 invert-match=no
action=accept set-bgp-prepend-path=""
chain=cisco_out prefix=0.0.0.0/0 prefix-length=24-32 invert-match=no ac
tion=accept set-bgp-prepend-path="" 

 

cisco

as=300

 

router bgp 300
neighbor 2.2.2.1 remote-as 200
address-family ipv4
 no synchronization
 bgp redistribute-internal
 neighbor 2.2.2.1 activate
 neighbor 2.2.2.1 default-originate
 neighbor 2.2.2.1 distribute-list ournet_10 in
 neighbor 2.2.2.1 distribute-list ournet_10 out

ip access-list standard ournet_10
deny   10.72.0.0 0.0.255.255
permit 10.0.0.0 0.255.255.255

 

В итоге наблюдаю на циске немного не то, что ожидал по документации as-override:

 

core#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/24, version 603339
Paths: (1 available, best #1, table default)
Multipath: eBGP
 Advertised to update-groups:
    36         38         75         84         96        
 200 100
   2.2.2.1 from 2.2.2.1 (2.2.2.1)
     Origin incomplete, localpref 100, valid, external, best

core#sh ip bgp | inc 10.0.0.0
*> 10.0.0.0/24    2.2.2.1                         0 200 100 ?

 

а именно полный as-path до конечной точки.

Что не так?

Edited by shuu01

Share this post


Link to post
Share on other sites

В итоге наблюдаю на циске немного не то, что ожидал по документации as-override:

А что ожидал увидеть?

Что не так?

Номер AS на R1 не так видимо. Поставь на R1 и R3 одинаковый номер и наслаждайся (если микрот правильно работает).

Share this post


Link to post
Share on other sites

А что ожидал увидеть?

 

as-override (yes | no; Default: no) If set, then all instances of remote peer's AS number in BGP AS PATH attribute are replaced with local AS number before sending route update to that peer. Happens before routing filters and prepending.

 

Ожидал что то вроде:

 

core#sh ip bgp | inc 10.0.0.0
*> 10.0.0.0/24    2.2.2.1                         0 200 200 ?

Share this post


Link to post
Share on other sites

As override tok dlya vpnv4 i na oboih storonah odin i tot

Je as doljenu buti

Share this post


Link to post
Share on other sites

А что ожидал увидеть?

 

as-override (yes | no; Default: no) If set, then all instances of remote peer's AS number in BGP AS PATH attribute are replaced with local AS number before sending route update to that peer. Happens before routing filters and prepending.

 

Ожидал что то вроде:

 

core#sh ip bgp | inc 10.0.0.0
*> 10.0.0.0/24    2.2.2.1                         0 200 200 ?

Перевожу - при анонсах в сторону AS100 все присутсвия AS100 в as-path будут заменены на локальный номер AS. У тебя AS100 при анонсировании в сторону AS100 в as-path есть? Нету, значит и менять ничего не надо.

Share this post


Link to post
Share on other sites

Спасибо за разъяснения. Не до конца понял документацию по этой команде.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this