linux下安装PacketiX VPN 客户端

上网、浏览、聊天、下载等
头像
erol
帖子: 61
注册时间: 2010-05-16 23:17

linux下安装PacketiX VPN 客户端

#1

帖子 erol » 2010-05-21 0:14

linux下安装PacketiX VPN 客户端

英文原帖地址:http://wan.pengganas.net/entry/packetix ... -on-linux/
并不全是翻译,我补充了一些,希望对英语盲有用
文中涉及到
目录vpnclient,即PacketiX VPN 客户端的安装文件所在的目录
可执行文件vpnclient,目录vpnclient中的一个文件
可执行文件vpncmd,目录vpnclient中的一个文件
启动脚本vpnclient,我编的用来执行目录vpnclient中的可执行文件vpnclient的脚本
启动脚本vpncmd,我编的用来执行目录vpnclient中的可执行文件vpncmd的脚本



1. 安装PacketiX VPN 客户端依赖的软件包: zlib, openssl, readline, and ncurses

代码: 全选

sudo apt-get install zlib1g-dev libreadline-dev openssl libncurses5-dev

2. 下载PacketiX VPN 客户端,从
http://www.packetix.net/en/secure/install/
http://www.plathome.com/products/packetix/download.html


3. 解压PacketiX VPN 客户端的安装文件,进入安装文件所在的文件夹,编译PacketiX VPN 客户端

代码: 全选

tar -zxvf vpnclient-5350a-rtm-en-linux-x86.tar.gz && cd vpnclient* && make
注释1.使用星号*可以匹配文件名中的任何字符串,考虑到以后版本解压出的目录名称部分不确定,所以在vpnclient后面加上星号
注释2.有一个隐藏文件.install.sh,用来询问用户是否同意使用协议, 不用运行它,它在make的过程中已经执行过了


4.下载secure.vpn,复制到目录vpnclient
http://www.packetix.net/en/secure/secure.vpn


5. 我个人希望将可执行文件vpnclient可执行文件vpncmd作为系统命令,对此没有要求的请跳过这步
目录vpnclient复制到目录 /usr/lib下

代码: 全选

sudo cp -r vpnclient /usr/lib
我编了如下脚本来执行目录vpnclient内的可执行文件vpnclient可执行文件vpncmd
启动脚本vpnclient

代码: 全选

#!/bin/bash
vpnclientpath=/usr/lib/vpnclient
if [ ! -w $vpnclientpath ]
then
sudo chmod 777 $vpnclientpath
fi
cd $vpnclientpath
./vpnclient "$*"
exit 0

启动脚本vpncmd

代码: 全选

#!/bin/bash
vpnclientpath=/usr/lib/vpnclient
if [ ! -w $vpnclientpath ]
then
sudo chmod 777 $vpnclientpath
fi
cd $vpnclientpath
./vpncmd "$*"
exit 0
下载启动脚本vpnclient启动脚本vpncmd
shell-vpnclient-and-vpncmd.tar.gz
vpnclient 和 vpncmd 的启动脚本
(246 Bytes) 已下载 520 次
启动脚本vpnclient启动脚本vpncmd解压出之后复制到目录 /usr/bin下

代码: 全选

sudo cp vpnclient /usr/bin
sudo cp vpncmd /usr/bin

6. 启动vpnclient

代码: 全选

./vpnclient start
如果要退出vpnclient

代码: 全选

./vpnclient stop

7. 启动vpncmd进行设置

代码: 全选

./vpncmd
在第一次选择中选 2,即管理vpn客户端

代码: 全选

Select 1, 2 or 3: 2 
然后输入要管理的vpn客户端的位置,默认是localhost

代码: 全选

Input destination: localhost
这时就出现了VPN Client>的提示符,我们就可以做下面的步骤了



8. 在vpncmd中输入niccreate来创建一个虚拟网卡

代码: 全选

VPN Client>NicCreate
然后给这个虚拟网卡起一个名字,这里我们管它叫0

代码: 全选

Virtual Network Adapter Name: 0

9. 检查上一步的成果,列出所有的虚拟网卡

代码: 全选

VPN Client>NicList
然后就可以看到虚拟网卡的列表了

代码: 全选

NicList command - Get List of Virtual Network Adapters
Item                        |Value
----------------------------+-----------------------------------
Virtual Network Adapter Name|0
Status                      |Enabled
MAC Address                 |00AC9D035CF6
Version                     |Version 2.20 Build 5350   (English)
The command terminated normally.

