# port forwarding and openvpn

## deathraccoon

I use a vpn service. I need to set up port forwarding for a program. at the router, do I set this up to use the address of eth0 or tun0? am I correct in assuming I can't forward to an interface (tun0) which is on a different subnet than the gateway? the gateway is 10.0.0.1. tun0 is is 172.xx.x.xxx

thanks.

----------

## Hu

Whether you can forward off-subnet depends on the device doing the forwarding.  In most cases, you can do off-subnet forwarding if the return path will bring the traffic back through the forwarding device.  Since you are dealing with multiple routes, you also need to arrange the forwarding so that the reverse path filter does the right thing.  The simplest course would be to have the external user connect to the public VPN IP address and have the traffic forwarded back over the VPN link to you.

----------

