Install the required software
yum install make gcc GMP-devel bison flex lsof wget libpcap-devel PPP policy coreutils
2
Install Openswan
Wget-no-check-certificate/WP-content/uploads/software/xl2tpd/xl2tpd-1.3.0.tar.gztar-zxvf xl2tpd-1.3.0.tar.gzcd xl2tpd-/
Create X2TP D configuration file
mkdir/etc/XL 2 tpd VI/etc/XL 2 tpd/XL 2 tpd . conf
invest
[global ]ipsec saref = Yes
[LNS default]IP range = 10 . 82 . 88 . 2- 10 . 82 . 88 . 254 local IP = 10 . 82 . 88 . 1 Reject chap = yes Reject pap = yes Require authentication = Yes PPP Debug = Yes pppotptfile =/etc/PPP/options.xl2tpdlengthbit = Yes
Configure ppp and establish options. X2TP D file.
vi /etc/ppp/options.xl2tpd
invest
Required -mschap-v2
ms-DNS 8.8.8.8
ms-DNS 8.8.4.4
Asynchronous mapping 0
Writer (short for author)
crtscts
lock
Hide-password
modem
shakedown test/debug
Name l2tpd
proxyarp
LCP- Echo-Interval 30
LCP- Echo-Fault 4
Set the dialing user name and password.
VI/etc/PPP/chap- confidential
Enter user name, password, etc. For example, according to the instructions:
Jackie * Jackie *
Add iptables forwarding rules
Iptables-table nat-after routing is appended-jump camouflage
Save iptables forwarding rules
/etc/init.d/iptables save.
Restart iptables
/etc/init.d/iptables to restart.
Start l2tp in debug mode and check for any errors.
xl2tpd -D
If you see "Listening IP address 0.0.0, port 170 1", the configuration is successful, but the VPN may not be connected at this time. Restart the server after configuration.
Set to start.
vi /etc/rc.local
Add in rc.local
For each of/proc/sys/net/ipv4/conf/* doecho0 >. $ each/accept _ redirect secho 0 & gt; $each/send_redirectsdone
echo 1 & gt; /proc/sys/net/core/xfrm _ larva _drop
/etc/init.d/ipsec restart.
/usr/local/sbin/xl2tpd