Starting/Stopping and Monitoring the Firewall

If you have a permanent internet connection such as DSL or Cable, I recommend that you start the firewall automatically at boot. Once you have installed "firewall" in your init.d directory, simply type "chkconfig --add firewall". This will start the firewall in run levels 2-5 and stop it in run levels 1 and 6. If you want to configure your firewall differently from this default, you can use the "--level" option in chkconfig (see "man chkconfig") or using your favorite graphical run-level editor.

Important Note:

If you use dialup, you may want to start the firewall in your /etc/ppp/ip-up.local script. I recommend just placing "shorewall restart" in that script.

You can manually start and stop Shoreline Firewall using the "shorewall" shell program:

bulletshorewall start - starts the firewall
bulletshorewall stop - stops the firewall
bulletshorewall restart - stops the firewall (if it's running) and then starts it again
bulletshorewall reset - reset the packet and byte counters in the firewall
bulletshorewall clear - remove all rules and chains installed by Shoreline Firewall
bulletshorewall refresh - refresh the rules involving the broadcast addresses of firewall interfaces and the black and white lists.

The "shorewall" program may also be used to monitor the firewall.

bulletshorewall status - produce a verbose report about the firewall (iptables -L -n -v)
bulletshorewall show chain - produce a verbose report about chain (iptables -L chain -n -v)
bulletshorewall show nat - produce a verbose report about the nat table (iptables -t nat -L -n -v)
bulletshorewall show tos - produce a verbose report about the mangle table (iptables -t mangle -L -n -v)
bulletshorewall show log - display the last 20 packet log entries.
bulletshorewall show connections - displays the IP connections currently being tracked by the firewall.
bulletshorewall show tc - displays information about the traffic control/shaping configuration.
bulletshorewall monitor [ delay ] - Continuously display the firewall status, last 20 log entries and nat. When the log entry display changes, an audible alarm is sounded.
bulletshorewall hits - Produces several reports about the Shorewall packet log messages in the current /var/log/messages file.
bulletshorewall version - Displays the installed version number.
bulletshorewall check - Performs a cursory validation of the zones, interfaces, hosts, rules and policy files.
bulletshorewall try configuration-directory [ timeout ] - Restart shorewall using the specified configuration and if an error occurs or if the timeout option is given and the new configuration has been up for that many seconds then shorewall is restarted using the standard configuration.
bulletshorewall deny, shorewall reject, shorewall accept and shorewall save implement dynamic blacklisting.
bulletshorewall logwatch (added in version 1.3.2) - Monitors the LOGFILE and produces an audible alarm when new Shorewall messages are logged.

The shorewall start and shorewall restart commands allow you to specify which Shorewall configuration to use:

shorewall [ -c configuration-directory ] {start|restart}

If a configuration-directory is specified, each time that Shorewall is going to use a file in /etc/shorewall it will first look in the configuration-directory . If the file is present in the configuration-directory, that file will be used; otherwise, the file in /etc/shorewall will be used.

Updated 7/26/2002 - Tom Eastep

Copyright © 2001, 2002 Thomas M. Eastep.