Answer the question
In order to leave comments, you need to log in
Is it possible to specify incoming and outgoing interface in OpenVPN as in 3proxy?
Greetings!
There are 2 network connections: wired internet with white IP accessible from outside and Huawei E3372 LTE modem.
Task: connect to the OpenVPN server from the Internet via a wired connection with a white IP, and get the IP of the LTE modem at the output.
In the OpenVPN instructions, I found a server config parameter that specifies which interface to listen on, but did not find a parameter for specifying the outgoing interface.
Answer the question
In order to leave comments, you need to log in
To set the outgoing interface, you need to use source-based routing. This is an OS feature, not OpenVPN itself.
echo 100 vpn >>/etc/iproute2/rt_tables (100 - table id, vpn -name)
ip route add default dev (your modem) gw (modem gateway if not ppp) table vpn
ip rule add from (client address inside vpn ) lookup vpn
You need to set up NAT. And don't forget to enable forwarding.
UPD
In other matters, routing will also need to be configured - it should be possible to send traffic through both interfaces.
Can you explain the meaning of such an action ?, just if the ip is gray at the modem interface, then connecting to it through the provider's nat is unlikely to work, or do you want to reverse port forward through upnp? Another option are you trying to forward traffic further down the channel through a modem? Then set the priority metrics for outgoing traffic through routes in Windows, in Linux, unfortunately, I won’t tell you such functionality, the only thing that comes to mind is the priority by netmask, the smaller the mask, the greater the priority
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question