crontab (for root)
0 0,4,8,12,16,20 * * * /usr/bin/popular.sh drop & >/dev/null 2>&1
30 3,7,11,15,19,23 * * * /usr/bin/popular.sh clear & >/dev/null 2>&1
popular.sh
#!/bin/sh
#hide_from_id.sh
#ID_SOFT1=192.246.40.0/24
ID_SOFT1=monster.idsoftware.com
case "$1" in
"drop") /sbin/iptables -A INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -A OUTPUT -d $ID_SOFT1 -j DROP
;;
*) /sbin/iptables -D INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -D OUTPUT -d $ID_SOFT1 -j DROP
;;
esac
exit 0
[root@ga1 bin]#
Also, here's a version if you want some servers to do that and others not:
#!/bin/sh
#hide_from_id.sh
#ID_SOFT1=192.246.40.0/24
ID_SOFT1=monster.idsoftware.com
EXCEPT=some.host.com or IP
case "$1" in
"drop") /sbin/iptables -I INPUT -s $EXCEPT -j ACCEPT
/sbin/iptables -A INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -A OUTPUT -d $ID_SOFT1 -j DROP
;;
*) /sbin/iptables -I INPUT -s $EXP -j ACCEPT
/sbin/iptables -D INPUT -s $ID_SOFT1 -j DROP
/sbin/iptables -D OUTPUT -d $ID_SOFT1 -j DROP
;;
esac
exit 0
How it works:
http://www.escapedturkey.com/cfaq/index ... 7&catid=24
