• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

help setting up iptables

RichieZ

Diamond Member
Ok so I want to block bittorrent, or at least the most common ports 6881-6889

I'm using a Linksys WRT54GS V2.0 w/ Sveasoft Alchemy RC5a

lets say I justed wanted to block port 6881, wouldn't that be:

nvram set rc_firewall='/usr/sbin/iptables -I INPUT -p tcp -s 192.168.1.1/199 --dport 6881 -j DROP'
nvram commit

and then reboot?

But when I check iptables -L -n it doesn't seem to show up

Please help
 
Make sure iptables are located in /usr/sbin, not /sbin (run 'which iptables')
Your /199 is invalid, you problably need /24 (for 1.x subnet)
Also you should probably use FORWARD, not INPUT
 
hmm reading up it seems I should be using the FORWARD chain since this is on my router.

I'm not sure about the syntax tho

$iptables -A FORWARD -p tcp -s 192.168.1.1/24 --dport 6881 -j DROP

How can I set it up to block both imcoming and outgoing connections on port 6881?

 
Both incoming and outgoing packets pass FORWARD, but obviously for incoming traffic you should match by destination:
... -d 192.168.1.1/24..., for outgoing -s 192.168.... (like you use now).
 
Back
Top