10.导入vpn账户配置文件secure.vpn,注意刚才我们已经把secure.vpn复制到目录vpnclient里了

代码: 全选

VPN Client>AccountImport  

然后输入我们要到入的设置文件的文件名

代码: 全选

Import Source File Name: secure.vpn 
出现这个就说明导入成功

代码: 全选

The VPN Connection Setting "Secure" was imported.
The command terminated normally

11.如果是手工创建vpn账户配置,假设按照secure.vpn中的内容设置,过程如下

代码: 全选

VPN Client>AccountCreate
然后给这个账户配置起一个名字

代码: 全选

Name of VPN Connection Setting: Secure 
然后输入目标VPN服务器网址及端口

代码: 全选

Destination VPN Server Host Name and Port Number: public.softether.com:443
然后输入目标虚拟集线器名称

代码: 全选

Destination Virtual HUB Name: PUBLIC
然后输入用户名

代码: 全选

Connecting User Name: PUBLIC
然后输入该设置所用的虚拟网卡的名称

代码: 全选

Used Virtual Network Adapter Name: 0


12.查看我们上一步的劳动成果,列出vpn账户配置

代码: 全选

VPN Client>AccountList
然后会出现

代码: 全选

AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+-----------------------------------------------
VPN Connection Setting Name |Secure
Status                      |Offline
VPN Server Address          |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.

13.按账户配置启动vpn连接

代码: 全选

VPN Client>AccountConnect
然后输入此次连接所使用的配置的名称,本文中是我们刚才创建的Secure

代码: 全选

Name of VPN Connection Setting: Secure 
如果想退出vpncmd,则输入quit

代码: 全选

VPN Client>quit
断开的话就执行

代码: 全选

VPN Client>AccountDisconnect

14.将某个账户配置设成一启动vpnclient,就自动连接的方式

代码: 全选

VPN Client>AccountStartupSet
然后输入连接所使用的配置的名称

代码: 全选

Name of VPN Connection Setting: VPN

15.如果我们已经用某个账户配置连接VPN的话,查看连接信息
这步是在终端下执行的,不是在vpncmd下

代码: 全选

root@bur8:~/vpnclient> ifconfig vpn_0
然后出现

代码: 全选

vpn_0 Link encap:Ethernet  HWaddr 00:ac:9d:03:5c:f6
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:1603 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:463867 (463.8 KB)  TX bytes:0 (0.0 B)


我自己一直执行到这一步都正常,但是虚拟网卡好像没接到笔记本的wifi网卡上,而是接到了以太网卡上,先做一下验证,剩下的我以后再翻译


英文原文:

PacketiX.NET vpn client installation on linux

In tips & tricks on 8 August 2009 tagged simple packetix free vpn guide with 14 comments

recently i'm been using packetix.net vpn and the speed is quite good... unfortunately there's not many guide on how to use the client on linux, so i'm writing one.

this gonna be very long..so bear with me till the end ..huhu

0. to make things easier, lets transform into root :D
sudo su && cd

1. now, make a folder name vpn and download the vpnclient file from their web http://packetix.net/en/secure/install/
mkdir vpn && cd vpn
wget -c http://packetix.net/en/special/files/vp ... x86.tar.gz

2. now to compile this files, you need zlib, openssl, readline and ncurses.
apt-get install zlib1g-dev libreadline5-dev

3. once finish,extract the file and continue with compile
tar -zxvf vpnclient-5350a-rtm-en-linux-x86.tar.gz && cd vpnclient* && make
4. connecting/tunneling to packettix.net
./vpnclient start
./vpncmd

5. inside vpncmd
choose number 2
[2] Management of VPN Clinet and input localhost as the destination host
u will see something like this...
Input destination: localhost
Connected to VPN Client "localhost".
VPN Client>

6. now configuring your connection....read..and follow
root@bur8:~/vpnclient> ./vpncmd
vpncmd command - PacketiX VPN Command Line Management Utility
PacketiX VPN Command Line Management Utility (vpncmd command)
Version 2.20 Build 5350 (English)
Compiled Oct 9 2007 01:27:58 by yagi at ILC308
Copyright (C) 2004-2007 SoftEther Corporation. All Rights Reserved.
By using vpncmd program, the following can be achieved.
1. Management of VPN Server or VPN Bridge
2. Management of VPN Clinet
3. Use of VPN Tools (certificate creation and communication speed measurement)

Select 1, 2 or 3: 2

