当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > 用Linux系统自身做一个L2TP的VPN服务器
Linux服务器 中的 用Linux系统自身做一个L2TP的VPN服务器
用Linux自身做一个L2TP的VPN服务器。
先安装了RHEL5,然后到
make
makeinstall
安装完毕后,修改相关的配置文件:
1、修改/etc/xl2tpd/xl2tpd.conf,内容如下:
[lnsdefault]
iprange=192.168.191.2-192.168.191.254
localip=192.168.191.1
requirechap=yes
refusepap=yes
requireauthentication=yes
name=l2tpvpnserver
pppdebug=yes
pppoptfile=/etc/ppp/options.xl2tpd
lengthbit=yes
2、修改/etc/ppp/options.xl2tpd,内容如下:
ipcp-accept-local
ipcp-accept-remote
noccp
auth
crtscts
idle1800
mtu1410
mru1410
nodefaultroute
debug
lock
proxyarp
connect-delay5000
3、修改/etc/ppp/chap-secrets,内容如下
myvpntest*myvpntest*
4、编辑/etc/init.d/xl2tpd文件,内容如下:
用chmod命令给xl2tpd文件赋予可执行权限。 将xl2tpd加入到系统服务中去: chkconfig——addxl2tpd 用setup命令设置xl2tpd服务为开机自动启动。 至此,L2TP的VPN服务器配置完成。在WindowsXP中建立一个VPN连接,IP输入这个服务器的IP地址,用户名myvpntest,密码myvpntest,连接,哈,上去了。 厂商来人了,技术人员连上小盒子捣鼓了一阵,然后说设备没有问题,但看到带宽已被占用完了,建议还是跟ISP联系。于是马上联系ISP,要求临时增加带宽,还好,ISP答应比较爽快。带宽增加后,靠,居然故障排除了,看来今天白忙了,刚装好的服务器只好搁置到一边了,等下次有机会,再试一下。#!/bin/sh##xl2tpdThisshellscripttakescareofstartingandstoppingl2tpd.##chkconfig:-8030#description:Layer2TunnellingProtocolDaemon(RFC2661)##processname:xl2tpd#config:/etc/xl2tpd/xl2tpd.conf#pidfile:/var/run/xl2tpd.pid#ServicenameSERVICE=xl2tpd#Sourcefunctionlibrary../etc/rc.d/init.d/functions#Sourcenetworkingconfiguration../etc/sysconfig/networkif[${NETWORKING}="no"]thenexit0fi[-x/usr/sbin/$SERVICE]||exit0RETVAL=0start(){echo-n"Starting$SERVICE:"if[!-d/var/run/xl2tpd]thenmkdir/var/run/xl2tpdfidaemon$SERVICERETVAL=$?[$RETVAL-eq0]&&touch/var/lock/subsys/$SERVICEecho""return$RETVAL}stop(){echo-n"Stopping$SERVICE:"killproc$SERVICERETVAL=$?echo[$RETVAL-eq0]&&rm-f/var/lock/subsys/$SERVICEreturn$RETVAL}restart(){stopstart}#Seehowwewerecalled.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}"exit1esac
评论 (0) All