tableview.sh

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



netfilter and lartc members

I just thought it's time I contribute. I created this little script to
help me while setting up iptables rules for firewalling, shaping or
both. I hope this helps someone.

Called tableview.sh, inspired by Table Mountain, Cape Town, ZA :)

--- SOF ----

#!/bin/sh
#     ____
#  /\/    \/\
# /__________\
#
# Simple loop for keeping track of what is happening in a
# iptables setup
#

table_filter(){
        echo
        echo "FILTER TABLE"
        echo "------------"
        echo
        iptables -nvL
}
table_mangle(){
        echo
        echo "MANGLE TABLE"
        echo "------------"
        echo
        iptables -nvL -t mangle
}
table_nat(){
        echo
        echo "NAT TABLE"
        echo "---------"
        echo
        iptables -nvL -t nat
}
footer(){
        echo
        echo "-------------------------------------------------------------"
        echo "Show table: [F]ilter, [M]angle, [N]AT or hit return to reload"
}

last="filter"

while [ 1 ]; do
        clear
        case "$REPLY" in
                "F" | "f" )
                        table_filter
                        last="filter"
                        ;;
                "M" | "m" )
                        table_mangle
                        last="mangle"
                        ;;
                "N" | "n" )
                        table_nat
                        last="nat"
                        ;;
                "Q" | "q" )
                        exit 0
                        ;;
                *)
                        table_$last
                        ;;
        esac
        footer
        read
done

--- EOF ---

Regards

-- 

Kenneth Kalmer
kenneth.kalmer@xxxxxxxxx
http://opensourcery.blogspot.com
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux