Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Last active January 18, 2024 04:04
Show Gist options
  • Save egeneralov/a53142332e35d96ad7b9be21ae5a5024 to your computer and use it in GitHub Desktop.
Save egeneralov/a53142332e35d96ad7b9be21ae5a5024 to your computer and use it in GitHub Desktop.
linux to mikrotik ip tunnel
ip tunnel add ipip local ${linux_ip} remote ${mikrotik_ip} mode ipip
ip link set ipip up
ip addr add 192.168.3.1/30 dev ipip
iptables -t mangle -A POSTROUTING -o ipip -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t nat -A POSTROUTING -s 192.168.3.0/30 -o ${linux_output_iface} -j MASQUERADE
/interface ipip add !keepalive local-address=${mikrotik_ip} name=tunnel remote-address=${linux_ip}
/ip address add address=192.168.3.2/30 interface=tunnel network=192.168.3.0
/interface list member add interface=tunnel list=WAN
@AnonymousWebHacker
Copy link

this allow a mikrotik use this vps ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment