In v6 I did the following (assuming pptp-out1 exists and is running) - this routes all traffic for received BGP prefixes through a VPN (and BGP requests themselves are sent out via a VPN too).
Code: Select all
/ip route add dst-address=51.75.66.20/32 gateway=pptp-out1
/routing bgp instance set default as=64999 ignore-as-path-len=yes router-id=3.4.5.6
/routing bgp peer add hold-time=4m in-filter=bgp_in keepalive-time=1m multihop=yes name=antifilter remote-address=51.75.66.20 remote-as=65444 ttl=default update-source=pptp-out1
/routing filter add action=accept chain=bgp_in comment="Set nexthop to VPN" set-in-nexthop-direct=pptp-out1
/ip firewall nat add chain=srcnat action=masquerade out-interface=pptp-out1
Code: Select all
set-in-nexthop-direct
Code: Select all
/routing bgp template set antifilter as=64999 hold-time=4m input.filter=bgp_in keepalive-time=1m multihop=yes name=antifilter
# How do I specify that I want this connection to be done through pptp-out1 ?
/routing bgp connection add local.role=ibgp remote.address=51.75.66.20/32 template=antifilter
# How do I specify that I want traffic matching this rule to go through pptp-out1 ?
/routing filter rule add action=accept chain=bgp_in
/ip firewall nat add chain=srcnat action=masquerade out-interface=pptp-out1
Any help would be appreciated!