N2N peer-to-peer VPN Network

Source: Internet
Author: User

The N2N peer-to-peer VPN Network n2n is a two-layer virtual private network that allows users to develop typical P2P applications in the network rather than at the application layer. This means that the user can obtain the local address transparently, as long as the new IP address is in a sub-network, no matter where the two machines are, ping the other side. Main features of the N2N network: The n2n network is based on the P2P protocol, Layer 2 encryption network encryption is completed on the node, and the user-defined key is used; you control your own security, instead of making skype represent you (managing your server node), each n2n user can simultaneously belong to multiple networks that can reverse the NAT and firewall, therefore, n2n nodes can be accessed even on the Intranet. Therefore, firewall is no longer an obstacle for direct IP communication. N2n networks are not designed as independent (self-contained) networks, but may be able to route data between n2n and n2n networks. The n2n architecture is based on two parts: terminal nodes: applications installed on the user's computer to create the n2n network. Each node device creates a TUN/TAP virtual network card device as the entry point to access the n2n network. Super node: enables the terminal node to access other terminal nodes behind the symmetric firewall. This program is the directory recorder and package router that cannot directly communicate with the node. It can be seen that SuperNode is used for forwarding and other communications, because it is in the public network, two Edge nodes in the Intranet can be connected. #! /Bin/sh/etc/rc. common # Copyright (C) 2008-2012 OpenWrt.org START = 90 start_instance () {local cfg = "$1" config_get type "$ cfg" TYPE case "$ type" in edge) config_get ipaddr "$ cfg" 'ipaddr '[-n "$ ipaddr"] | return 1 config_get supernode "$ cfg" 'supernode' config_get port "$ cfg" 'Port' config_get community "$ cfg" 'communit' config_get key "$ cfg" 'key' config_get_bool route "$ cfg" 'route ''0' ["$ ro Ute "=" 1 "] & amp; args = '-R' service_start/usr/sbin/edge-f $ args-a $ ipaddr-c $ community-k $ key-l $ {supernode }: $ {port}; supernode) config_get port "$ cfg" port [-n "$ port"] | return 1 service_start/usr/sbin/supernode-l $ port ;; esac} stop_instance () {local cfg = "$1" config_get type "$ cfg" TYPE case "$ type" in edge) service_stop/usr/sbin/edge; supernode) service_stop/usr/sbin/supernode; Esac} start () {config_load 'n2n 'config_foreach start_instance 'edge' config_foreach start_instance 'supernode'} stop () {config_load 'n2n 'config_foreach stop_instance 'edge' config_foreach stop_instance 'supernode'} shows that it is very easy to use from the corresponding Startup File. Config edge option ipaddr ''option supernode'' option port'' option community ''option key'' option route ''ipaddr address of the local virtual network card upsernode supernode, it can be the network name corresponding to the port of the domain name port that you want to use to connect to the port community, access key with the same name. User-defined access key used by SSH here. The following content is the output Debug information for communications between two hosts and servers. 10/Sep/2013 23:51:47 [n2n. c: 49] login alling hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:51:47 [n2n. c: 638] 84 bytes compressed into 8710/Sep/2013 23:51:47 [n2n. c: 681] ### Tx N2N Msg-> network10/Sep/2013 23:52:17 [n2n. c: 843] Purging old registrations10/Sep/2013 23:52:17 [n2n. c: 848] Remove 0 registrations10/Sep/2013 23:52:22 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 5000010/Sep/2013 23:52:22 [n2n. c: 540] ++ Received unreliable data packet [rcvd_from = 60.215.250.204: 50000] [msg_type = MSG_TYPE_REGISTER] [seq_id = 0] 10/Sep/2013 23:52:22 [n2n. c: 545] [src_mac = DE: AD: BE: EF: 01: 23] [dst_mac = 00: 00: 00: 00: 00] [original_sender = 0.0.0.0: 0] 10/Sep/2013 23:52:22 [supernode. c: 312] Received message from node [60.215.250.204:-15536] 10/Sep/2013 23:52:22 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 60.215.250.204: 50000, private_ip = (2) 0.0.0.0: 5000010/Sep/2013 23:52:22 [n2n. c: 49] login alling hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:22 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:22 [n2n. c: 736] Sent unreliable packet [msg_type = MSG_TYPE_REGISTER_ACK] [seq_id = 0] [src_mac = 00: 00: 00: 00: 00] [dst_mac = DE: AD: BE: EF: 01: 23] 10/Sep/2013 23:52:22 [n2n. c: 49] login alling hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:22 [n2n. c: 638] 84 bytes compressed into 8710/Sep/2013 23:52:22 [n2n. c: 681] ### Tx N2N Msg-> network10/Sep/2013 23:52:47 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 5000110/Sep/2013 23:52:47 [n2n. c: 540] ++ Received unreliable data packet [rcvd_from = 60.215.250.204: 50001] [msg_type = MSG_TYPE_REGISTER] [seq_id = 0] 10/Sep/2013 23:52:47 [n2n. c: 545] [src_mac = DE: AD: BE: EF: 01: 24] [dst_mac = 00: 00: 00: 00: 00] [original_sender = 0.0.0.0: 0] 10/Sep/2013 23:52:47 [supernode. c: 312] Received message from node [60.215.250.204:-15535] 10/Sep/2013 23:52:47 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 60.215.250.204: 50001, private_ip = (2) 0.0.0.0: 5000110/Sep/2013 23:52:47 [n2n. c: 49] login alling hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:47 [n2n. c: 49] Unmarshalled hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:47 [n2n. c: 736] Sent unreliable packet [msg_type = MSG_TYPE_REGISTER_ACK] [seq_id = 0] [src_mac = 00: 00: 00: 00: 00] [dst_mac = DE: AD: BE: EF: 01: 24] 10/Sep/2013 23:52:47 [n2n. c: 49] login alling hdr: public_ip = (2) 0.0.0.0: 0, private_ip = (2) 0.0.0.0: 765410/Sep/2013 23:52:47 [n2n. c: 638] 84 bytes compressed into 8710/Sep/2013 23:52:47 [n2n. c: 681] ### Tx N2N Msg-> network
 

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.