There are two ways to do this, depending on your router setup.
You either have one of the two scenarios:
1. You're using Azareus on the router itself.
2. You're using Azareus on a machine behind the router on your lan.
Option 1:
If you're using Azareus on the router box, then you'll want to use the INPUT chain, which will work on packets destined for the linux router itself, and not for a machine behind the router.
You could do:
iptables -A INPUT -p tcp --dport 6881 -j ACCEPT
iptables -A INPUT -p udp --dport 6881 -j ACCEPT
This will work if no previous rule would block it out, such as a catch-all rule that drops everything.
If there is a catch-all rule, and you append (-A) this rule to it, it will still fail. In that case, you can do:
iptables -I INPUT -p tcp --dport 6881 -j ACCEPT
iptables -I INPUT -p udp --dport 6881 -j ACCEPT
Option 2:
If you have a machine behind the router, and not the router itself, and would like to forward all incoming connections on that port to that machine, then do the following.
Let's say the private ip address of the machine behind the router (the one you're running Azareus on) is 192.168.0.101:
Then you would do:
iptables -t nat -A PREROUTING -p tcp --dport 6881 -j DNAT --to-destination 192.168.0.101
iptables -t nat -A PREROUTING -p udp --dport 6881 -j DNAT --to-destination 192.168.0.101
Hope that helps.
Pablo
|