I have a tp-link router with openwrt. I have 2 iptables rules to block P2P connections. The blockings working fine, but now I need a rule to allow traffic to/from a specific IP.
my blocking rules:
iptables -I FORWARD -m string --string "BitTorrent protocol" --algo bm -j DROP
iptables -I FORWARD -m string --string ".torrent" --algo bm -j DROP
I add this rule:
iptables -I FORWARD -s 192.168.64.XX -j ACCEPT
iptables -I FORWARD -d 192.168.64.XX -j ACCEPT
but doesn't work.
I tried with little modifications:
iptables -A FORWARD -s 192.168.64.XX -j ACCEPT
iptables -A FORWARD -d 192.168.64.XX -j ACCEPT
Still doesn't work. I restarted the router after every rule change.
Now I can't see my modifications in the firewall, I only see this:
Chain FORWARD (Policy: DROP, Packets: 0, Traffic: 0.00 B)
Rule # Pkts. Traffic Target Prot. Flags In Out Source Destination Options
1 0 0.00 B DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match ".torrent" ALGO name bm TO 65535
2 96 10.39 KB DROP all -- * * 0.0.0.0/0 0.0.0.0/0 STRING match "BitTorrent protocol" ALGO name bm TO 65535
What did I do wrong?