Routing application traffic through interface, not receiving replying trafic

by Cyber Ghost   Last Updated June 01, 2015 03:00 AM

I'm trying to set up a Plex Media Server on a Arch server. However most of the time the server is connect to a VPN and I want the Plex traffic to be routed outside of the VPN interface, tun0 and instead route over the regular ethernet interface, enp9s0. I have attempted to do this by marking traffic generated from application with the plex user uid (421), then routing marked traffic through a different ip route table. I've done this with the following ip routes and iptables rules:

iptables -t mangle -A OUTPUT -m owner --uid-owner 421 -j MARK --set-mark 1
iptables -t nat -A POSTROUTING -o enp9s0 -j MASQUERADE

echo '200 plex-route' >> /etc/iproute2/rt_tables
ip route add default via 192.168.1.254 dev enp9s0 table plex-route
ip rule add fwmark 1 table plex-route

I attempted to test the connection by using sudo -u plex ping 8.8.8.8, but I never get a reply. I used wireshark to what was happening with the packets. The traffic is properly routed through the enp9s0 interface, and I also receive the reply from 8.8.8.8 (google public DNS), but the ping process never receives the reply. Does anyone have solution to this issue?



Related Questions


Updated October 26, 2015 07:00 AM

Updated April 23, 2016 08:00 AM

Updated May 29, 2015 23:00 PM

Updated March 30, 2018 04:01 AM

Updated February 22, 2017 14:01 PM