OpenVPN bind to specific nic

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
daytooner
OpenVpn Newbie
Posts: 6
Joined: Wed Jun 16, 2021 2:28 pm

OpenVPN bind to specific nic

Post by daytooner » Sat Apr 22, 2023 2:34 am

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

Post Reply