Sunday, May 28, 2017

n2n, peer-to-peer vpn solution

****information ***

client1(edge)------>
                                  router  ---------> supernode (192.168.58.22)
client2 (edge)------>



1- on supernode
$ sudo apt-get install n2n
$ supernode -l 3254


2- on client1
 ***
-community string: pernetwork
-encrypt key: password1
- user/group id: 1000
-vpn ip address: 192.168.100.1/24
***

$ sudo apt-get install n2n
$ sudo edge -d n2n0 -c pernetwork -k password1 -u 1000 -g 1000 -m da:00:00:00:00:01 -a 192.168.100.1 -p 20002 -l 192.168.58.22:3254



2- on client2

$ sudo apt-get install n2n
$ sudo edge -d n2n0 -c pernetwork -k password1 -u 1000 -g 1000 -m da:00:00:00:00:02 -a 192.168.100.2 -p 20002 -l 192.168.58.22:3254

it will create a new tap interface call n2n0 with address 192.168.100.2

$  ifconfig n2n0
n2n0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1400
        inet 192.168.100.2  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::d800:ff:fe00:1  prefixlen 64  scopeid 0x20<link>
        ether da:00:00:00:00:02  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9  bytes 718 (718.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

-

No comments:

Post a Comment