LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2009, 01:48 AM   #1
ratcateme
Member
 
Registered: Feb 2008
Distribution: CentOS 5.4
Posts: 59

Rep: Reputation: 15
Setting up a L2TP VPN server


im currently just testing and trying to setup a VPN on my home network using Centos 5.3 as the VPN server.
so far i have installed xl2tpd and openswan both will start with no errors and everything looks fine.
i have configured a windows XP desktop to connect to the linux server using CHAP authentication and L2TP/PPP and setup the IPsec PSK pass phrase.
but it fails to connect.
i have used wireshark to confirm that it is sending to the right IP and it is trying to connect to UDP port 500.
i then checked on my linux box with netstat -ln | grep :500
Code:
udp        0      0 127.0.0.1:500               0.0.0.0:*
udp        0      0 10.1.2.1:500                0.0.0.0:*
udp        0      0 10.1.1.2:500                0.0.0.0:*
so the service is started and listening i have turned the firewall off for this testing so i really can't see what the problem is and its really bugging me.
so if anyone could help that would be great

Thanks Scott.
 
Old 10-28-2009, 05:09 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Wonder if 1701 needs to be open?
 
Old 10-28-2009, 11:31 PM   #3
ratcateme
Member
 
Registered: Feb 2008
Distribution: CentOS 5.4
Posts: 59

Original Poster
Rep: Reputation: 15
yep that was a problem i have resloved most of the problems so far.
i have got a bit stuck with PPP and CHAP
i have setup windows right (i think) and i removed authentication and it worked and the VPN established but when i put it on and run xl2tpd in debug mode xl2tpd -D
Code:
xl2tpd[9766]: Enabling IPsec SAref processing for L2TP transport mode SAs
xl2tpd[9766]: IPsec SAref does not work with L2TP kernel mode yet, enabling forceuserspace=yes
xl2tpd[9766]: setsockopt recvref[22]: Protocol not available
xl2tpd[9766]: This binary does not support kernel L2TP.
xl2tpd[9766]: xl2tpd version xl2tpd-1.2.4 started on ratcat.homelinux.com PID:9766
xl2tpd[9766]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.
xl2tpd[9766]: Forked by Scott Balmos and David Stipp, (C) 2001
xl2tpd[9766]: Inherited by Jeff McAdams, (C) 2002
xl2tpd[9766]: Forked again by Xelerance (www.xelerance.com) (C) 2006
xl2tpd[9766]: Listening on IP address 0.0.0.0, port 1701
xl2tpd[9766]: get_call: allocating new tunnel for host 10.1.2.3, port 1701.
xl2tpd[9766]: get_call: allocating new tunnel for host 10.1.2.3, port 1701.
xl2tpd[9766]: control_finish: Peer requested tunnel 26 twice, ignoring second one.
xl2tpd[9766]: build_fdset: closing down tunnel 27350
xl2tpd[9766]: Connection established to 10.1.2.3, 1701.  Local: 57205, Remote: 26 (ref=0/0).  LNS session is 'default'
xl2tpd[9766]: start_pppd: I'm running:
xl2tpd[9766]: "/usr/sbin/pppd"
xl2tpd[9766]: "passive"
xl2tpd[9766]: "nodetach"
xl2tpd[9766]: "10.1.1.2:10.1.1.128"
xl2tpd[9766]: "refuse-pap"
xl2tpd[9766]: "auth"
xl2tpd[9766]: "require-chap"
xl2tpd[9766]: "name"
xl2tpd[9766]: "RatCatVPN"
xl2tpd[9766]: "debug"
xl2tpd[9766]: "file"
xl2tpd[9766]: "/etc/ppp/options.xl2tpd"
xl2tpd[9766]: "/dev/pts/0"
/usr/sbin/pppd: The remote system is required to authenticate itself
/usr/sbin/pppd: but I couldn't find any suitable secret (password) for it to use to do so.
/usr/sbin/pppd: (None of the available passwords would let it use an IP address.)
xl2tpd[9766]: Call established with 10.1.2.3, Local: 21289, Remote: 1, Serial: 0
xl2tpd[9766]: control_finish: Connection closed to 10.1.2.3, serial 0 ()
xl2tpd[9766]: Terminating pppd: sending TERM signal to pid 9775
xl2tpd[9766]: pppd 9775 successfully terminated
xl2tpd[9766]: control_finish: Connection closed to 10.1.2.3, port 1701 (), Local: 57205, Remote: 26
xl2tpd[9766]: build_fdset: closing down tunnel 57205
im connecting from 10.1.2.3 to and the server is at 10.1.2.1
/etc/ppp/chap-secrets contains:
Code:
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
####### redhat-config-network will overwrite this part!!! (end) ############
"scott"                         *       "test"          10.1.0.0/16
*                               "scott" "test"          10.1.0.0/16
and /etc/xl2tpd/xl2tpd.conf
Code:
[global]

debug tunnel = yes

[lns default]
ip range = 10.1.1.128-10.1.1.254
local ip = 10.1.1.2
require chap = yes
refuse pap = yes
require authentication = yes
name = RatCatVPN
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
and /etc/ppp/options.xl2tpd
Code:
ipcp-accept-local
ipcp-accept-remote
noccp
auth
crtscts
idle 1800
mtu 1410
mru 1410
defaultroute
debug
lock
proxyarp
so if you could tell me whats going on that would be great.
Thanks Scott.
 
Old 06-18-2011, 07:44 AM   #4
Randeep
LQ Newbie
 
Registered: Apr 2010
Location: Bangalore
Distribution: Redhat, Centos
Posts: 25

Rep: Reputation: 0
Here is a good link for setting xl2tpd

http://helpinlinux.blogspot.com/2011...-l2tp-vpn.html
 
Old 05-03-2012, 12:51 AM   #5
reverie
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
help!

i`m facing the same question with you on the problem about xl2tp ...have you get it through? would you give me some advises about it and send it an email (6414344322@qq.com),if u are convenient ....thank u very much...

Last edited by reverie; 05-03-2012 at 12:54 AM.
 
Old 06-26-2013, 07:29 AM   #6
amirn
LQ Newbie
 
Registered: Mar 2011
Distribution: Fedora,Ubunutu
Posts: 16

Rep: Reputation: 0
Another Example for xL2TP + VPN

Here is another good example of how to get xl2tp to work with OpenSwan
L2TP OpenSwan Example
 
  


Reply

Tags
centos, ipsec, l2tp, openswan, vpn, xl2tpd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up L2TP over IPSec VPN server under CentOS 5.3 fantasygoat Linux - Networking 6 01-12-2016 03:41 AM
IPSec L2TP VPN server on Ubuntu for iPhone Apollo77 Linux - Networking 27 12-03-2010 09:27 AM
Connecting to VPN using l2tp Artik Linux - Networking 0 05-22-2006 05:06 AM
IPSEC/L2TP VPN Server on Fedora Core 3 using Kernel 2.6 petwalrus Linux - Networking 3 04-21-2005 10:55 AM
L2TP VPN connections to an ISA Server kendoucet Linux - Networking 0 03-24-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration