下载libpcap-1.2.1.tar.bz
bzip2 -d libpcap-1.2.1.tar.bz
tar xvf libpcap-1.2.1.tar
cd libpcap-1.2.1
./configure --host=mips-linux --with-pcap=linux
make
cp pcap.h pcap-bpf.h pcap-namedb.h pcap/bpf.h pcap/bluetooth.h pcap/ipnet.h pcap/namedb.h pcap/pcap.h pcap/sll.h pcap/vlan.h pcap/usb.h /home/liuXW/mips_project/pb44fus-wapi/build/gcc-3.4.4-2.16.1/build_mips/include
cp libpcap.a /home/liuXW/mips_project/pb44fus-wapi/build/gcc-3.4.4-2.16.1/build_mips/lib
cp libpcap.so.1.2.1 /home/liuXW/mips_project/pb44fus-wapi/build/gcc-3.4.4-2.16.1/build_mips/lib
cd /home/liuXW/mips_project/pb44fus-wapi/build/gcc-3.4.4-2.16.1/build_mips/lib
ln -s libpcap.so.1.2.1 libpcap.so
下载xl2tpd-1.3.1.tar.gz
tar zxvf xl2tpd-1.3.1.tar.gz
cd xl2tpd-1.3.1
在Makefile第121行插入-static,使其链接静态库编译
make CC=mips-linux-gcc
将xl2tpd 和 xl2tpd-control下载到板子上的/usr/sbin
mkdir -p /var/run/xl2tpd
mkdir /etc/xl2tpd
L2TP服务器
cd /etc/xl2tpd
vi xl2tpd.conf 写入
[lns default]
ip range = 192.168.10.128-192.168.10.254
local ip = 192.168.10.99
require chap = yes
refuse pap = yes
require authentication = yes
name = LinuxVPNserver
ppp debug = yes
cd /etc/ppp
vi chap-secrets 写入
user_l2tp LinuxVPNserver password_l2tp *
启动xl2tpd: xl2tpd -D
L2TP客户端
cd /etc/xl2tpd
vi xl2tpd.conf 写入
[lac testvpn]
lns = server_ip #服务器ip
pppoptfile = /etc/ppp/peers/test.l2tpd
ppp debug = yes
cd /etc/ppp/peers/
vi test.l2tpd 写入
user "user_l2tp"
password "password_l2tp"
启动xl2tpd: xl2tpd
开始拨号:echo 'c testvpn' > /var/run/xl2tpd/l2tp-control
断开连接:echo 'd testvpn' > /var/run/xl2tpd/l2tp-control
阅读(2912) | 评论(0) | 转发(0) |