M
M
MaxxDamage2019-07-18 10:33:48
openvpn
MaxxDamage, 2019-07-18 10:33:48

How to force the tunnel to use a specific interface?

Good day. The question may be very trivial, but a cursory search on the Internet did not find the answer.
The point is the following. There is a gateway with three network interfaces. Two - the Internet, with different addresses, the third - a local network. The gateway has a VPN tunnel. Can you please tell me how to make the client part of OpenVPN use the interface I need? On the server side, such a setting is present, in the form:

# Which local IP address should OpenVPN
# listen on? (optional)
local xx.xx.xx.xx
;local zz.zz.zz.zz

with the ability to switch between the main and backup channel
An attempt to apply the same option in the client part did not work, the tunnel stopped working altogether
UPD: Is the question too complicated? Or vice versa, too stupid that there are no answers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2019-07-18
@ky0

It's not a hard question, it's just that you didn't make it clear. If there are several interfaces on the gateway, what does the settings on the client have to do with it? Or is the gateway also a client in relation to some external vpn server?
If I'm right, then it's enough to add a static route to the vpn server through the desired interface. Since the vpn server knows nothing about interfaces and redundancy (and should not know), you need to configure this:
1. On the client
2. Of course, BEFORE connecting the vpn, that is, not in the config coming from the server
Alternatively, write a script , which monitors the tunnel and, in case of failure, tries to connect with the route through the primary interface, and in case of failure, through the secondary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question