Let me try to explain my scenario. I have two BGP sessions from two different AS coming to my CCR1072-1G-8S+. Both of them are active and working. They both have the same speeds (3Gbps full).
I want to make BGP 1 (superimagem) primary and BGP 2 (nip) secondary. I have set BGP weight, local preference and MED on filters for both iBGP's. I'm going to post my filters and my BGP configurations below. What am I doing wrong?
Filters:
Code: Select all
# aug/10/2018 11:27:40 by RouterOS 6.42.6
# software id = SLL9-BT75
#
# model = CCR1072-1G-8S+
# serial number = --------------
/routing filter
add action=accept chain=ebgp_superimagem_v4_in prefix=0.0.0.0/0 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=discard chain=ebgp_superimagem_v4_in set-bgp-local-pref=200 \
set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept bgp-communities="" chain=ebgp_superimagem_v4_out prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=200 set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=accept chain=ebgp_superimagem_v4_out disabled=yes prefix=\
XXX.XXX.XXX.X/24 set-bgp-local-pref=100 set-bgp-weight=300
add action=reject chain=ebgp_superimagem_v4_out prefix=XXX.XXX.XXX.X/30
add action=discard chain=ebgp_superimagem_v4_out set-bgp-local-pref=200 \
set-bgp-med=10 set-bgp-weight=300
add action=accept chain=ebgp_nip_v4_in prefix=0.0.0.0/0 set-bgp-local-pref=0 \
set-bgp-med=50 set-bgp-weight=100
add action=discard chain=ebgp_nip_v4_in set-bgp-local-pref=0 set-bgp-med=50 \
set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=accept chain=ebgp_nip_v4_out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=0 set-bgp-med=50 set-bgp-weight=100
add action=discard chain=ebgp_nip_v4_out set-bgp-local-pref=0 set-bgp-med=50 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=0.0.0.0/0 set-bgp-local-pref=0 \
set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/23 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/23 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/23 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-in prefix=XXX.XXX.XXX.X/24 set-bgp-local-pref=\
0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=discard chain=ibgp-mpv-in set-bgp-local-pref=0 set-bgp-prepend=3 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/23 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/23 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out prefix=XXX.XXX.XXX.X/24 \
set-bgp-local-pref=0 set-bgp-med=20 set-bgp-prepend=3 set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/23 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=XXX.XXX.XXX.X/24 \
set-bgp-weight=100
add action=accept chain=ibgp-mpv-out disabled=yes prefix=0.0.0.0/0 \
set-bgp-weight=100
add action=discard chain=ibgp-mpv-out set-bgp-weight=100
Code: Select all
# aug/10/2018 11:28:00 by RouterOS 6.42.6
# software id = SLL9-BT75
#
# model = CCR1072-1G-8S+
# serial number = --------------
/routing bgp instance
set default as=XXXXX client-to-client-reflection=no router-id=X.X.X.X
add as=XXXXX ignore-as-path-len=yes name=superimagem router-id=\
X.X.X.X
add as=1 client-to-client-reflection=no name=interno redistribute-connected=\
yes router-id=X.X.X.X
add as=XXXXX ignore-as-path-len=yes name=nip router-id=X.X.X.X
/routing bgp network
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/23 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/23 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/23 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
add network=XXX.X.XXX.0/24 synchronize=no
/routing bgp peer
add in-filter=ebgp_nip_v4_in instance=nip multihop=yes name=BGP-NIP \
nexthop-choice=force-self out-filter=ebgp_nip_v4_out remote-address=\
XXX.XXX.XXX.X remote-as=XXXXX ttl=default update-source=vlan_nip_ubatuba
add in-filter=ebgp_superimagem_v4_in instance=superimagem multihop=yes name=\
BGP-SUPERIMAGEM-V4 out-filter=ebgp_superimagem_v4_out remote-address=\
XXX.XXX.XXX.X remote-as=XXXXX ttl=default update-source=\
vlan_super_ubatuba
add in-filter=ibgp-mpv-in instance=interno multihop=yes name=BGP-INTERNO \
nexthop-choice=force-self out-filter=ibgp-mpv-out remote-address=\
XXX.XXX.XXX.X remote-as=1 ttl=default update-source=vlan_caragua
add disabled=yes in-filter=ibgp-mpv-in name=BGP-CARAGUA out-filter=\
ibgp-mpv-out remote-address=191.7.144.1 remote-as=263320 ttl=default