Build an L2TP VPN Server in Linux

Source: Internet
Author: User

First install RHEL5 and then:

# Make

# Make install

After the installation is complete, modify the relevant configuration file:

1. Modify/etc/xl2tpd/xl2tpd. conf,The content is as follows:

[Lns default]

Ip range = 192.168.191.2-192.168.191.254
Local ip = 192.168.191.1
Require chap = yes
Refuse pap = yes
Require authentication = yes
Name = l2tpvpnserver
Ppp debug = yes
Pppoptfile =/etc/ppp/options. xl2tpd
Length bit = yes

2. Modify/etc/ppp/options. xl2tpd,The content is as follows:

Ipcp-accept-local
Ipcp-accept-remote
Noccp
Auth
Crtscts
Idle 1800
Mtu 1410
Mru 1410
Nodefaultroute
Debug
Lock
Proxyarp
Connect-delay 5000

3. Modify/etc/ppp/chap-secrets,The content is as follows:

Myvpntest *

4. Edit the/etc/init. d/xl2tpd file,The content is as follows:

     
      #!/bin/sh## xl2tpd This shell script takes care of starting and stopping l2tpd.## chkconfig: - 80 30# description: Layer 2 Tunnelling Protocol Daemon (RFC 2661)## processname: xl2tpd# config: /etc/xl2tpd/xl2tpd.conf# pidfile: /var/run/xl2tpd.pid#ServicenameSERVICE=xl2tpd# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/networkif [ ${NETWORKING} = "no" ]thenexit 0fi[ -x /usr/sbin/$SERVICE ] || exit 0RETVAL=0start() {echo -n "Starting $SERVICE: "if [ ! -d /var/run/xl2tpd ]thenmkdir /var/run/xl2tpdfidaemon $SERVICERETVAL=$?[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICEecho ""return $RETVAL}stop() {echo -n "Stopping $SERVICE: "killproc $SERVICERETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICEreturn $RETVAL}restart() {stopstart}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $SERVICERETVAL=$?;;restart|reload)restart;;condrestart)[ -f /var/lock/subsys/$SERVICE ] && restart || :;;*)echo "Usage: $SERVICE {start|stop|status|restart|reload|condrestart}"exit 1esac
     

Run the chmod command to grant the executable permission to the xl2tpd file:

# Chmod + x xl2tpd

Add xl2tpd to the System Service:

# Chkconfig -- add xl2tpd

Use the setup command to set the xl2tpd service to automatically start upon startup.

Now, the VPN Server Configuration for L2TP is complete. Create a VPN connection in Windows XP. Enter the IP address of the server,

Username myvpntest, password myvpntest, connection, haha, go up.

Related Articles]

  • L2TP-based Remote Access VPN deployment 1
  • Huawei L2TP VPN Config

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.