After that i got 2 Config files. One of them i imported into the remote Fritzbox. The configuration file which was generated for my fritzbox (so now it´s my NS) looks like this:
Hi @prostream
First: Remove the port forwarding for the IPSec-Ports
I tried to configure it and I see the following log in the ipsec.log:
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: received Vendor ID payload [XAUTH]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: received Vendor ID payload [Dead Peer Detection]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: received Vendor ID payload [RFC 3947]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02_n]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 13 18:45:09 aa pluto[2460]: packet from 12.34.56.78:500: initial Aggressive Mode message from 12.34.56.78 but no (wildcard) connection has been configured with policy PSK+XAUTH+AGGRESSIVE+IKEV1_ALLOW
I think the last line is interesting because this seems to be what the FritzBox sends to the Nethserver.
If I disable XAUTH, the string looks like this:
Sep 13 18:55:50 aapluto[2460]: packet from 12.34.26.78:500: initial Aggressive Mode message from 12.34.56.78 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
So the big question is: What does Nethserver expects?
Sep 11 16:12:42 NET01 pluto[28578]: packet from 79.235.29.25:500: received Vendor ID payload [Dead Peer Detection]
Sep 11 16:12:42 NET01 pluto[28578]: packet from 79.235.29.25:500: received Vendor ID payload [RFC 3947]
Sep 11 16:12:42 NET01 pluto[28578]: packet from 79.235.29.25:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 11 16:12:42 NET01 pluto[28578]: packet from 79.235.29.25:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 11 16:12:42 NET01 pluto[28578]: packet from 79.235.29.25:500: initial Aggressive Mode message from 79.235.29.25 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
So i had to configure the openswan Server manually.
This is what my ipsec.conf looks like:
version 2.0 # conforms to second version of ipsec.conf specification
# basic configuration
config setup
# Debug-logging controls: "none" for (almost) none, "all" for lots.
# klipsdebug=none
# plutodebug="control parsing"
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
protostack=netkey
nat_traversal=yes
virtual_private=%v4:192.168.179.0./24,%v4:192.168.177.0./24
oe=off
# Enable this if you see "failed to find any available worker"
# nhelpers=
conn Site-to-Site
authby=secret
auto=add
type=tunnel
aggrmode=yes
left= <mypublicip>
leftid= <myfqdn>
leftnexthop=%defaultroute
leftsourceip=192.168.177.21
leftsubnet=192.168.177.0/24
right=%any
rightsubnet=192.168.179.0/24
rightid= <the fqdn of the Fritzbox>
ike=aes256-sha1;modp2048
phase2=esp
phase2alg=aes256-sha1;modp2048
Hi all!
I never had the chance to configure an IPsec on a Fritzbox and I don’t know it, I just can tell you what it seems to me a little weird, hoping something I’m writing will be useful.
in the NS conf: there are specified remote and local IDs like @xxxxx.remote, @xxxxx.local … they are different from those in the Fritzbox configuration, since they must be be present and equal in both configurations I suggest you to use in the fritzbox always the type “fqdn” and write, in inverted position, the local and remote ID you put in the NS
In the NS configuration: the remote IP address is 79.235.15.238, in the last lines of the last log I see packets from IPs 216.218.206.114 and from IPs 184.105.139.67… in other logs I see connection not authorized but never from the IP 79.235.15.238 so …are the Fritbox packets coming from the right public ip address?
in the fritzbox : I don’t understand the reason to forward the ports 500 and 4500 UDP, they should already referred to the Fritzbox devices I suppose, but I can be wrong, may be this is the right way for the FritzBox
the aggressive mode should permits only protocols and cipher declared, better to not use it to ensure better compatibility
Okay now i tried the following configs and something happen.
ipsec.conf:
config setup
# Debug-logging controls: "none" for (almost) none, "all" for lots.
# klipsdebug=none
# plutodebug="control parsing"
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
protostack=netkey
nat_traversal=yes
virtual_private=%v4:192.168.179.0./24,%v4:192.168.177.0./24
oe=off
# Enable this if you see "failed to find any available worker"
# nhelpers=
conn Site-to-Site
authby=secret
auto=add
type=tunnel
aggrmode=yes
left= PUBLIC IP ADRESS OF NSSERVER
leftid= FQDN OF NSSERVER
leftnexthop=%defaultroute
leftsourceip=192.168.177.21
leftsubnet=192.168.177.0/24
right=%any
rightsubnet=192.168.179.0/24
rightid= FQDN OF FRITZBOX
ike=aes256-sha1;modp2048
phase2=esp
phase2alg=aes256-sha1;modp2048
Sep 24 11:20:09 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [XAUTH]
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [RFC 3947]
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:20:17 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [XAUTH]
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [RFC 3947]
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:20:37 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [XAUTH]
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [RFC 3947]
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:20:39 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [XAUTH]
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [RFC 3947]
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:20:43 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [XAUTH]
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: received Vendor ID payload [RFC 3947]
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:20:51 NET01 pluto[6327]: packet from 79.235.2.199:500: initial Aggressive Mode message from 79.235.2.199 but no (wildcard) connection has been configured with policy PSK+AGGRESSIVE+IKEV1_ALLOW
Disabling aggressive mode on both sides gives this:
Sep 24 11:45:48 NET01 pluto[8193]: packet from 79.235.30.110:500: initial Main Mode message received on 192.168.177.6:500 but no connection has been authorized with policy PSK+IKEV1_ALLOW
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [XAUTH]
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [RFC 3947]
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:45:52 NET01 pluto[8193]: packet from 79.235.30.110:500: initial Main Mode message received on 192.168.177.6:500 but no connection has been authorized with policy PSK+IKEV1_ALLOW
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [XAUTH]
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [Dead Peer Detection]
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: received Vendor ID payload [RFC 3947]
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: ignoring Vendor ID payload [draft-ietf-ipsec-nat-t-ike-03]
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: ignoring unknown Vendor ID payload [a2226fc364500f5634ff77db3b74f41b]
Sep 24 11:46:00 NET01 pluto[8193]: packet from 79.235.30.110:500: initial Main Mode message received on 192.168.177.6:500 but no connection has been authorized with policy PSK+IKEV1_ALLOW
okay i got it.
There were a few configuration problems. So now i´m running an ipsec tunnel between OpenSwan 2.0 and Fritzbox 3270.
Here are my configs:
Fritzbox-VPN.cfg
vpncfg {
connections {
enabled = yes;
conn_type = conntype_lan;
name = "ANY-NAME";
always_renew = yes;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
remoteip = PUBLIC IP ADRESS OF OPENSWAN SERVER;
remote_virtualip = 0.0.0.0;
localid {
fqdn = "FQDN (in my case DYNS) OF FRITZBOX";
}
remoteid {
ipaddr = "FQDN (in my case DYNS) OF OPENSWAN SERVER (Nethserver)";
}
mode = phase1_mode_aggressive;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "RANDOM PRE SHARED KEY";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = yes;
use_cfgmode = no;
phase2localid {
ipnet {
ipaddr = 192.168.179.0; //LOCAL IPADRESS OF FRITZBOX LAN
mask = 255.255.255.0; //LOCAL SUBNETMASK OF FRITZBOX LAN
}
}
phase2remoteid {
ipnet {
ipaddr = 192.168.177.0; //LOCAL IPADRESS OF OPENSWAN LAN
mask = 255.255.255.0; //LOCAL SUBNETMASK OF OPENSWAN LAN
}
}
phase2ss = "esp-aes256-3des-sha/ah-all-sha/comp-lzs-no/pfs";
accesslist = "permit ip any 192.168.177.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";
}
// EOF
/etc/ipsec.conf
config setup
# Debug-logging controls: "none" for (almost) none, "all" for lots.
# klipsdebug=none
# plutodebug="control parsing"
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey
protostack=netkey
nat_traversal=yes
virtual_private=%v4:192.168.179.0./24,%v4:192.168.177.0./24
oe=off
# Enable this if you see "failed to find any available worker"
# nhelpers=
conn Site-to-Site
authby=secret
auto=add
type=tunnel
aggrmode=yes
left=PUBLIC IP ADRESS OF OPENSWAN SERVER
leftid= FQDN OF OPENSWAN SERVER (IMPORTANT: put a @ in fron of. Example: @my.dyndns.com)
leftnexthop=%defaultroute
leftsourceip=LOCAL IP ADRESS AT OPENSWAN LAN
leftsubnet=192.168.177.0/24
right=%any
rightsubnet=192.168.179.0/24
rightid=FQDN OF FRITZBOX (IMPORTANT: put a @ in fron of. Example: @my.dyndns.com)
ike=aes256-sha1;modp1024
phase2=esp
phase2alg=aes256-sha1;modp1024
At least be sure that the /etc/ipsec.secrets is correct.
Also you have to check the /etc/sysctl.conf: