From a8a6220692a04e142a898de76ca13e7c8b4f867a Mon Sep 17 00:00:00 2001 From: kev Date: Sat, 13 Jul 2019 18:04:30 +0800 Subject: [PATCH] update n2n --- n2n/README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/n2n/README.md b/n2n/README.md index a62f37c..a4f3bba 100644 --- a/n2n/README.md +++ b/n2n/README.md @@ -10,15 +10,22 @@ application level. +------LAN-+-----+ +- Edge. | . | / . | Client ->.Edge +-> Supernode <-+- Edge . -| . | \ . +| . | (Edge) \ . +----------+-----+ +- Edge. ................................ ``` -## Supernode (eth0:1.2.3.4) +## Supernode/Edge (eth0:1.2.3.4, n2n0:192.168.100.1/24) ```bash -$ docker-compose up -d supernode +# start supernode & edge +$ docker-compose up -d + +# config edge routing +$ docker-compose exec edge bash +>>> ifconfig +>>> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +>>> exit ``` ## Edge (eth0:192.168.1.23/24, n2n0:192.168.100.x/24) @@ -33,6 +40,7 @@ $ iptables -t nat -A POSTROUTING -o n2n0 -j MASQUERADE ```bash $ ip route add 192.168.100.0/24 via 192.168.1.23 +$ ping 192.168.100.1 $ nmap -sP 192.168.100.0/24 ```