<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>I'm trying to figure out the best way to add and remove iptables rules as required.</div><div><br data-mce-bogus="1"></div><div>I use this block a laptop due to bad tests scores :)</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>&nbsp;IP=192.168.1.153<br>#iptables -P FORWARD DROP<br>iptables -I FORWARD -s 0/0 -d ${IP} -j DROP<br>iptables -I FORWARD -s ${IP} -d 0/0 -j DROP</div><div># Squid<br>iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3128 -s ${IP}/32 -j REJECT<br>iptables -A INPUT -i eth0 -p udp -m udp --dport 3128 -s ${IP}/32 -j REJECT<br></div><div><br data-mce-bogus="1"></div><div>First two stops routing. &nbsp;Second blocks squid access.</div><div><br data-mce-bogus="1"></div><div>Normally I'll just do an iptables-restore, but I'm fail2ban andminiupnpd. &nbsp;The restore blows away their rules.</div><div><br data-mce-bogus="1"></div><div>Do I create a custom chain for INPUT and FORWARD and simply delete rules in that? &nbsp;Using MQTT this will become push button and the wife will simply push a button on and then off.</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></body></html>