5. 安装及用法
源码直接从SVN上获取,里面包含了V1和V2两个版本,我编译的是V2版本
#svn cohttps://svn.ntop.org/svn/ntop/trunk/n2n
#cd # cd n2n/n2n_v2
#make
#make install
编译安装后,多了两个应用:supernode和edge
l 启动supernode
# supernode -l <listening port>
参数-l是监听的端口,进程缺省是运行在后台的。可选参数:
supernode usage
-l <lport> Set UDP main listen port to <lport>
-f Run in foreground.
-v Increase verbosity. Can be used multiple times.
-h This help message.
|
l Ege的用法:
#edge-a 10.10.0.1 -c mypbxn2n -k mypbxn2n -l 192.168.122.180:8888 -s 255.255.0.0
edge -a 虚拟IP -c 你的虚拟网名 -k 密码 -l supernodeip:端口 -s 子网掩码
edge -d <tun device> -a [static:|dhcp:]<tun IP address> -c <community> [-k <encrypt key> | -K <key file>] [-s <netmask>] [-u <uid> -g <gid>][-f][-m <MAC address>]
-l <supernode host:port> [-p <local port>] [-M <mtu>] [-r] [-E] [-v] [-t <mgmt port>] [-b] [-h]
-d <tun device> | tun device name
-a <mode:address> | Set interface address. For DHCP use '-r -a dhcp:0.0.0.0'
-c <community> | n2n community name the edge belongs to.
-k <encrypt key> | Encryption key (ASCII) - also N2N_KEY=<encrypt key>. Not with -K.
-K <key file> | Specify a key schedule file to load. Not with -k.
-s <netmask> | Edge interface netmask in dotted decimal notation (255.255.255.0).
-l <supernode host:port> | Supernode IP:port
-b | Periodically resolve supernode IP
: (when supernodes are running on dynamic IPs)
-p <local port> | Fixed local UDP port.
-u <UID> | User ID (numeric) to use when privileges are dropped.
-g <GID> | Group ID (numeric) to use when privileges are dropped.
-f | Do not fork and run as a daemon; rather run in foreground.
-m <MAC address> | Fix MAC address for the TAP interface (otherwise it may be random)
: eg. -m 01:02:03:04:05:06
-M <mtu> | Specify n2n MTU of edge interface (default 1400).
-r | Enable packet forwarding through n2n community.
-E | Accept multicast MAC addresses (default=drop).
-v | Make more verbose. Repeat as required.
-t | Management UDP Port (for multiple edges on a machine).
Environment variables:
N2N_KEY | Encryption key (ASCII). Not with -K or -k.
|
l Windows版
我没有在Win32下自己编译,http://www.vpnhosting.cz/n2nguien.exe提供了一个安装包,里面包含了V1和V2版本,注意使用时和自己所选版本的匹配。
单击advanced按键,勾选Enable packet forwarding through n2n community
注意在win7下,安装目录下的所有可执行文件,均需要以管理员身份运行。