I have traffic flowing over my tunnel between a FritzBox 7360 with FritzOS 6.20 and a Mikrotik RB2011UiAS-2HnD with RouterOS 6.27.
I am however having connection issues. Sometimes I can't connect to any host behind the FritzBox from the Mikrotik side. I am still trying to figure out what is going on.
That being said, my latest config, that seems to be working out pretty well so far is as follows:
vpncfg {
connections {
enabled = yes;
conn_type = conntype_lan;
name = "[Name of the VPN connection in the FritzOS interface]";
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
remoteip = 0.0.0.0;
remote_virtualip = 0.0.0.0;
remotehostname = "[remote.host.name]";
localid {
fqdn = "[local.host.name]";
}
remoteid {
fqdn = "[remote.host.name]";
}
mode = phase1_mode_aggressive;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "[supersecretkey]";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = no;
use_cfgmode = no;
phase2localid {
ipnet {
ipaddr = 10.0.10.0;
mask = 255.255.255.0;
}
}
phase2remoteid {
ipnet {
ipaddr = 10.0.20.0;
mask = 255.255.255.0;
}
}
phase2ss = "esp-all-all/ah-none/comp-all/pfs";
accesslist = "permit ip any 10.0.20.0 255.255.255.0";
}
ike_forward_rules = "udp 0.0.0.0:500 0.0.0.0:500",
"udp 0.0.0.0:4500 0.0.0.0:4500";
}
This
link provides details with regards to the VPN config file for the FritzBox.
In addition, AVM has provided a list of options for both the
phase1ss and the
phase2sss parameters in the config file.
On the mikrotik side, I've used the following setup:
Policy
/ip ipsec policy add action=encrypt disable=no dst-address=10.0.10.0/8 dst-port=any group=default ipsec-protocol=esp level=required proposal=fritzbox sa-dst-address=1.2.3.4 sa-src-address=4.3.2.1 src-address=10.0.20.0/8 src-port=any template=yes tunnel=yes
Peer
/ip ipsec peer add address=1.2.3.4 auth-method=pre-shared-key dh-group=modp1024 disabled=no enc-algorithm=aes-256 exchange-mode=aggressive generate-policy=no hash-algorithm=sha1 port=500 proposal-check=obey secret="[supersecretkey]" send-initial-contact=no
Proposal
/ip ipsec proposal add auth-algorithms=sha1 disabled=no enc-algorithms=3des lifetime=30m name="fritzbox" pfs-group=modp1024
Note that I've put the fritzbox in charge of creating the connection ("send-initial-contact=no" in the peer setup). It seems that in my case, it works best if I let the fritzbox initiate the connection. If the Mikrotik initiates the connection, I run into problems about 30 minutes in (pings start dropping). I haven't figured out why this happens.