注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

itoedr的it学苑

记录从IT文盲学到专家的历程

 
 
 

日志

 
 

ubuntu下使用n2n  

2013-05-30 06:59:52|  分类: 虚拟网络 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

How to Install n2n VPN on ubuntu

ubuntu下使用n2n - lzdzhy-itoedr - itoedr的it学苑
 
ubuntu下使用n2n - itoedr - itoedr的it学苑
 
 Ubuntu Client

Install n2n:

$ sudo apt-get install n2n

Create /etc/init/n2n.conf:

# n2n - Starts the n2n edge program that connects to the network

#

# This happens automatically when the network device is up.

 

description "connect using n2n"

 

start on net-device-up

 

exec edge -a 10.1.2.49 -c my_network_name -k my_password -l

134.197.117.197:1200

 

respawn

Change your IP address (-a), network name (-c), password (-k) and the

server IP address and port (-l).

Start it using:

$ sudo initctl start n2n

The above n2n command has to be run as root, because it is creating a tun network device.

Mac Client

Install n2n:

$ git clone git://github.com/certik/n2n.git

$ cd n2n/n2n_v1

$ make

Install tuntap device from: http://tuntaposx.sourceforge.net/, follow the INSTALL file, and install things as root, install the startup scripts too.

And run it in screen:

$ screen

$ ./edge  -a 10.1.2.49 -c my_network_name -k my_password -l

134.197.117.197:1200

Test it. If it works, install it into StartupItems. Create

/Library/StartupItems/n2n/StartupParameters.plist:

{

  Description     = "n2n";

  Provides        = ("n2n");

  Requires        = ("ethertap");

  OrderPreference = "None";

}

and /Library/StartupItems/n2n/n2n:

#!/bin/sh

 

##

# Run n2n

##

 

. /etc/rc.common

 

StartService ()

{

    ConsoleMessage "Initializing n2n"

 

    /Users/ondrej/repos/n2n/n2n_v1/edge -f -a 10.1.2.49 -c

my_network_name -k my_password -l 134.197.117.197:1200

}

 

StopService ()

{

    ConsoleMessage "Stopping n2n"

    killall edge

}

 

RestartService ()

{

    ConsoleMessage "Restarting n2n"

}

 

RunService "$1"

Server

Install n2n:

$ apt-get install n2n

Run the super-node (as a regular user, not root):

$ supernode -l 1200

I usually run the above command in screen and detach it. To run it

automatically after boot, do, create /etc/init/n2n-server.conf:

# n2n - Starts the n2n edge program that connects to the network

#

# This happens automatically when the network device is up.

 

description "connect using n2n"

 

start on net-device-up

 

exec supernode -l 1200

 

respawn

and start it using:

$ sudo initctl start n2n-server

IP Addresses

Please add your computer below if you use this net (and use some unused

IP address). Add this to your /etc/hosts:

10.1.2.1 raven

10.1.2.2 tedg

10.1.2.3 spilka

10.1.2.4 tahoe

10.1.2.5 crow
  评论这张
 
阅读(110)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017