N2N 安裝方法,適用於 多臺電腦由於處於各自內網環境,不能互通, 但是能夠訪問一臺公共的外網服務器, 通過該服務器實現多臺內網服務器直接的互連互通

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下,安裝目錄下的所有可執行文件,均需要以管理員身份運行。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章