port triggering with OpenWRT works!

I finally got around to compiling the ipt_TRIGGER kernel module with some logging in there, so I could tell where I was going wrong with my iptables commands.

The correct iptables commands are:

#iptables -t nat -A prerouting_wan -p tcp –dport 6881:6889 -j TRIGGER –trigger-type dnat
#iptables -A forwarding_wan -p tcp –dport 6881:6889 -j TRIGGER –trigger-type in
#iptables -t nat -A prerouting_rule -i br0 -p tcp –dport 6969 -j TRIGGER –trigger-type out –trigger-proto all –trigger-match 6881-6889 –trigger-relate 6881-6889

The first one handles NAT mangling for packets coming in off the WAN. The second one handles forwarding for the same packets. The last one is the one that creates a trigger when it spots an outbound BT packet.

Edit: update here.

Published
Categorized as Linux

3 comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.