Two-tier point-to-point VPN configuration using N2N in Linux systems

Source: Internet
Author: User
Tags svn

N2N is a two-tier point-to-point virtual private network (VPN) that allows users to develop typical peer-to-peer applications at the network level rather than the application level. This means that users can gain local IP visibility (for example, two PCs belonging to the same n2n network can ping each other), and no matter which network they are in, they can access it as long as they have the same network IP address. In short, just as OpenVPN has moved SSL from an application (for example, to deploying an HTTPS protocol) to a network protocol, N2N has moved peer-to-peer from application to network.

N2N main functions

N2N is an encrypted two-layer private network based on Peer-to-peer protocol.

Encryption uses the open protocol to deploy at the edge node, which uses the user-defined encryption key: You control security without authorization to the company, while Skype or hamachi is.

Individual n2n users can belong to multiple networks (or communities) at the same time.

It has the ability to traverse NAT and firewalls in reverse communication direction (e.g., from outside to inside), so it can reach the N2N node even if it is running on a private network. Firewalls are no longer an obstacle to IP-level control over communication.

The N2N network does not mean that it is independent, and it can route traffic between N2N and N2N networks.

N2N architecture is based on two components

Super node: It is used at start time for edge nodes or for nodes behind the symmetric firewall. For these nodes, the application is primarily a directory register and a packet router, rather than direct communication.

Edge node: An application installed in a user's PC that allows the construction of a n2n network. In fact, each edge node creates a TUN/TAP device that is the entry point of the N2N network.

Install n2n to Ubuntu

Open the terminal and run the following command

The code is as follows:

$ sudo apt-get install subversion build-essential Libssl-dev

$ SVN Co

$ CD N2N/N2N_V2

$ make

$ sudo make install

Using N2N to configure Peer-to-peer VPN

First, we need to configure a Super node and any number of edge nodes.

Decide where to place the super nodes. Let's say you put it on the XYW port of the host a.b.c.d.

Decide which password encryption is used to secure the data. Suppose you use the password encryptme.

Decide which network name you want to use. Suppose you name it mynetwork. Note that you can use a Super node/edge node to handle multiple networks, not just one.

Decide what IP address to use on the Edge node. Let's say you use

Start Application:

Configuring the Super Node

The code is as follows:

Supernode-l Xyw

Configuring Edge Nodes

At each edge node, use the following command to connect to a Peer-to-peer VPN.

The code is as follows:

sudo edge-a mynetwork-k encryptme-l a.b.c.d:xyw

sudo edge-a mynetwork-k encryptme-l a.b.c.d:xyw

Now let's test your n2n network.

The code is as follows:

Edge node1> Ping

Edge node2> Ping

Windows n2n VPN Client (n2n Edge graphical interface)

You can download the n2n Edge graphical interface from here.

The n2n edge graphical interface is a basic installer and GUI configuration interface for point-to-point ' n2n VPN solutions '.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.