ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.05k stars 925 forks source link

Assing multiple IP addresses to an n2n edge node #1166

Open MurzNN opened 4 months ago

MurzNN commented 4 months ago

Will be good to have the ability to assign multiple IP addresses to an edge node. Sometimes we need to make available the same port from the edge node but on different IP addresses.

For example:

192.168.100.1:443 - ip forwarding to localhost:443
192.168.100.2:443 - ip forwarding to 172.17.0.1:443

Yes, I can make this work by using a different port for the second service, but the services want to have them on the 443 port only, so this workaround doesn't work.

So, will be good to have something like this:

$ sudo edge -c mynetwork -k mysecretpass -a 192.168.100.1 -a 192.168.100.2 -f -l supernode.ntop.org:7777

If it's already possible, please describe me how to do this. Thanks!

MurzNN commented 4 months ago

I found a similar issue https://github.com/ntop/n2n/issues/743 but the suggested workaround from there doesn't work. After executing this command:

ip addr add 192.168.100.2/24 dev edge0
ip route add 192.168.100.2 dev edge0

I can ping the 192.168.100.2 from the same node, but not from other nodes in the virtual network.

hamishcoleman commented 3 months ago

Are you able to retest this against the recently released fork n3n and raise a ticket there if you still cannot get it working? We would be happy to investigate it further as part of that new project.