start | find | index | login or register | edit
Mittwoch, 13. Dezember 2006 link

a simple shellscript that prints basic stats about the nat usage of a zyxel router (should work with a wide range of prestige routers, tested on p324 and p660).

#!/bin/bash
if [ "$#" -ne "3" ]; then
echo "Usage: $0 ip password interface" 1>&2
exit 1
fi

HOST=$1; PASS=$2; INTF=$3

printf "${PASS}\n24\n8\nip nat hash ${INTF}\nexit\n99\n" |
nc ${HOST} 23 |
sgrep '("Idle".."=\r\n")__"\r\n\r\n"' |
awk '{print $3,$2}' |
sort |
uniq -c

requires netcat and sgrep. don't you love the unix toolchain?


no comments

Please log in (you may want to register first) to post comments!

powered by vanilla
echo earlZstrainYat|tr ZY @.
earl.strain.at • esa3 • online for 6924 days • c'est un vanilla site