Hi There, I have just purchased a TL-WR1043ND v2 and want to set up a feature whereby all websites are blocked except for one. Would something like this work on OpenWrt?
# Set up the chain
iptables -N wanout
iptables -I INPUT -i `nvram get lan_ifname` -j wanout
iptables -I FORWARD -i `nvram get lan_ifname` -j wanout
# Create whitelist 'function' script
WOUT="/tmp/wanout"
echo 'iptables -I wanout -j ACCEPT' > $WOUT
chmod 777 $WOUT
# Exempt Machine MAC
# load xt_mac instead of ipt_mac on k2.6 builds
insmod ipt_mac
$WOUT '-m mac --mac-source 00:30:18:A9:A9:C6'
# Exempt Machine IP
$WOUT '-s 192.168.1.2'
# Allow everyone access to these sites (DNS lookup only happens once when rule is inserted and stays that single IP)
$WOUT '-d www.google.com'
$WOUT '-d www.yahoo.com'
$WOUT '-d www.dd-wrt.com'
# Allow everyone access to these IP addresses/netmask
$WOUT '-d 74.125.67.100'
$WOUT '-d 74.125.127.100'
$WOUT '-d 74.125.45.100/24'
$WOUT '-d 209.131.36.158/29'
#Allow everyone access to specific destination ports
$WOUT '-p udp --dport 8000'
# Everything else gets blocked
iptables -A wanout -j REJECT --reject-with icmp-proto-unreachable