Temat: n2n i problem z routingiem
Witam
Postawiłem sobie 2 klienty które się na wzajem widzą ale mam problem z routingiem i widocznością pozostałych urządzeń w sieci lan po stronie 1 klienta.
Skonfigurowałem to według opisu
Install n2n (you will have to do this on supernode and two nodes)
all$ sudo apt-get install n2n
Start super node on public address with DNS name super.example.com
internet$ supernode -l 1234
Start first client
local# edge -c community -d community -k secret \
-l super.example.com:1234 -a 10.1.2.1
Start remote end-point somewhere within LAN
remote# edge -c community -d community -k secret \
-l super.example.com:1234 -a 10.1.2.2 -r
Note changed IP address and -r flag which will allow us to route over this node.
remote# sysctl -w net.ipv4.ip_forward=1
remote# iptables -t nat -A POSTROUTING -s 10.1.2.1 -o tun0 -j MASQUERADE
This will turn forwarding and NAT for our packets coming from community tap interface and going out through tun0 to LAN. We also need to setup route on local side for remote LAN network:
local# ip route add 172.18.0.0/16 via 10.1.2.2Po stronie routera klient ma adres 10.1.2.10 i jest routerem z openwrt gdzie za nim są urządzenia z adresacją 172.18.0.x
w pliku /etc/rc.local mam taki wpis
root@Gargoyle:~# cat mojvpn.sh
edge -a 10.1.2.10 -r -c community -k password -l 88.86.108.50:86
sleep 5
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 10.1.2.1 -o edge0 -j MASQUERADE
root@Gargoyle:~#
a po stronie 2 klienta (windows 7) w konsoli utworzyłem taki routing
route add 172.18.0.0 mask 255.255.255.0 10.1.2.10
i niestety nie widzę tych urządzeń pod adresem 172.18.0.x
Klient 1 i 2 nawzajem się widzą, pingi chodzą