Opened 4 years ago

Last modified 2 years ago

#756 new User question

Allow binding to --local interface

Reported by: d3xt3r01 Owned by:
Priority: minor Milestone:
Component: Generic / unclassified Version: OpenVPN 2.3.4 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:


My current setup is eth0 and an usb 3g dongle.
I want the 3g dongle to be connected to an openvpn server somewhere.
The problem is that I can't use --local ppp0 because it's not supported. I don't want to hardcode an ip, if the dongle's connection drops, new ip !
Also, the ppp connection doesn't need/have a gateway. I've even tried using --local <ip of ppp0> with no luck it seems for some reason ! ( this might actually be a bug ).
Can happily test any patches.

Change History (4)

comment:1 Changed 4 years ago by Gert Döring

--local <ip of ppp0> }

should work (with the real adress put there, of course). If not, please show a log file.

--local ppp0

is something the socket API does not permit us to do.

What you should be able to do, though, is point the route towards your OpenVPN server out the ppp0 interface, and the system should totally automatically pick the correct source IP for that interface ("packets use the IP address of the outgoing interface, unless told otherwise") - so, no option manipulation should be needed at all.

(To the contrary: if you do not have this route, "just using the 3g address" won't magically send your packets out there)

comment:2 Changed 4 years ago by Gert Döring

Type: Feature WishUser question

comment:3 Changed 4 years ago by krzee king

while your exact goal cannot be achieved, maybe for now you could use the server as a client for your workaround. you can have it connect to another server and then you have your client connect to that server to reach the target machine (which is now another client).

Last edited 4 years ago by krzee king (previous) (diff)

comment:4 Changed 2 years ago by Antonio

@cron2 have you considered implementing something like this? (look up IP dynamically and bind there?)
Other tools allow to specify an interface instead of an IP, but the IP lookup is performed only once at startup (so would not solve this use case anyhow).

This has the advantage of allowing the user to launch openvpn using always the same command (with fixed interface) instead of looking up the (possibly dynamic) IP every time.

Last edited 2 years ago by Antonio (previous) (diff)
Note: See TracTickets for help on using tickets.