#cat ng5_netflow.sh #!/bin/sh
kldload ng_netflow
kldload ng_ether
kldload ng_tee
kldload ng_one2many
/usr/sbin/ngctl -f- <<-SEQ
mkpeer em2: tee lower right
connect em2: em2:lower upper left
name em2:lower em2_tee
mkpeer em2:lower netflow right2left iface0
name em2:lower.right2left netflow
msg netflow: setifindex { iface=0 index=1 }
connect em2:lower netflow: left2right iface1
msg netflow: setifindex { iface=1 index=1 }
mkpeer vlan254: tee lower right
connect vlan254: vlan254:lower upper left
name vlan254:lower vlan254_tee
connect vlan254:lower netflow: right2left iface3
msg netflow: setifindex { iface=3 index=1 }
connect vlan254:lower netflow: left2right iface4
msg netflow: setifindex { iface=4 index=1 }
mkpeer vlan22: tee lower right
connect vlan22: vlan22:lower upper left
name vlan22:lower vlan22_tee
connect vlan22:lower netflow: right2left iface5
msg netflow: setifindex { iface=5 index=1 }
connect vlan22:lower netflow: left2right iface6
msg netflow: setifindex { iface=6 index=1 }
mkpeer vlan21: tee lower right
connect vlan21: vlan21:lower upper left
name vlan21:lower vlan21_tee
connect vlan21:lower netflow: right2left iface7
msg netflow: setifindex { iface=7 index=1 }
connect vlan21:lower netflow: left2right iface8
msg netflow: setifindex { iface=8 index=1 }
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/127.0.0.1:20001
SEQ
URL:
Обсуждается: http://www.opennet.dev/tips/info/982.shtml