Hello, I'm trying to use the PeerGuardian rules (v2) found in the Wiki, but the issue I'm having is that some of the IPs blocked by the BluetackLevel1 list are ones from which I still need to accept connections.
Trying to setup a whitelist of sorts, or just another iptables rule to allow certain IPs through, but keeping PeerGuardian filters in effect.
Any thoughts on where I'm going wrong would be greatly appreciated. Running RT-N66R, latest f/w (374.40).
Here's what I have in my /jffs/scripts/firewall-start:
Trying to setup a whitelist of sorts, or just another iptables rule to allow certain IPs through, but keeping PeerGuardian filters in effect.
Any thoughts on where I'm going wrong would be greatly appreciated. Running RT-N66R, latest f/w (374.40).
Here's what I have in my /jffs/scripts/firewall-start:
Code:
# PeerGuardian rules
# Loading ipset modules
lsmod | grep "ipt_set" > /dev/null 2>&1 || \
for module in ip_set ip_set_iptreemap ipt_set; do
insmod $module
done
# Create the BluetackLevel1 (primary) if does not exists
if [ "$(ipset --swap BluetackLevel1 BluetackLevel1 2>&1 | grep 'Unknown set')" != "" ]; then
ipset --create BluetackLevel1 iptreemap && \
iptables -I FORWARD -m set --set BluetackLevel1 src,dst -j DROP
fi
# Destroy this transient set just in case
ipset --destroy BluetackLevel2 > /dev/null 2>&1
# Load the latest rule(s)
(echo -e "-N BluetackLevel2 iptreemap\n" && \
nice wget -q -O - "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz" | \
nice gunzip | nice cut -d: -f2 | nice grep -E "^[-0-9.]+$" | \
nice sed 's/^/-A BluetackLevel2 /' && \
echo -e "\nCOMMIT\n" \
) | \
nice ipset --restore && \
nice ipset --swap BluetackLevel2 BluetackLevel1 && \
nice ipset --destroy BluetackLevel2
# Allow traffic through T-Mobile USA IP Addresses
ipset -N TMUS nethash
ipset -A TMUS 172.56.0.0/16
ipset -A TMUS 208.54.0.0/17
#iptables -A INPUT -m set --set TMUS src -j ACCEPT
iptables -I FORWARD -m set --set TMUS src,dst -j ACCEPT
#exit $?