Build an L2TP VPN Server in Linux

Source: Internet
Author: User
Article Title: Build an L2TP VPN Server on the Linux system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Use Linux as an L2TP VPN Server.

First install RHEL5 and then:

Make

Make install

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

1. Modify/etc/xl2tpd/xl2tpd. conf 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 with the following content:

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 as follows:

Myvpntest *

4. Edit the/etc/init. d/xl2tpd file with the following content:

  

#!/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 executable permissions to the xl2tpd file.

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, and HA.

The manufacturer came, and the technicians joined the box for a while. Then they said the device was okay, but they saw that the bandwidth had been occupied. We suggest you contact your ISP. So I immediately contacted the ISP and requested a temporary increase in bandwidth. Fortunately, the ISP agreed to be more refreshing. After the bandwidth increases, it seems that the fault has been rectified. It seems that today we are busy, and the newly installed server has to be put aside. Wait for a chance and try again.

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.