CCL Home Page
Up Directory CCL iptables.txt
#!/bin/bash
#
# I, Jan Labanowski, grabbed this script from RedHat 7.1 ipchains distribution
# and totally messed it up by removing all the fancy stuff and checking.
# One day {(;-)} I will do the real script.
#
# chkconfig: 2345 11 89
#
# description: Automates a packet filtering firewall with iptables.
#
# I assume that iptables reside in /usr/bin/iptables, are owned by root
# and have permission 700
#


case "$1" in
  start)
        /usr/sbin/flushfw
        /usr/sbin/startfw
        echo iptables are now running
        
        ;;

  stop)
        /usr/sbin/flushfw
        echo iptables are now stopped
        ;;

  restart)
        # "restart" is really just "start" as this isn't a daemon,
        #  and "start" clears any pre-defined rules anyway.
        #  This is really only here to make those who expect it happy
        $0 start
        ;;

  status)
        /usr/sbin/iplisting
        ;;

  panic)
        /usr/sbin/flushfw
        echo iptables are now stopped
        ;;

  *)
        echo $"Usage: $0 {start|stop|restart|status|panic}"
        exit 1
esac

exit 0

Modified: Tue Dec 11 01:35:03 2001 GMT
Page accessed 11669 times since Tue Dec 11 06:01:57 2001 GMT