本文内容参考:

https://wiki.archlinux.org/index.php/PPTP_Client

bsp包添加pptp软件支持

build/conf/local.conf
IMAGE_INSTALL_append = " ppp pptp-linux"

开发板LINUX配置PPTP

新建vpn用户名和密码, 在/etc/ppp/chap-secrets添加以下内容

/etc/ppp/chap-secrets
[username] PPTP "[password]" *

[username] 为vpn的用户名

[password] 为vpn用户密码

[vpn密码需要加上双引号

创建VPN通道

在开发板的/etc/ppp/peers目录下添加vpn通道文件[tunnel], 内容参考如下

/etc/ppp/peers/[ tunnel ]
pty "/usr/sbin/pptp [server] --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
name [username]
remotename PPTP
ipparam [tunnel]
require-mppe-128

[server] 为VPN服务器地址

[username]为VPN用户名

[tunnel]为VPN连接的通道名

如果不需要MPPE支持, require-mppe-128就要去掉.

更多tunnel文件的配置信息参考:

https://ppp.samba.org/pppd.html

连接VPN

root@phyboard-mira-imx6-3:~# pon [tunnel]

链接完成后, 可查到ppp0接口

root@phyboard-mira-imx6-3:~# ifconfig
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:180.180.1.3  P-t-P:180.180.1.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1396  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:1016 (1016.0 B)  TX bytes:278 (278.0 B)
  • No labels