Specify the host name or IP address of the computer that the destination VPN Client is operating on.
If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
Input destination: localhost

Connected to VPN Client "localhost".
VPN Client>niccreate
NicCreate command - Create New Virtual Network Adapter
Virtual Network Adapter Name: 0
The command terminated normally.

*** now lets configure our account and connection

VPN Client>niclist
NicList command - Get List of Virtual Network Adapters
Item |Value
----------------------------+-----------------------------------
Virtual Network Adapter Name|0
Status |Enabled
MAC Address |00AC9D035CF6
Version |Version 2.20 Build 5350 (English)
The command terminated normally.

VPN Client>accountcreate
AccountCreate command - Create New VPN Connection Setting
Name of VPN Connection Setting: VPN
Destination VPN Server Host Name and Port Number: public.softether.com:443
Destination Virtual HUB Name: PUBLIC
Connecting User Name: PUBLIC
Used Virtual Network Adapter Name: 0
The command terminated normally.

VPN Client>accountlist
AccountList command - Get List of VPN Connection Settings
Item |Value
----------------------------+-----------------------------------------------
VPN Connection Setting Name |VPN
Status |Offline
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.

VPN Client>accountconnect
AccountConnect command - Start Connection to VPN Server using VPN Connection Setting
Name of VPN Connection Setting: VPN
The command terminated normally.

*** wait for awhile and list the account again

VPN Client>accountlist
AccountList command - Get List of VPN Connection Settings
Item |Value
----------------------------+-----------------------------------------------
VPN Connection Setting Name |VPN
Status |Connected
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.

*** set this as default connection everytime vpnclient started

VPN Client>AccountStartupSet
AccountStartupSet command - Set VPN Connection Setting as Startup Connection
Name of VPN Connection Setting: VPN
VPN Client>quit

7. now check for connection... note the value of _0 at the end of vpn
root@bur8:~/vpnclient> ifconfig vpn_0
vpn_0 Link encap:Ethernet HWaddr 00:ac:9d:03:5c:f6
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1603 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:463867 (463.8 KB) TX bytes:0 (0.0 B)

7. get dhcp from vpn
root@bur8:~/vpnclient> dhclient vpn_0
Listening on LPF/vpn_0/00:ac:9d:03:5c:f6
Sending on LPF/vpn_0/00:ac:9d:03:5c:f6
Sending on Socket/fallback
DHCPREQUEST of 10.3.83.250 on vpn_0 to 255.255.255.255 port 67
DHCPACK of 10.3.83.250 from 10.0.0.1
bound to 10.3.83.250 -- renewal in 437751335 seconds.

root@bur8:~/vpnclient> ifconfig vpn_0
vpn_0 Link encap:Ethernet HWaddr 00:ac:9d:03:5c:f6
inet addr:10.3.83.250 Bcast:10.255.255.255 Mask:255.0.0.0

now you can start routing you connection to vpn..
sorry but this is a noob routing technique...it will redirect all your traffic to vpn

route del default
route add default dev vpn_0

for more about how to do advance routing in linux please refer to http://lartc.org/howto/index.html
p/s: to back to your current connection.. stop the service and reroute back to your original gateway.
in my case
./vpnclient stop
route del default
route add default dev ppp0
where ppp0 is my celcom 3g modem interface

for those who didn't know what the hell packetix.net is....

PacketiX.NET is an academic, non-profit online environment for PacketiX VPN, the VPN technology developed by SoftEther Corporation.

more info please visit their website at http://packetix.net/en/

update: you need to enable ipforwarding or else you won't be able to connect to internet.
$ echo 1 > /proc/sys/net/ipv4/ip_forward
or simply edit your /etc/sysctl.conf file

hope it this guide will give benefit to everyone.. thank you ;)
上次由 erol 在 2010-05-22 9:49,总共编辑 1 次。
伊吹风子的邻居常说:那孩子是个普通的地球人
头像
erol
帖子: 61
注册时间: 2010-05-16 23:17

Re: linux下安装PacketiX VPN 客户端

#2

帖子 erol » 2010-05-21 13:49

在vpncmd下AccountList显示连接上了,但因为虚拟网卡0连到了我笔记本以太网的网卡,而不是wifi的网卡,所以还没成功...
伊吹风子的邻居常说:那孩子是个普通的地球人
头像
it5u
帖子: 64
注册时间: 2009-06-14 18:22

Re: linux下安装PacketiX VPN 客户端

#3

