diff --git a/Shorewall/help b/Shorewall/help index 059df2eb0..c6bab9ed7 100755 --- a/Shorewall/help +++ b/Shorewall/help @@ -195,8 +195,8 @@ save) ;; show) - echo "show: show [|classifiers|connections|log|nat|tc|tos] - shorewall show chain - produce a verbose report about the IPtable chains. + echo "show: show [ [ ...] |classifiers|connections|log|nat|tc|tos] + shorewall show [ ... ] - produce a verbose report about the IPtable chain(s). (iptables -L chain -n -v) shorewall show nat - produce a verbose report about the nat table. diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index eacc1f7c7..284b75708 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -293,5 +293,6 @@ New Features: zones individually rather than as a single limit for all pairs of zones covered by the rule. - +10) Multiple chains may now be displayed in one "shorewall show" + command (e.g., shorewall show INPUT FORWARD OUTOUT). diff --git a/Shorewall/shorewall b/Shorewall/shorewall index bf38b96b9..d511a04ed 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -51,7 +51,7 @@ # compensate for a change of # broadcast address on any "detect" # interface. -# shorewall show Display the rules in a +# shorewall show [ ... ] Display the rules in each listed # shorewall show log Print the last 20 log messages # shorewall show connections Show the kernel's connection # tracking table @@ -590,7 +590,7 @@ usage() # $1 = exit status echo " reset" echo " restart" echo " save" - echo " show [|classifiers|connections|log|nat|tc|tos]" + echo " show [ [ ... ]|classifiers|connections|log|nat|tc|tos]" echo " start" echo " stop" echo " status" @@ -738,26 +738,29 @@ case "$1" in exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $1 $2 $3 ;; show|list) - [ $# -gt 2 ] && usage 1 case "$2" in connections) + [ $# -gt 2 ] && usage 1 echo "Shorewall-$version Connections at $HOSTNAME - `date`" echo cat /proc/net/ip_conntrack ;; nat) + [ $# -gt 2 ] && usage 1 echo "Shorewall-$version NAT at $HOSTNAME - `date`" echo show_reset iptables -t nat -L -n -v ;; tos|mangle) + [ $# -gt 2 ] && usage 1 echo "Shorewall-$version TOS at $HOSTNAME - `date`" echo show_reset iptables -t mangle -L -n -v ;; log) + [ $# -gt 2 ] && usage 1 get_config echo "Shorewall-$version Log at $HOSTNAME - `date`" echo @@ -766,20 +769,26 @@ case "$1" in packet_log 20 ;; tc) + [ $# -gt 2 ] && usage 1 echo "Shorewall-$version Traffic Control at $HOSTNAME - `date`" echo show_tc ;; classifiers) + [ $# -gt 2 ] && usage 1 echo "Shorewall-$version Clasifiers at $HOSTNAME - `date`" echo show_classifiers ;; *) - echo "Shorewall-$version Chain $2 at $HOSTNAME - `date`" + shift + + echo "Shorewall-$version `[ $# -gt 1 ] && echo Chains || echo Chain` $* at $HOSTNAME - `date`" echo show_reset - iptables -L $2 -n -v + for chain in $*; do + iptables -L $chain -n -v + done ;; esac ;;