Ыть
23-03-2015, 22:29
есть сервер с Debian и почти настроенным VPN L2TP\IPsec.
Конфигурация ниже, делал по этой статье (http://habrahabr.ru/company/FastVPS/blog/205162/):
ipsec.conf
config setup
protostack=netkey
nat_traversal=yes # Enables NAT traversal
virtual_private=%v4:192.168.1.0/24 # with this option you can add your local IP in NAT
conn L2TP-PSK-NAT
rightsubnet=vhost:%priv
also=L2TP-PSK-noNAT
conn L2TP-PSK-noNAT
authby=secret # Auth with PSK ( preshared key )
pfs=no
auto=add
keyingtries=3
rekey=no
ikelifetime=8h
salifetime=10m
type=tunnel # type of l2tp connection ( tunnel / transport )
left=192.168.178.12 # left - is internet IP of l2tp server
leftprotoport=17/1701
right=%any # right - is IP of client ( if client NATed , that IP of client is IP in NAT )
rightprotoport=17/1701
ipsec.secrets
# This file holds shared secrets or RSA private keys for inter-Pluto
# authentication. See ipsec_pluto(8) manpage, and HTML documentation.
# RSA private key for this host, authenticating it to any other host
# which knows the public part. Suitable public keys, for ipsec.conf, DNS,
# or configuration of other implementations, can be extracted conveniently
# with "ipsec showhostkey".
# this file is managed with debconf and will contain the automatically created RSA keys
include /var/lib/openswan/ipsec.secrets.inc
192.168.178.12 %any: PSK "mykey1"
xl2tpd.conf
[global]
listen-addr = 192.168.178.12
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets
[lns default]
ip range = 10.0.0.2-10.0.0.200
local ip = 10.0.0.1
refuse chap = yes
refuse pap = yes
require authentication = yes
ppp debug = no
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
exclusive = no
assign ip = yes
name = VPN-Server
l2tp-secrets
# Secrets for authenticating l2tp tunnels
# us them secret
# * marko blah2
# zeus marko blah
# * * interop
* * * # let all , because we use auth with ppp
ipsec verify
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.37/K3.2.0-4-amd64 (netkey)
Checking for IPsec support in kernel [OK]
SAref kernel support [N/A]
NETKEY: Testing XFRM related proc values [OK]
[OK]
[OK]
Checking that pluto is running [OK]
Pluto listening for IKE on udp 500 [OK]
Pluto listening for NAT-T on udp 4500 [OK]
Checking for 'ip' command [OK]
Checking /bin/sh is not /bin/dash [WARNING]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]
открытые порты на сервере:
nmap -sT -O localhost
Starting Nmap 6.00 ( http://nmap.org ) at 2015-03-23 19:52 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00010s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=6.00%E=4%D=3/23%OT=22%CT=1%CU=39556%PV=N%DS=0%DC=L%G=Y%TM=5510610
OS:8%P=x86_64-unknown-linux-gnu)SEQ(SP=105%GCD=1%ISR=108%TI=Z%CI=I%II=I%TS=
OS:8)OPS(O1=M400CST11NW5%O2=M400CST11NW5%O3=M400CNNT11NW5%O4=M400CST11NW5%O
OS:5=M400CST11NW5%O6=M400CST11)WIN(W1=8000%W2=8000%W3=8000%W4=8000%W5=8000%
OS:W6=8000)ECN(R=Y%DF=Y%T=41%W=8018%O=M400CNNSNW5%CC=Y%Q=)T1(R=Y%DF=Y%T=41%
OS:S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=41%W=0%S=A%A=Z%F=R%O=%
OS:RD=0%Q=)T5(R=Y%DF=Y%T=41%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=41%W
OS:=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=41%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
OS:U1(R=Y%DF=N%T=41%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%D
OS:FI=N%T=41%CD=S)
Network Distance: 0 hops
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.54 seconds
Клиент - Windows 8.1 & Windows 2012 R2:
http://s016.radikal.ru/i335/1503/52/9fd293065591.png
получаю предупреждение что шифрования не будет:
http://s018.radikal.ru/i511/1503/cd/9327d923cfbd.png
Жмякаю подключить, ввожу пользователя и пароль - всё работает!
как только настраиваю IPsec - получаю ошибку 789.
Нашёл видео, где (https://www.youtube.com/watch?v=YCbxTVonZJc) настраивается согласование IPsec, но мне не помогло. Судя по комментариям не всем помогает.
Сервер находится за натом, проброшены порты (без проброса ничего не работало):
http://i074.radikal.ru/1503/69/d97ad7622551.png
пробрасывал GRE, ESP - не помогало. Их вообще нужно пробрасывать?
в чём проблема? Чего не хватает?
ps.: на сервере 2012 R2 нет возможности удалить методы безопасности :
http://s017.radikal.ru/i408/1503/1d/98178a847f6f.png
Спасибо.
Конфигурация ниже, делал по этой статье (http://habrahabr.ru/company/FastVPS/blog/205162/):
ipsec.conf
config setup
protostack=netkey
nat_traversal=yes # Enables NAT traversal
virtual_private=%v4:192.168.1.0/24 # with this option you can add your local IP in NAT
conn L2TP-PSK-NAT
rightsubnet=vhost:%priv
also=L2TP-PSK-noNAT
conn L2TP-PSK-noNAT
authby=secret # Auth with PSK ( preshared key )
pfs=no
auto=add
keyingtries=3
rekey=no
ikelifetime=8h
salifetime=10m
type=tunnel # type of l2tp connection ( tunnel / transport )
left=192.168.178.12 # left - is internet IP of l2tp server
leftprotoport=17/1701
right=%any # right - is IP of client ( if client NATed , that IP of client is IP in NAT )
rightprotoport=17/1701
ipsec.secrets
# This file holds shared secrets or RSA private keys for inter-Pluto
# authentication. See ipsec_pluto(8) manpage, and HTML documentation.
# RSA private key for this host, authenticating it to any other host
# which knows the public part. Suitable public keys, for ipsec.conf, DNS,
# or configuration of other implementations, can be extracted conveniently
# with "ipsec showhostkey".
# this file is managed with debconf and will contain the automatically created RSA keys
include /var/lib/openswan/ipsec.secrets.inc
192.168.178.12 %any: PSK "mykey1"
xl2tpd.conf
[global]
listen-addr = 192.168.178.12
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets
[lns default]
ip range = 10.0.0.2-10.0.0.200
local ip = 10.0.0.1
refuse chap = yes
refuse pap = yes
require authentication = yes
ppp debug = no
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
exclusive = no
assign ip = yes
name = VPN-Server
l2tp-secrets
# Secrets for authenticating l2tp tunnels
# us them secret
# * marko blah2
# zeus marko blah
# * * interop
* * * # let all , because we use auth with ppp
ipsec verify
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.37/K3.2.0-4-amd64 (netkey)
Checking for IPsec support in kernel [OK]
SAref kernel support [N/A]
NETKEY: Testing XFRM related proc values [OK]
[OK]
[OK]
Checking that pluto is running [OK]
Pluto listening for IKE on udp 500 [OK]
Pluto listening for NAT-T on udp 4500 [OK]
Checking for 'ip' command [OK]
Checking /bin/sh is not /bin/dash [WARNING]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]
открытые порты на сервере:
nmap -sT -O localhost
Starting Nmap 6.00 ( http://nmap.org ) at 2015-03-23 19:52 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00010s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=6.00%E=4%D=3/23%OT=22%CT=1%CU=39556%PV=N%DS=0%DC=L%G=Y%TM=5510610
OS:8%P=x86_64-unknown-linux-gnu)SEQ(SP=105%GCD=1%ISR=108%TI=Z%CI=I%II=I%TS=
OS:8)OPS(O1=M400CST11NW5%O2=M400CST11NW5%O3=M400CNNT11NW5%O4=M400CST11NW5%O
OS:5=M400CST11NW5%O6=M400CST11)WIN(W1=8000%W2=8000%W3=8000%W4=8000%W5=8000%
OS:W6=8000)ECN(R=Y%DF=Y%T=41%W=8018%O=M400CNNSNW5%CC=Y%Q=)T1(R=Y%DF=Y%T=41%
OS:S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=41%W=0%S=A%A=Z%F=R%O=%
OS:RD=0%Q=)T5(R=Y%DF=Y%T=41%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=41%W
OS:=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=41%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)
OS:U1(R=Y%DF=N%T=41%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%D
OS:FI=N%T=41%CD=S)
Network Distance: 0 hops
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.54 seconds
Клиент - Windows 8.1 & Windows 2012 R2:
http://s016.radikal.ru/i335/1503/52/9fd293065591.png
получаю предупреждение что шифрования не будет:
http://s018.radikal.ru/i511/1503/cd/9327d923cfbd.png
Жмякаю подключить, ввожу пользователя и пароль - всё работает!
как только настраиваю IPsec - получаю ошибку 789.
Нашёл видео, где (https://www.youtube.com/watch?v=YCbxTVonZJc) настраивается согласование IPsec, но мне не помогло. Судя по комментариям не всем помогает.
Сервер находится за натом, проброшены порты (без проброса ничего не работало):
http://i074.radikal.ru/1503/69/d97ad7622551.png
пробрасывал GRE, ESP - не помогало. Их вообще нужно пробрасывать?
в чём проблема? Чего не хватает?
ps.: на сервере 2012 R2 нет возможности удалить методы безопасности :
http://s017.radikal.ru/i408/1503/1d/98178a847f6f.png
Спасибо.