LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   using bittorrent through iptables on gateway (slackw) (https://www.linuxquestions.org/questions/linux-security-4/using-bittorrent-through-iptables-on-gateway-slackw-110335/)

Freefire 10-30-2003 06:36 AM

using bittorrent through iptables on gateway (slackw)
 
Hi Everyone,

I have a computer used as firewall with slackware and iptables on it. I use Bittorrent on another computer that connects to the internet via the firewall computer.

I tried addig rules to the rc.firewall to let the bittorrent traffic pass through it but it does not seem to work.

I searched the web of course to see what could be faulty but there must be some detail i missed.

Here is a sample of the rules i set up.
No point in showing each of the 9 ports' rules so i'll show you the first port's one:

$IPT -t nat -A PREROUTING -p tcp -d $INET_ADDRESS --dport 6881 -j DNAT --to-destination 192.168.0.2:6881

$IPT -t nat -A PREROUTING -p udp -d $INET_ADDRESS --dport 6881 -j DNAT --to-destination 192.168.0.2:6881


$IPT -A tcp_inbound -p TCP -s 0/0 --dport 6881 -j ACCEPT
$IPT -A tcp_inbound -p UDP -s 0/0 --dport 6881 -j ACCEPT
$IPT -A FORWARD -p tcp --destination-port 6881 -j ACCEPT
$IPT -A FORWARD -p udp --destination-port 6881 -j ACCEPT

...

Earlier I had this command similar effect... not functioning...

#$IPT -t nat -A PREROUTING -p tcp --dport 6881 -j DNAT --to 192.168.0.2:6881 -i ppp0

...

Now I just don't know what is wrong.

Could you help me out?

Thanks in advance.

zaphodiv 10-31-2003 08:06 PM

I have a rule which NAT's all outgoing connections
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

I don't try to firewall outgoing.

For incoming connections on a machine where eth0 is an ethernet card that just goes to the internet I use iptables rules like;

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 6881 -j DNAT --to-destination 192.168.1.1

Freefire 11-05-2003 07:20 AM

Ok, so i suppose the main difference being that you choose by interface instead of the ip of the interface.

I'll try it out and see what it does.

Thanks

MadTurki 01-05-2004 10:29 AM

If This doesnt work, what else could it be? I'm new to iptables. I copied the example from the RedHat Bible and made the neccesary ip changes but I still cant get it to forward port requests (by using the line above)

Please help! Thanks


All times are GMT -5. The time now is 02:08 AM.