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