Hello, I'm trying to figure out how much packets are being forwarded on my OpenBSD firewall. Here a small script i wrote.
#!/bin/sh VAL1=`netstat -s | grep 'packets forwarded' | head -1 | awk -F ' ' '{print $1}'` sleep 1 VAL2=`netstat -s | grep 'packets forwarded' | head -1 | awk -F ' ' '{print $1}'` echo "$(($VAL2-$VAL1))" But i can not be sure if i am doing the right thing? Can anyone check it please. Thanks.