Ok, explanation of what I want to achieve.

I have an ubuntu server 18.04 with this setup:

Router Internet     <-> ethernet via eth0= / gw
Router Internet VPN <-> wifi via wlan0=  / gw

If I do for example a traceroute using wlan0, I'm able to go via the VPN, and if I use the eth0, I go directly via internet without vpn.

In this server I have: Pi-hole and deluge. and what I want to achieve is make deluge use internet via wlan0 (then, go via the vpn that is in my router), and I be able to access from 192.168.0.X to the server and see Pi-hole and deluge web interface.

What I alredy try,and I think this is the best and easy solution, reading in several forums with iptables is the next:

sudo iptables -A OUTPUT -m owner --gid-owner deluge -o lo -j ACCEPT
sudo iptables -A OUTPUT -m owner --gid-owner deluge \! -o wlan0 -j REJECT
sudo iptables -A OUTPUT -m owner --gid-owner deluge -o eth0 -d -j ACCEPT

With this the only thing that I achieve is:

1) torrent "looks like" is using vpn because whatever thing that was uploading or downloading is stopped.

2) I can access to the deluge web interface only via the same network (192.168.200.X, but I want to access from 192.168.0.X)

This is my actual routing table:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    202    0        0 eth0         UG    303    0        0 wlan0   U     202    0        0 eth0   U     303    0        0 wlan0

Any idea how to solve this in an easy way? I'm fighting for this for months already....

New contributor
Muadiv is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Muadiv is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.