I'm looking for some help getting a port forward setup to a VM running Ubuntu 12.04 on my LAN. I can forward the port to the VM successfully and connect to the service over the Internet. But when I connect the OpenVPN connection, the external access to the service no longer works. At that point my default gateway becomes my VPN's "tap0" adapter. I can see incoming traffic with tcpdump, but it appears the return traffic is never making it back. Local access to this port within my LAN works too even with the VPN connected, so its just when someone tries to access it over the Internet using the port forward.
I know I need either a static route or an iptables entry (or both) to ensure the return traffic goes out over my eth0/LAN/WAN connection and not the VPN route, but I'm not sure what to add. So I have:
WAN IP: x.x.x.x VPN IP: y.y.y.y LAN IP: z.z.z.z
I want to forward port p from WAN IP to LAN IP, and have the return traffic sent back to my routers gateway instead of the VPN gateway.