Page 1 of 1

OpenVPN bind to specific nic

Posted: Sat Apr 22, 2023 2:34 am
by daytooner
My server has three nics. Local subnet on #1; wan on #2; and VPN on #3. My firewall will route all WAN traffic, excluding port 1194, to #2, and WAN traffic on port 1194 to #3.

In the openvpn server.conf, I added the line: local [ip #3]. And when I start it up, the server does listen on nic #3, and gets incoming traffic from its tun0 dev via nic #3. But all outgoing packets going through tun0 are going through nic #2 (I can see all of this with wireshark).

In the routing table, there are two default gateways: #2 and #3, with #3 having a higher metric. So it looks like all outbound traffic goes through #2, including from tun0. So, how do I make outbound traffic, from tun0, go via nic #3?

Any help greatly appreciated.

TIA

ken