Opened 8 years ago

Last modified 16 months 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 (7)

comment:1 Changed 8 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 8 years ago by Gert Döring

Type: Feature WishUser question

comment:3 Changed 7 years ago by krzee king

while your exact goal cannot be achieved yet, 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).

Version 0, edited 7 years ago by krzee king (next)

comment:4 Changed 6 years ago by Antonio Quartulli

@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 6 years ago by Antonio Quartulli (previous) (diff)

comment:5 Changed 16 months ago by luckman212

Does the new --bind-dev directive do what OP was asking for?

Last edited 16 months ago by luckman212 (previous) (diff)

comment:6 in reply to:  5 Changed 16 months ago by Antonio Quartulli

Replying to luckman212:

Does the new --local-dev directive available in v2.6 do what OP was asking for?

there is no such option. not sure where you have seen it?

comment:7 Changed 16 months ago by luckman212

Sorry, I meant --bind-dev <device>

Note: See TracTickets for help on using tickets.