帖子 it5u » 2011-01-11 11:44

ubuntu10.10,PacketiX VPN3.0中文版,在执行网卡制作时出错了,HELP ME!

VPN Client>niccreate
NicCreate 命令 - 新的虚拟 LAN 卡的制作
虚拟 LAN 卡名:0

发生错误。(错误代码: 31)
虚拟网络适配器的设备驱动程序安装失败。

试了2.0英文版,也是一样的情况,不知道问题出在哪儿。
大家牛才是真的牛!
lazily
帖子: 21
注册时间: 2009-03-28 10:13

Re: linux下安装PacketiX VPN 客户端

#4

帖子 lazily » 2011-02-01 12:49

多谢
赶紧试试
头像
hcym
帖子: 15634
注册时间: 2007-05-06 2:46

Re: linux下安装PacketiX VPN 客户端

#5

帖子 hcym » 2011-02-01 13:05

赶紧试试
:em04
وإذا كان هذا لا يحصل أكثر من 100 ملاحظات ، انا ذاهب الى غضب
xep007
帖子: 871
注册时间: 2006-01-03 20:44

Re: linux下安装PacketiX VPN 客户端

#7

帖子 xep007 » 2011-02-10 22:28

it5u 写了:ubuntu10.10,PacketiX VPN3.0中文版,在执行网卡制作时出错了,HELP ME!

VPN Client>niccreate
NicCreate 命令 - 新的虚拟 LAN 卡的制作
虚拟 LAN 卡名:0

发生错误。(错误代码: 31)
虚拟网络适配器的设备驱动程序安装失败。

试了2.0英文版,也是一样的情况,不知道问题出在哪儿。
请用root启动vpnclient.
xep007
帖子: 871
注册时间: 2006-01-03 20:44

Re: linux下安装PacketiX VPN 客户端

#8

帖子 xep007 » 2011-02-12 23:07

不好用啊。设置了好久,用dhclient vpn_0获得IP后可以上了,但速度奇慢,而且老掉线。google之余找到vpn1010,试一下,挺好用的。特推荐!
http://www.vpn1010.com/referral/7777ec2e
xep007
帖子: 871
注册时间: 2006-01-03 20:44

Re: linux下安装PacketiX VPN 客户端

#9

帖子 xep007 » 2011-02-13 23:50

试了好久,还是gappproxy速度快。
头像
KOSKERS
帖子: 1454
注册时间: 2008-11-01 13:38

Re: linux下安装PacketiX VPN 客户端

#10

帖子 KOSKERS » 2011-02-14 11:20

erol, 伊吹风子??团子大家族里的?
有用Telegram的吗?
欢迎加入公共群组:
https://t.me/joinchat/AAAAAApBLdk7AGFEeQo0fQ
头像
it5u
帖子: 64
注册时间: 2009-06-14 18:22

Re: linux下安装PacketiX VPN 客户端

#11

帖子 it5u » 2011-02-14 11:25

xep007 写了:
it5u 写了:ubuntu10.10,PacketiX VPN3.0中文版,在执行网卡制作时出错了,HELP ME!

VPN Client>niccreate
NicCreate 命令 - 新的虚拟 LAN 卡的制作
虚拟 LAN 卡名:0

发生错误。(错误代码: 31)
虚拟网络适配器的设备驱动程序安装失败。

试了2.0英文版,也是一样的情况,不知道问题出在哪儿。
请用root启动vpnclient.
呵呵,你太强了,我咋就没想到sudo ./vpnclient呢,我说sudo ./vpncmd了怎么还是不行呢,谢谢,没问题了!
大家牛才是真的牛!
xep007
帖子: 871
注册时间: 2006-01-03 20:44

Re: linux下安装PacketiX VPN 客户端

#12

帖子 xep007 » 2011-02-14 23:33

it5u 写了:
xep007 写了:
it5u 写了:ubuntu10.10,PacketiX VPN3.0中文版,在执行网卡制作时出错了,HELP ME!

VPN Client>niccreate
NicCreate 命令 - 新的虚拟 LAN 卡的制作
虚拟 LAN 卡名:0

发生错误。(错误代码: 31)
虚拟网络适配器的设备驱动程序安装失败。

试了2.0英文版,也是一样的情况,不知道问题出在哪儿。
请用root启动vpnclient.
呵呵,你太强了,我咋就没想到sudo ./vpnclient呢,我说sudo ./vpncmd了怎么还是不行呢,谢谢,没问题了!
你好。没问题?你能翻出去?速度怎样?
tigerfellow
帖子: 2
注册时间: 2011-05-01 1:39

