Page 1 of 1

BGP Question

Posted: Fri Jan 27, 2012 11:00 pm
by dejanb
Hello guys!

I need help with BGP.
I have simple multihome setup with my two upstream providers, and for now, it works very well.

Problem:

I have /21 prefix that i advertise, i want to split it into 8 /24 blocks, so i can route some IP addresses to ISP1 and other part to ISP2.
Is this possible? i readed very much about BGP on few forums and i didn't find how to solve this problem, i founded some posts about 'prepending' but it's not very clear to me, either....

Please give me some advice...

Regards!

Re: BGP Question

Posted: Mon Jan 30, 2012 9:43 am
by mrz

Re: BGP Question

Posted: Mon Jan 30, 2012 7:14 pm
by dejanb
Hello guys!

I need help with BGP.
I have simple multihome setup with my two upstream providers, and for now, it works very well.

Problem:

I have /21 prefix that i advertise, i want to split it into 8 /24 blocks, so i can route some IP addresses to ISP1 and other part to ISP2.
Is this possible? i readed very much about BGP on few forums and i didn't find how to solve this problem, i founded some posts about 'prepending' but it's not very clear to me, either....

Please give me some advice...

Regards!
I readed that article, i have /21 not two /24 prefixes, like in example...

Nevermind, i found a solution for my problem, thanks anyway! :)

Re: BGP Question

Posted: Thu Feb 02, 2012 12:37 am
by regardtv
Hi,

A /21 is simply 8 /24 subnets aggregated. As such splitting this to specific providers is simply a matter of bgp filters for the relevant providers.
  • Setup a BGP session to each provider.
  • Add all the /24's to your bgp networks.
  • Setup filters for the specific /24's you want to announce to each of the providers.
  • DONE
Other items to consider
  • if you are in the RIPE region (as example) you'd have to add route entries for all the /24's otherwise you're likely to end up having some of your route announcements dropped by BGP filters on a number of larger providers.
  • A number of providers in Europe certainly suggest a minimum announce of a /23
  • By just announcing specific routes to specific providers you don't have any redundancy - if one provider fails you stop announcing those /24's and they dissapear off the internet.
A workaround for the last item is to still announce the /21 to both providers. The issue here is that in such a case some upstream networks might still prefer the /21 route rather than the /24's -- it should not happen but I've seen it a couple of times.

Hope this helps for future reference.

Re: BGP Question

Posted: Tue Feb 07, 2012 11:40 am
by dejanb
Hi,

A /21 is simply 8 /24 subnets aggregated. As such splitting this to specific providers is simply a matter of bgp filters for the relevant providers.
  • Setup a BGP session to each provider.
  • Add all the /24's to your bgp networks.
  • Setup filters for the specific /24's you want to announce to each of the providers.
  • DONE
Other items to consider
  • if you are in the RIPE region (as example) you'd have to add route entries for all the /24's otherwise you're likely to end up having some of your route announcements dropped by BGP filters on a number of larger providers.
  • A number of providers in Europe certainly suggest a minimum announce of a /23
  • By just announcing specific routes to specific providers you don't have any redundancy - if one provider fails you stop announcing those /24's and they dissapear off the internet.
A workaround for the last item is to still announce the /21 to both providers. The issue here is that in such a case some upstream networks might still prefer the /21 route rather than the /24's -- it should not happen but I've seen it a couple of times.

Hope this helps for future reference.

Thank you very much friend, it's good to know this and yes i'm using this workaround (announcing /21 to both providers) and it's working good for now... :)

Regards!

Re: BGP Question

Posted: Wed Feb 08, 2012 12:44 am
by regardtv
Glad I cloud help mate. Sometimes trying to figure stuff out at odd times of day is a lonely place to be ;-)

Re: BGP Question

Posted: Sat May 05, 2012 6:13 pm
by dejanb
Glad I cloud help mate. Sometimes trying to figure stuff out at odd times of day is a lonely place to be ;-)
Hello friend!

I know this is quite old topic but i need your help once again :)

Few days ago i realized that my download traffic is going through ISP2 and upload through ISP1, routing filters doesn't works like earlier too!
Let's say, when i want to assign one of my /24 blocks to ISP1 not ISP2 it doesn't work or upload traffic is going through ISP1 and downlad through ISP2...
I didn't changed anything, and my upstream providers didn't change anything too... i'm lost for now, i exported routing filters below.
/routing filter
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.216.0 prefix-length=21 set-bgp-prepend-path=""
add action=accept chain=ISP2-IN disabled=no invert-match=no prefix=0.0.0.0/0 \
    prefix-length=0 set-bgp-prepend-path="" set-out-nexthop=109.198.5.229
add action=accept chain=ISP2-IN disabled=no invert-match=no prefix-length=16 \
    set-bgp-prepend-path=""
add action=discard chain=ISP2-IN disabled=no invert-match=no \
    set-bgp-prepend-path=""
add action=accept chain=ISP2-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.216.0 prefix-length=21 set-bgp-communities="" set-bgp-prepend=4 \
    set-bgp-prepend-path=""
add action=discard chain=ISP1-OUT disabled=no invert-match=no \
    set-bgp-prepend-path=""
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.221.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.216.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=passthrough chain="" disabled=no invert-match=no prefix=0.0.0.0/0 \
    prefix-length=0-32 set-bgp-prepend-path=""
add action=passthrough chain=ISP2-OUT disabled=no invert-match=no \
    prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.219.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP2-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.222.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP2-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.223.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.220.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP1-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.217.0/24 prefix-length=24 set-bgp-prepend-path=""
add action=accept chain=ISP2-OUT disabled=no invert-match=no prefix=\
    XXX.XXX.218.0/24 prefix-length=24 set-bgp-prepend-path=""
Best Regards!

Re: BGP Question

Posted: Tue Jun 19, 2012 1:25 am
by MikroTikIQ
Hi

Can I ask you how my ISP Source you have ..?

Also See the below link:
http://mum.mikrotik.com/presentations/AE12/ali.pdf

take a look to my diag

Here is BGP config export..



/routing bgp network
add disabled=no network=x.x.224.0/23 synchronize=no
add disabled=no network=x.x.226.0/23 synchronize=no
add disabled=no network=x.x.224.0/22 synchronize=no

....
..
..

/routing bgp peer
add address-families=ip as-override=no default-originate=if-installed disabled=no hold-time=3m in-filter=\
IN-Fillter_peer_MAZ instance=default multihop=yes name=peer_MAZ nexthop-choice=default out-filter=\
Out-Fillter_peer_MAZ passive=no remote-address=x.x.71.73 remote-as=(AS number) remove-private-as=no \
route-reflect=no tcp-md5-key="" ttl=default use-bfd=no
add address-families=ip as-override=no default-originate=if-installed disabled=no hold-time=3m in-filter="" \
instance=default multihop=yes name=peer_IQ nexthop-choice=default out-filter=Out-Fillter_peer_IQ passive=no \
remote-address=x.x.193.3 remote-as=(AS number) remove-private-as=no route-reflect=no tcp-md5-key="" ttl=default \
use-bfd=no

(There is Multihop option its need to set yes if there is indirect connection between you router and remote bgp router , its mean there some router between your router and the router you can to make bgp session with it..)
..
..
..

/routing filter
add action=accept chain=Out-Fillter_peer_IQ comment="IQ Ann...::::::::::::::::::::::::::::" disabled=no invert-match=no prefix=x.x.226.0/23 \
prefix-length=23 set-bgp-prepend-path="" set-bgp-weight=100
add action=accept chain=Out-Fillter_peer_IQ disabled=no invert-match=no prefix=x.x.224.0/22 prefix-length=22 set-bgp-prepend-path="" \
set-bgp-weight=200
add action=discard chain=Out-Fillter_peer_IQ disabled=no invert-match=no set-bgp-prepend-path=""
add action=accept chain=Out-Fillter_peer_MAZ comment="MAZ Ann....:::::::::::::::::::::::::::::::::" disabled=no invert-match=no prefix=\
x.x.224.0/23 prefix-length=23 set-bgp-prepend-path="" set-bgp-weight=100
add action=accept chain=Out-Fillter_peer_MAZ disabled=no invert-match=no prefix=x.x.224.0/22 prefix-length=22 set-bgp-prepend-path="" \
set-bgp-weight=200
add action=discard chain=Out-Fillter_peer_MAZ disabled=no invert-match=no set-bgp-prepend-path=""

..
..
..


advertisement through bgp

admin@route> routing bgp advertisements print

PEER PREFIX NEXTHOP AS-PATH ORIGIN LOCAL-PR
peer_MAZ x.x.224.0/23 x.x.99.2 igp
peer_MAZ x.x.224.0/22 x.x.99.2 igp
peer_IQ x.x.226.0/23 x.x.210.154 igp
peer_IQ x.x.224.0/22 x.x.210.154 igp



Hope fully this sample can be help full

Also there is thing you need to do with RIPE ... for IP announcment...


Good Luck..!

Ali Sami
MTCNA,MTCRE,MTCWE,MTCTCE, Mikrotik Trainner
skype: alixon78