Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Created July 11, 2020 14:27
Show Gist options
  • Save egeneralov/91107f59dea24ebe545f5d4feca93836 to your computer and use it in GitHub Desktop.
Save egeneralov/91107f59dea24ebe545f5d4feca93836 to your computer and use it in GitHub Desktop.
ipip tunnels for two microtik`s. Site 1 with dynamic white ip, site 2 with static white ip.
/ip cloud
set ddns-enabled=yes
/interface ipip
add allow-fast-path=no ipsec-secret=REPLACE local-address=REPLACE_SITE_2_IP name=msk-spb remote-address=REPLACE_SITE_1_IP
/ip address
add address=192.168.99.1/30 interface=msk-spb network=192.168.99.0
/system script
add dont-require-permissions=no name=ddns-update-tunnels owner=root policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source="do {\
\n :global cloud [/ip cloud get public-address]\
\n /interface ipip set msk-spb local-address=\$cloud\
\n}"
/system scheduler
add comment=ddns-update-tunnels interval=1m name=ddns-update-tunnels on-event="/system script run ddns-update-tunnels" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jul/01/2020 start-time=00:00:00
/interface ipip
add allow-fast-path=no ipsec-secret=REPLACE local-address=REPLACE_SITE_2_IP name=msk-spb remote-address=REPLACE_SITE_1_IP
/ip address
add address=192.168.99.2/30 interface=msk-spb network=192.168.99.0
/system script
add dont-require-permissions=no name=msk-spb owner=root policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
":do {\
\n :global ip [resolve REPLACE_SITE_1_DDNS.sn.mynetname.net]\
\n /interface ipip set msk-spb remote-address=\$ip\
\n}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment