>Подскажите плз, как выглядит скрипт для ngctl для снятия in|out трафика по
>_нескольким_ интерфейсам? вот мой скрипт, слабал когда-то давно за полчаса
# cat /usr/local/etc/rc.d/ng_flow.sh
#!/bin/sh
sub_start_ng_flow () {
iflist=`ifconfig -l ether`
count=0
named=no
# Compiled into kernel
# kldload ng_ether > /dev/null 2>&1
if [ "$ng_flow_auto" = "YES" -a ! -z "$iflist" ]
then
for if in $iflist
do
ngctl mkpeer $if: tee lower right
ngctl name $if:lower ${if}_tee
ngctl connect $if: $if:lower upper left
if [ "$named" = "no" ]
then
ngctl mkpeer $if:lower netflow left2right iface$count
ngctl name $if:lower.left2right netflow
named=yes
else
ngctl connect $if:lower netflow: left2right iface$count
fi
count=$(( $count + 1 ))
ngctl connect $if:lower netflow: right2left iface$count
count=$(( $count + 1 ))
done
ngctl mkpeer netflow: ksocket export inet/dgram/udp
ngctl name netflow:export netflow_socket
ngctl msg netflow:export connect inet/127.0.0.1:8787
fi
}
sub_stop_ng_flow () {
ngctl shutdown netflow: >/dev/null 2>&1
iflist=`ifconfig -l ether`
if [ ! -z "$iflist" ]
then
for if in $iflist
do
ngctl shutdown $if: >/dev/null 2>&1
done
fi
}
. /etc/rc.conf
case $1 in
start)
if [ "$ng_flow_enable" = "YES" ]
then
#sub_stop_ng_flow
sub_start_ng_flow
echo "ng_flow "
fi
exit 0
;;
stop)
sub_stop_ng_flow
exit 0
;;
*)
echo "usage: `basename $0` start|stop"
;;
esac