Openvpn – How to setup an Openvpn server with two gateways to internet

ethernetinterfacenetworkingopenvpnrouting

I have an openvpn server behind two wan interfaces: eth1 and eth2 where eth1 is the default gw and eth2 is where openvpn binds to.

The problems my ovpn server is replying back to ovpn client via the default gw (through eth1) and the tcp negociation is lost before establishing any tunnel.

Here's what's happening:

 wan client -----> eth2 ----> openvpn -----> eth1 ----> lost and not delivered back to client

Is there a way to tell ovpn to stick on eth2 and consider it for all traffic ?

Best Answer

in freebsd you would use the setfib command to bind an app to a routing table while running it. in linux that is not exactly how it works.

Your problem is clearly explained and the way to fix it is detailed here. Basically, you need to setup multiple routing tables so that traffic coming in 1 via your second uplink always leaves via your second uplink.

Related Topic