# Setup VPN for WAN out only

**URL:** <https://dietpi.com/forum/t/setup-vpn-for-wan-out-only/25062>\
**Category:** Troubleshooting\
**Created:** [23 March 2026 13:30 UTC](https://dietpi.com/forum/t/setup-vpn-for-wan-out-only/25062 "2026-03-23T13:30:50Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [26 March 2026 17:09 UTC](https://dietpi.com/forum/t/setup-vpn-for-wan-out-only/25062/15 "2026-03-26T17:09:55Z")

</div>

Ok if it’s only for tranmission we can use a simpler approach.  
First remove the stuff we added earlier

```sh
# Remove MARK rules
sudo iptables -t mangle -F OUTPUT

# Remove policy routing rules (only the novpn table)
sudo ip rule del fwmark 1 table novpn 2>/dev/null
sudo ip route flush table novpn 2>/dev/null

# Remove the novpn entry from rt_tables
sudo ip route del default via 192.168.2.1 dev eth0 table novpn
sudo sed -i '/200 novpn/d' /etc/iproute2/rt_tables

```

Also remove the script from the ovpn config, we don’t need it anymore. We will create a permanent iptables rule to route everything send from transmission user through tun0.

```auto
sudo iptables -A OUTPUT -m owner --gid-owner debian-transmission ! -o tun0 -j REJECT
sudo netfilter-persistent save

```

You would also need to deactivate the kill switch in `dietpi-vpn` to let the other traffic route through `eth0`.

---

_[View the full topic](https://dietpi.com/forum/t/setup-vpn-for-wan-out-only/25062)._
