zehome / MLVPN

Multi-link VPN (ADSL/SDSL/xDSL/Network aggregation / bonding)
http://www.mlvpn.fr/
BSD 2-Clause "Simplified" License
520 stars 126 forks source link

Provide bindinterface in config #146

Closed stevenleadbeater closed 3 years ago

stevenleadbeater commented 3 years ago

When using with 4G / LTE radios the IP addresses change quite a lot, it would be a lot more convenient for consumers to specify the binding in this format:

[wwan0] bindinterface = "wwan0" remotehost = "my.vpn.net" remoteport = 6000

I've had a cursory glance around and there are some options. Mostly described here: https://stackoverflow.com/questions/2283494/get-ip-address-of-an-interface-on-linux the accepted answer looks as though it will be portable across linux / bsd and mac.

zehome commented 3 years ago

yes, that was discussed in the past. There is a problem with this approch, mlvpn would need to react to interface changes, not just handling the startup case. This is much much harder and is different across platforms. What you can do to workaround this is to use a router on the 4G side to avoid having to deal with it

stevenleadbeater commented 3 years ago

How complex would that need to be? I'm not sure I'd expect a VPN to respond to an interface being yanked and recover from it. I'm probably missing something here but right now, if I renamed an interface out from under MLVPN it would trash the scoket anyway right?

zehome commented 3 years ago

yes, probably, but I think it would be mandatory if you have a changing ip address. I don't see the point to support a changing IP address, but not handling the change at runtime

stevenleadbeater commented 3 years ago

you are right there, however that is a problem now and a somewhat worse one. If an IP address changes while the tunnel is running, the config is no longer valid and has to be regenerated. If we have bindinterface, the subflow would just need to be restarted. This could probably be handled using dhclient-script and the existing hot config reloading facility in this project. I'd be quite interested to give this a go and see how it functioned. How do you feel about the additional configuration load here? It does mean more disparate features being strung together.

markfoodyburton commented 3 years ago

FWIW before I forked away, I had a script that generated my config, not just for the IP address but also for the bandwidth, as that fluctuates a lot in my case, so I was re-loading the config relatively frequently.... It's not so hard to script all this. I'm guilty of providing a load of patches (https://github.com/zehome/MLVPN/pull/69) that include this issue, but... I kind of agree with @zehome updating the config isn't that hard in the end.

stevenleadbeater commented 3 years ago

bandwidth? I thought that was only necessary to configure in glorytun not ml vpn?

stevenleadbeater commented 3 years ago

I have this all scripted for me anyway, just seemed like a useful feature, I'm happy if it's not wanted as part of the project but I suspect it is not as troublesome as suspected and does simplify scripting around it

stevenleadbeater commented 3 years ago

duplicate of #69