New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoscaling #10

Open
pritchardjonathan opened this Issue Jan 27, 2016 · 9 comments

Comments

Projects
None yet
6 participants
@pritchardjonathan
Copy link

pritchardjonathan commented Jan 27, 2016

How would you tackle an autoscaling scenario where you want to be able to dynamically add and remove nodes to and from a L3 mesh. As far as I can see config requires a static IP to be defined per node.

@miolini

This comment has been minimized.

Copy link

miolini commented Jan 27, 2016

@mstenz

This comment has been minimized.

Copy link

mstenz commented Jan 29, 2016

only one node need a static ip, and as long as the network exists by minimum 2 nodes this node can also disappear because all the peers are exchanged within the protocol. If you really want to have a dynamically peer network best is setup one static server that is always running with fixed ip (can be ordered from 3$ per month) and all others can be dynamic (for example behind ADSL lines at home).

@pritchardjonathan

This comment has been minimized.

Copy link
Author

pritchardjonathan commented Jan 29, 2016

So would I just leave out the ifconfig4 line for the non-static nodes?

@mstenz

This comment has been minimized.

Copy link

mstenz commented Jan 29, 2016

No, as ifconfig4 line specify the VPN ipaddress for this node to use within the tunnel, without an ipaddress the different nodes cannot communicate. Maybe i missunderstood your question, I was refering to the public ip's of the nodes in my answer before.

@wankdanker

This comment has been minimized.

Copy link

wankdanker commented Jan 29, 2016

Would it be possible to use dhclient on the VPN interface if there was a DHCP server somewhere on the VPN? That would be interesting.

@mstenz

This comment has been minimized.

Copy link

mstenz commented Jan 29, 2016

I have not tried it, but I don't think this is possible.

@wankdanker

This comment has been minimized.

Copy link

wankdanker commented Jan 29, 2016

peervpn-dnsmasq.conf

interface dnsmasq0
ifconfig4 10.10.10.1/24
upcmd dnsmasq -i dnsmasq0 --dhcp-range=10.10.10.10,10.10.10.20,255.255.255.0,12h
port 5678

peervpn-dhclient.conf

initpeers 127.0.0.1 5678
interface dhclient0
upcmd dhclient -nw dhclient0

Apparently, DHCP will work over the VPN. So, you could have a static head node (in this example defined in peervpn-dhclient.conf with initpeers 127.0.0.1 5678) that serves up DHCP addresses.

So, you would only need to specify a static address for one node (so dnsmasq can bind to an address) and each other nodes would need to know at least the head node's (or another node's) address.

This was tested on a local machine but, I could see the DHCP working with tcpdump on the vpn interfaces.

@McL0v1n

This comment has been minimized.

Copy link

McL0v1n commented Oct 18, 2016

Thank you for this, I will test out the dhclient on my setup. If this is confirmed for me, it should be added into the tutorial as an option.

@maurociancio

This comment has been minimized.

Copy link

maurociancio commented Jun 18, 2017

This worked very good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment