代码:
代码: 全选
# coding: utf-8
from gate_way import gate_list
import os
ppp0_flag = os.system('ifconfig | grep ppp0')
for i in range(1, 60):
os.system('echo user_password | sudo pptpsetup --create test --server gate_list[%d] --username MyName --password MyPassword --start' % i)
if ppp0_flag == 256:
pass
else:
break
有时候是这样
Using interface ppp0
Connect: ppp0 <--> /dev/pts/14
LCP: timeout sending Config-Requests
Connection terminated.
Modem hangup
------------------
有时候是
anon warn[open_inetsock:pptp_callmgr.c:329]: connect: Connection timed out
anon fatal[callmgr_main:pptp_callmgr.c:127]: Could not open control connection to 49.2.123.56
anon fatal[open_callmgr:pptp.c:487]: Call manager exited with error 256
追加描述:
之前用图形界面配置VPN可以连接,但是不稳定,每次手动重新更改网关很重复费时。