1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-25 02:04:06 +02:00

update n2n

This commit is contained in:
kev 2019-07-10 01:20:00 +08:00
parent 1ccc43514c
commit ff937c77a4
5 changed files with 29 additions and 8 deletions

View File

@ -7,7 +7,7 @@ MAINTAINER EasyPi Software Foundation
RUN set -xe \
&& apt update \
&& apt install -y gnupg lsb-release net-tools wget \
&& apt install -y gnupg iptables lsb-release net-tools wget \
&& wget http://apt.ntop.org/stretch/all/apt-ntop.deb \
&& dpkg -i apt-ntop.deb \
&& apt update \

View File

@ -5,13 +5,34 @@ n2n
users to exploit features typical of P2P applications at network instead of
application level.
## up and running
```
.............VPN................
+------LAN-+-----+ +- Edge.
| . | / .
| Client ->.Edge +-> Supernode <-+- Edge .
| . | \ .
+----------+-----+ +- Edge.
................................
```
## Supernode (1.2.3.4)
```bash
$ docker-compose up -d
$ docker-compose up -d supernode
```
$ docker-compose exec edge bash
>>> ping 192.168.100.1
## Edge (192.168.1.23)
```bash
$ docker-compose up -d edge
$ sysctl -w net.ipv4.ip_forward=1
$ iptables -t nat -A POSTROUTING -o n2n0 -j MASQUERADE
```
## Client (192.168.1.45)
```bash
$ ip route add 192.168.100.0/24 via 192.168.1.23
```
[1]: https://www.ntop.org/products/n2n/

View File

@ -7,7 +7,7 @@ MAINTAINER EasyPi Software Foundation
RUN set -xe \
&& apt update \
&& apt install -y gnupg lsb-release net-tools wget \
&& apt install -y gnupg iptables lsb-release net-tools wget \
&& wget -qO- http://packages.ntop.org/apt/ntop.key | apt-key add - \
&& { \
echo "deb http://apt.ntop.org/stretch_pi armhf/"; \

View File

@ -1,7 +1,7 @@
edge:
image: easypi/n2n-arm
entrypoint: ["edge"]
command: ["-dn2n0", "-cmynetwork", "-kmypassword", "-mAA:BB:CC:DD:EE:FF", "-a192.168.100.1", "-p50001", "-lsupernode:7654", "-f"]
command: ["-dn2n0", "-cmynetwork", "-kmypassword", "-mAA:BB:CC:DD:EE:FF", "-a192.168.100.1", "-p50001", "-lsupernode:7654", "-r", "-f"]
extra_hosts:
- supernode:1.2.3.4
devices:

View File

@ -12,7 +12,7 @@ services:
edge:
image: vimagick/n2n
entrypoint: ["edge"]
command: ["-dn2n0", "-cmynetwork", "-kmypassword", "-mAA:BB:CC:DD:EE:FF", "-a192.168.100.1", "-p50001", "-lsupernode:7654", "-f"]
command: ["-dn2n0", "-cmynetwork", "-kmypassword", "-mAA:BB:CC:DD:EE:FF", "-a192.168.100.1", "-p50001", "-lsupernode:7654", "-r", "-f"]
devices:
- /dev/net/tun
cap_add: