FAQ  •  Register  •  Login

Redirecting only serviio traffic via tunnel on Linux

<<

wae3iejohhohZae5

Streaming enthusiast

Posts: 27

Joined: Sun Apr 29, 2012 9:10 pm

Post Mon Oct 07, 2013 10:25 am

Redirecting only serviio traffic via tunnel on Linux

Let
  • serviio be the username running the Serviio process
  • eth0 be the primary interface where default traffic is sent out on
  • tun0 be the interface of the tunnel
  • 192.168.0.0/24 be the local area network ip subnet on eth0
  • 192.168.0.1 be the default gateway on the local area network eth0
  • 172.20.0.1 be the gateway on tun0
Then the following sends all Serviio traffic along tun0.
  Code:
echo 2 > /proc/sys/net/ipv4/conf/tun0/rp_filter
iptables -t mangle -A OUTPUT -o eth0 -m owner --uid-owner serviio -j MARK --set-mark 11
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
ip rule add fwmark 11 table 11
ip route add 192.168.0.0/24 dev eth0 table 11 # no VPN for LAN
#ip route add 1.2.3.4 via 192.168.0.1 dev eth0 table 11 # no VPN for 1.2.3.4
ip route add default via 172.20.0.1 dev tun0 table 11
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Oct 07, 2013 11:43 am

Re: Redirecting only serviio traffic via tunnel on Linux

is this an actual guide? Maybe it should go to the wiki.
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Mon Oct 07, 2013 12:15 pm

Re: Redirecting only serviio traffic via tunnel on Linux

but with little better explanation
<<

wae3iejohhohZae5

Streaming enthusiast

Posts: 27

Joined: Sun Apr 29, 2012 9:10 pm

Post Mon Oct 07, 2013 8:16 pm

Re: Redirecting only serviio traffic via tunnel on Linux

I am just sharing this with you because it took me too many hours to figure it out. Feel free to improve it or put it on the wiki.
<<

paniko

User avatar

Streaming enthusiast

Posts: 38

Joined: Fri Sep 07, 2012 7:29 am

Post Thu Oct 10, 2013 6:27 am

Re: Redirecting only serviio traffic via tunnel on Linux

wae3iejohhohZae5 wrote:I am just sharing this with you because it took me too many hours to figure it out. Feel free to improve it or put it on the wiki.



with this configuration you are able to route the uPnP traffic too?
Paniko
Sumsung EU46D6500 | XBox 360 | Samsung Galaxy S 6 Edge | Windows 10 - i7 64bit | Serviio 1.5.2 Pro
Beta Tester
<<

wae3iejohhohZae5

Streaming enthusiast

Posts: 27

Joined: Sun Apr 29, 2012 9:10 pm

Post Thu Oct 10, 2013 1:20 pm

Re: Redirecting only serviio traffic via tunnel on Linux

paniko wrote:
wae3iejohhohZae5 wrote:I am just sharing this with you because it took me too many hours to figure it out. Feel free to improve it or put it on the wiki.



with this configuration you are able to route the uPnP traffic too?

I don't think so.

Return to General discussion

Who is online

Users browsing this forum: No registered users and 15 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.