Kürzlich wollte ich ein IPsec VPN zwischen einem ScreenOS und einer FRITZ!Box bauen. Das IPsec auf der FRITZ!Box ist dabei ziemlich hässlich zu konfigurieren. Man muss ein Konfigurationsfile auf die Fritzbox hochladen und im Anschluss rebootet diese sich um die Konfiguration zu aktivieren. Das ganze war dadurch etwas “Trial & Error” und nervig bis es mit meiner ScreenOS Gegenstelle lief. Anbei meine funktionierende Konfiguration. Vielleicht hilft’s ja jemanden.
Die Variablen $FQDN_FRITZ, $FQDN_SCREENOS, $IP_SCREENOS, $PRESHAREDKEY muss man natürlich durch seine eigenen Werte ersetzen. Desweiteren muss man das Routing und die Accesslist noch an sein Setup anpassen.
Konfiguration auf dem ScreenOS:
set interface "tunnel.2" zone "Trust"
set interface tunnel.2 ip unnumbered interface trust
set ike gateway "p1-fritzbox" address $FQDN_FRITZ Main local-id "$IP_SCREENOS" outgoing-interface "untrust" preshare "$PRESHAREDKEY" proposal "pre-g2-aes128-sha" "rsa-g2-3des-sha" "pre-g2-aes256-sha"
set vpn "p2-fritzbox" gateway "p1-fritzbox" no-replay tunnel idletime 0 proposal "g2-esp-3des-sha"
set vpn "p2-fritzbox" id 0x1 bind interface tunnel.2
set vpn "p2-fritzbox" proxy-id local-ip 0.0.0.0/0 remote-ip 0.0.0.0/0 "ANY"
set vpn "p2-fritzbox" id 0x1 bind interface tunnel.2
set route 192.168.1.0/24 interface tunnel.2
Jetzt kommt der eigentlich spannende Teil. Die Konfigurationsdatei für die FRITZ!Box (z.b. als fritzbox.cfg abspeichern):
pncfg {
connections {
enabled = yes;
conn_type = conntype_lan;
name = "$FQDN_SCREENOS";
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 = "$FQDN_SCREENOS";
localid {
fqdn = "$FQDN_FRITZ";
}
remoteid {
fqdn = "$FQDN_SCREENOS";
}
mode = phase1_mode_idp;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "$PRESHAREDKEY";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = no;
use_cfgmode = no;
phase2localid {
ipnet {
ipaddr = 0.0.0.0;
mask = 0.0.0.0;
}
}
phase2remoteid {
ipnet {
ipaddr = 0.0.0.0;
mask = 0.0.0.0;
}
}
phase2ss = "esp-3des-sha/ah-no/comp-no/pfs";
accesslist = "permit ip any 213.95.XX.XXX 255.255.255.224";
} ike_forward_rules = "udp 0.0.0.0:500 0.1.0.0:500",
"udp 0.0.0.0:4500 0.0.0.0:4500";
}