Jump to content
sleed

Tutorial Instalare L2TP

Recommended Posts

Posted

TUTORIAL INSTALARE L2TP Debian/Ubuntu

Layer 2 Tunneling Protocol (L2TP) este un protocol de tunelare, folosit în crearea re?elelor private virtuale (VPN).Acesta nu prevede nici un mecanism de criptare sau de confiden?ialitate în sine. Publicat în 1999, ca standard RFC 2661, L2TP î?i are originea în alte dou? protocoale de tunelare mai vechi pentru PPP, Layer 2 Forwarding Protocol (L2F) ?i Point-to-Point Tunneling Protocol (PPTP). De?i ac?ioneaz? la nivelul leg?tur? de date în modelului OSI, protocol L2TP este de fapt un protocol ce ac?ioneaz? la nivelul sesiune ?i folose?te portul înregistrat UDP 1701.

Cum se stabileste sesiunea unui L2TP cu serverul VPN:
-Intâi clientul stabile?te un tunel IPsec cu serverul VPN
-Clientul ?i serverul L2TP stabilesc apoi un tunel L2TP în vârful tunelului IPsec.
-Se stabile?te o sesiune PPP în partea superioara a tunelului L2TP, spre exemplu, pachetele PPP sunt încapsulate ?i trimise/recep?ionate în cadrul tunelului IPsec

2mq91f7.jpg

1) apt-get install xl2tpd openswan [// Raspundeti cu nu cand va cere X.509 Certificate]

2) In sysctl.conf, adaugati :

net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0

3) Configuram /etc/ipsec.conf

config setup

protostack=netkey

nat_traversal=yes

oe=off

conn L2TP-PSK-NAT

rightsubnet=vhost:%priv

also=L2TP-PSK-noNAT

conn L2TP-PSK-noNAT

authby=secret

pfs=no

auto=add

keyingtries=3

rekey=no

ikelifetime=8h

keylife=1h

type=transport

left=1.1.1.1 [adaugam ip ul statiei aici]

leftprotoport=17/1701

right=%any

rightprotoport=17/1701

conn passthrough-for-non-l2tp

type=passthrough

left=1.1.1.1. [adaugam ip ul aici]

leftnexthop=0.0.0.0

right=0.0.0.0

rightsubnet=0.0.0.0/0

auto=route

5) Deschidem /etc/ipsec.secrets si adaugam :

1.1.1.1 %any: "parolamea" , unde 1.1.1.1 e ipv4 de la statia noastra si parolamea, putem seta orice parola.

E recomandat sa acordam permisii doar pentru root.

6) Configuram xl2tpd, nano /etc/xl2tpd/xl2tpd.conf :

[global]
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets
access control = no
rand source = dev

[lns default]
exclusive = no
; enter the IP range you wish to give out to your clients here
ip range = 192.168.1.2 - 192.168.1.245
; address of the L2TP end of the tunnel (i.e. this machine)
local ip = 192.168.1.1
refuse authentication = yes
refuse pap = yes
refuse chap = yes
ppp debug = no
pppoptfile = /etc/ppp/options.l2tpd

8) Adaugam configuratia PPP : nano /etc/ppp/options.l2tpd

nobsdcomp
passive
lock

# Allow all usernames to connect.
name *
proxyarp
ipcp-accept-local
ipcp-accept-remote
lcp-echo-failure 10
lcp-echo-interval 5
nodeflate

# Do not authenticate incoming connections. This is handled by IPsec.
noauth
refuse-chap
refuse-mschap
refuse-mschap-v2

# Set the DNS servers the PPP clients will use.
ms-dns 8.8.8.8 # <-- change this to the IPv4 address of your DNS server
ms-dns 8.8.4.4 # <-- add extra entries if necessary

mtu 1400
mru 1400

7) Restart:


/etc/init.d/ipsec restart
/etc/init.d/xl2tpd restart

Si verificam daca totul este configurat :

ipsec verify

Multumesc pentru atentie.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...