You are not logged in.

#1 2012-11-04 03:46:19

ParanoidAndroid
Member
Registered: 2012-10-14
Posts: 114

transmission, MPD and iptables firewall please help

I've posted about this once before, but I have several additional problems so I guess I'll just start a new thread...

I've set up iptables to redirect all tcp connections and DNS requests through tor, but I need to create two exceptions to this rule: 127.0.0.1:6600 (music player daemon client connections) and transmission (my bittorent client). That is, I need all connections EXCEPT MPD and bittorent to be forwarded through tor. How does one do this?

Here is my iptables configuration:

# Generated by iptables-save v1.4.15 on Fri Oct 12 16:33:33 2012
*nat
:PREROUTING ACCEPT [12:3420]
:INPUT ACCEPT [1:261]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

-A OUTPUT -p tcp -m owner --uid-owner 1000 -m tcp -j REDIRECT --to-ports 9040
-A OUTPUT -p udp -m owner --uid-owner 1000 -m udp --dport 53 -j REDIRECT --to-ports 53
COMMIT
# Completed on Fri Oct 12 16:33:33 2012
# Generated by iptables-save v1.4.15 on Fri Oct 12 16:33:33 2012
*filter
:INPUT ACCEPT [9:1175]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [8:488]
-A OUTPUT -p tcp -m owner --uid-owner 1000 -m tcp --dport 9040 -j ACCEPT
-A OUTPUT -p udp -m owner --uid-owner 1000 -m udp --dport 53 -j ACCEPT
-A OUTPUT -m owner --uid-owner 1000 -j DROP
COMMIT
# Completed on Fri Oct 12 16:33:33 2012

My MPD setup is a local one, such that MPD is run as a normal user and clients connect to it through port 6600 on localhost. With the firewall running, neither MPD nor transmission work properly. Without, they work fine. Please help.

Offline

#2 2012-11-04 06:13:10

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: transmission, MPD and iptables firewall please help

It's usual to have:

-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

Offline

Board footer

Powered by FluxBB