Re: linux下安装PacketiX VPN 客户端

#13

帖子 tigerfellow » 2011-05-29 16:27

it5u 写了:
xep007 写了:
it5u 写了:ubuntu10.10,PacketiX VPN3.0中文版,在执行网卡制作时出错了,HELP ME!

VPN Client>niccreate
NicCreate 命令 - 新的虚拟 LAN 卡的制作
虚拟 LAN 卡名:0

发生错误。(错误代码: 31)
虚拟网络适配器的设备驱动程序安装失败。

试了2.0英文版,也是一样的情况,不知道问题出在哪儿。
请用root启动vpnclient.
呵呵,你太强了,我咋就没想到sudo ./vpnclient呢,我说sudo ./vpncmd了怎么还是不行呢,谢谢,没问题了!
为何我的一直是connecting呢?一直链接不上怎么回事?
yangzy666
帖子: 1
注册时间: 2011-05-11 8:54

Re: linux下安装PacketiX VPN 客户端

#14

帖子 yangzy666 » 2011-05-30 15:31

......................................

10.导入vpn账户配置文件secure.vpn,注意刚才我们已经把secure.vpn复制到目录vpnclient里了

代码: 全选

VPN Client>AccountImport  

然后输入我们要到入的设置文件的文件名

代码: 全选

Import Source File Name: secure.vpn 
出现这个就说明导入成功

代码: 全选

The VPN Connection Setting "Secure" was imported.
The command terminated normally
11.如果是手工创建vpn账户配置,假设按照secure.vpn中的内容设置,过程如下

代码: 全选

VPN Client>AccountCreate
然后给这个账户配置起一个名字

代码: 全选

Name of VPN Connection Setting: Secure 
然后输入目标VPN服务器网址及端口

代码: 全选

Destination VPN Server Host Name and Port Number: public.softether.com:443
然后输入目标虚拟集线器名称

代码: 全选

Destination Virtual HUB Name: PUBLIC
然后输入用户名

代码: 全选

Connecting User Name: PUBLIC
然后输入该设置所用的虚拟网卡的名称

代码: 全选

Used Virtual Network Adapter Name: 0
12.查看我们上一步的劳动成果,列出vpn账户配置

代码: 全选

VPN Client>AccountList
然后会出现

代码: 全选

AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+-----------------------------------------------
VPN Connection Setting Name |Secure
Status                      |Offline
VPN Server Address          |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.
...................................

14.将某个账户配置设成一启动vpnclient,就自动连接的方式

代码: 全选

VPN Client>AccountStartupSet
然后输入连接所使用的配置的名称

代码: 全选

Name of VPN Connection Setting: VPN
...................................

楼主搞错了,你导入连接(第10步)或者新建连接(第11步)的时候,连接设置名是叫secure,而你在操作第14步,也就是执行AccountStartupSet时,你输入的连接设置名却叫VPN,如果执行这一步的话,会有这个连接设置名不存在之类的错误提示,可见楼主并没有真正执行到这个步骤,而是从英文后半部分翻译过来的(因为英文里的操作自始至终一直取名叫VPN,所以前后名称一致,不会出错)
头像
以父之名
帖子: 24
注册时间: 2007-12-27 10:40

Re: linux下安装PacketiX VPN 客户端

#15

帖子 以父之名 » 2011-06-30 22:55

代码: 全选

vpncmd 命令 - PacketiX VPN 命令行管理工具
PacketiX VPN 命令行管理工具 (vpncmd 命令)
Version 3.02 Build 7392   (Simplified_Chinese)
Compiled 2011/02/28 19:08:12 by yagi at pc25
Copyright (C) 2004-2011 SoftEther Corporation. All Rights Reserved.

通过使用 vpncmd 程序,可以取得以下成果。

1. 管理的 VPN Server 或 VPN Bridge
2. 管理 VPN Client
3. 使用 VPN 工具 (创建证书和通信速度测量)

选择 1, 2 或 3: 2

指定的主机名或正在运行的目标 VPN Client 计算机的 IP 地址。
如果不输入任何内容并且按下回车键,将连接到本地主机 (这台电脑)。
输入目标主机名或 IP 地址: loaclhost

发生错误。(错误代码: 1)
服务器连接失败。请检查网络连接,地址和端口是否正确。
已经root,仍然出现这种情况。 :em20
回复