Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save radut/3fdd6d5e30419235394f3fce92b0d29f to your computer and use it in GitHub Desktop.
Save radut/3fdd6d5e30419235394f3fce92b0d29f to your computer and use it in GitHub Desktop.
Mikrotik <-> Linux GRE/IPSec, strongswan
config setup
charondebug="ike 2, knl 2, cfg 2, net 2, esp 2, dmn 2, mgr 2"
conn %default
# keyexchange=ikev2
conn mikrotik-1
# Try connect on daemon start
auto=start
# Authentication by PSK (see ipsec.secret)
authby=secret
# Disable compression
compress=no
# Re-dial setings
closeaction=clear
dpddelay=30s
dpdtimeout=150s
dpdaction=restart
# ESP Authentication settings (Phase 2)
esp=aes128-sha1-modp2048,aes256-sha1-modp2048
# UDP redirects
forceencaps=no
# IKE Authentication and keyring settings (Phase 1)
ike=aes128-sha1-modp2048,aes256-sha1-modp2048
ikelifetime=86400s
keyingtries=%forever
lifetime=3600s
# Internet Key Exchange (IKE) version
# Default: Charon - ikev2, Pluto: ikev1
keyexchange=ikev1
# connection type
type=transport
# Peers
left=remote_ip
right=local_ip
# Protocol type. May not work in numeric then need set 'gre'
leftprotoport=47
rightprotoport=47
@radut
Copy link
Author

radut commented May 8, 2020

auto gre1
iface gre1 inet static
address 192.168.44.10
netmask 255.255.255.252
pre-up ip tunnel add gre1 mode gre remote $remote_ip local $local_ip
post-up route add -net 192.168.69.0/24 gw 192.168.44.10 dev gre1
post-down ip tunnel del gre1

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