Get prefixs from one bgp peer and advertise another one

 Method-1: BGP Community configuration


Method-2: BGP Local Preference

Mikrotik V6 filter rule will be-
/routing filter
add action=accept chain=CDN-IMPORT prefix=0.0.0.0/0 prefix-length=16-24 set-bgp-communities=154:504
add action=discard chain=CDN-IMPORT prefix=0.0.0.0/0 prefix-length=0-32 set-bgp-communities=""
add action=accept bgp-communities=154:504 chain=CLIENT-CDN-OUT prefix=0.0.0.0/0 prefix-length=16-24
add action=discard chain=CLIENT-CDN-OUT prefix=0.0.0.0/0 prefix-length=0-32



Mikrotik V7 filter rule will be-

add chain=CDN-IMPORT disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 16-24) { set bgp-communities 154:504; accept; }"
add chain=CDN-IMPORT disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 0-32) { reject; }"
add chain=CLIENT-CDN-OUT disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 16-24 && bgp-communities includes 154:504) { accept; }"
add chain=CLIENT-CDN-OUT disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 0-32) { reject; }"


Mikrotik V6 filter rule will be-
/routing filter
add action=accept chain=cdn-in prefix=0.0.0.0/0 prefix-length=0-32 set-bgp-local-pref=110
add action=accept bgp-local-pref=110 chain=cdn-out prefix=0.0.0.0/0 prefix-length=0-32
add action=discard chain=cdn-out prefix=0.0.0.0/0 prefix-length=0-32

Mikrotik V7 filter rule will be-
/routing filter rule
add chain=cdn-in disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 0-32) { set bgp-local-pref 110; accept; }"
add chain=cdn-out disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 0-32 && bgp-local-pref == 110) { accept; }"
add chain=cdn-out disabled=no rule="if (dst in 0.0.0.0/0 && dst-len in 0-32) { reject; }"

Get prefixs from one bgp peer and advertise another one Get prefixs from one bgp peer and advertise another one Reviewed by RIO IT on 16:00 Rating: 5
Powered by Blogger.