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 remote-as 65520 nlri unicast multicast
neighbor description ANYNET
neighbor next-hop-self
neighbor version 4
neighbor soft-reconfiguration inbound
neighbor route-map AS65520-bgp-in in
neighbor route-map AS65530-bgp-out out

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

ip route Null0 250

/ip route add dst-address= type=blackhole

ip prefix-list AS65530-exact seq 5 deny
ip prefix-list AS65530-exact seq 10 permit

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= 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