Re: Howto measure pps at forwarding plane
Thanks, it's better now. From: owner-m...@openbsd.org on behalf of Claudio Jeker Sent: Thursday, June 10, 2021 12:33 PM To: misc@openbsd.org Subject: Re: Howto measure pps at forwarding plane On Thu, Jun 10, 2021 at 09:23:03AM -, Stuart Henderson wrote: > On 2021-06-10, Valdrin MUJA wrote: > > 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. > > > > If you are only interested in IPv4 then yes that'll do it. > This would save some cpu cycles though: > > VAL1=`netstat -s | awk '/packets forwarded/ { print $1; exit }'` > And use netstat -spip which limits the number of sysctls made in netstat. -- :wq Claudio
Re: Howto measure pps at forwarding plane
On Thu, Jun 10, 2021 at 09:23:03AM -, Stuart Henderson wrote: > On 2021-06-10, Valdrin MUJA wrote: > > 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. > > > > If you are only interested in IPv4 then yes that'll do it. > This would save some cpu cycles though: > > VAL1=`netstat -s | awk '/packets forwarded/ { print $1; exit }'` > And use netstat -spip which limits the number of sysctls made in netstat. -- :wq Claudio
Re: Howto measure pps at forwarding plane
On 2021-06-10, Valdrin MUJA wrote: > 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. > If you are only interested in IPv4 then yes that'll do it. This would save some cpu cycles though: VAL1=`netstat -s | awk '/packets forwarded/ { print $1; exit }'`
Howto measure pps at forwarding plane
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.