BGP CiscoToMT

From MikroTik Wiki
Jump to navigation Jump to search

RouterOS configuration lines start with "/" (slash).

router bgp 65530
redistribute connected
redistribute static

/routing bgp instance set default as=65530 redistribute-connected=yes redistribute-static=yes

neighbor 1.1.1.1 remote-as 65520 nlri unicast multicast
neighbor 1.1.1.1 description ANYNET
neighbor 1.1.1.1 next-hop-self
neighbor 1.1.1.1 version 4
neighbor 1.1.1.1 soft-reconfiguration inbound
neighbor 1.1.1.1 route-map AS65520-bgp-in in
neighbor 1.1.1.1 route-map AS65530-bgp-out out

/routing bgp peer add remote-address=1.1.1.1 remote-as=65520 out-filter=AS65530-bgp-out \
\... in-filter=AS65520-bgp-in nexthop-choice=force-self comment="ANYNET"

ip route 2.0.0.0 255.255.255.0 Null0 250

/ip route add dst-address=2.0.0.0/24 type=blackhole


ip prefix-list AS65530-exact seq 5 deny 0.0.0.0/0
ip prefix-list AS65530-exact seq 10 permit 11.0.0.0/22

route-map AS65530-bgp-out permit 10
match ip address prefix-list AS65530-exact
match nlri unicast multicast


/routing filter add chain=AS65530-bgp-out prefix=11.0.0.0/22 action=accept
/routing filter add chain=AS65530-bgp-out action=discard



route-map AS65520-bgp-in permit 10
match nlri unicast multicast
set weight 200

/routing filter add chain=AS65520-bgp-in set-bgp-weight=200

--Eugene