Помогите с NG_NETFLOW
Добавлено: 2009-09-15 22:45:28
Господа помогите не как не могу розобратса перелопатил весь ман по етому поводу ни как не могу вехать что с чем может хтото подскажет как с его помошу считать трафик шлюза
И один в поле воин, если он по-русски скроен
https://forum.lissyara.su/
Код: Выделить всё
ngctl: send msg: No such file or directory
ngctl: line 1: error in filКод: Выделить всё
#!/bin/sh
/usr/sbin/ngctl -f- <<-SEQ
mkpeer vr0:inet netflow right2left iface0
name vr0:inet.right2left netflow
msg netflow: setdlt { iface=0 dlt=12 }
msg netflow: setifindex { iface=0 index=5 }
connect vr1: netflow: lower iface1
connect vr1: netflow: upper out1
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/127.0.0.1:4444
SEQ
Код: Выделить всё
kldstat
Id Refs Address Size Name
1 23 0xc0400000 6f2298 kernel
2 1 0xc0af3000 6a32c acpi.ko
3 1 0xc407a000 4000 ng_socket.ko
4 1 0xc40a7000 3000 ng_iface.ko
5 1 0xc40ae000 7000 ng_ppp.ko
6 1 0xc4303000 5000 ng_netflow.ko
7 1 0xc7d29000 4000 ng_pptpgre.ko
8 1 0xc7d2d000 5000 ng_ksocket.ko
9 1 0xc8154000 4000 ng_ether.ko
10 1 0xc8158000 3000 ng_tee.ko
11 1 0xc815b000 3000 ng_one2many.ko
12 1 0xc8151000 2000 ng_hub.ko
Код: Выделить всё
ngctl: send msg: No such file or directory
Код: Выделить всё
mkpeer vr0:inet netflow right2left iface0
name vr0:inet.right2left netflow
msg netflow: setdlt { iface=0 dlt=12 }
msg netflow: setifindex { iface=0 index=5 }
connect vr1: netflow: lower iface1
connect vr1: netflow: upper out1
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/127.0.0.1:4444Код: Выделить всё
+ mkpeer vr0:inet netflow right2left iface0
ngctl: send msg: No such file or directory
Код: Выделить всё
/usr/sbin/ngctl -f- <<-SEQ
# connect ng0's tee to iface0 hook
mkpeer ng0:inet netflow right2left iface0
name ng0:inet.right2left netflow
# set DLT to raw mode
msg netflow: setdlt { iface=0 dlt=12 }
# set interface index (5 in this example)
msg netflow: setifindex { iface=0 index=5 }
# Connect fxp0: to iface1 and out1 hook
connect fxp0: netflow: lower iface1
connect fxp0: netflow: upper out1
# Create ksocket node on export hook, and configure it
# to send exports to proper destination
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/10.0.0.1:4444
SEQ
Код: Выделить всё
/usr/sbin/ngctl -f- <<-SEQ
mkpeer vr0: netflow lower iface0
name vr0:lower netflow
connect vr0: netflow: upper out0
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/127.0.0.1:4444
SEQ
This is a more complicated example of a router with 2 NetFlow-enabled
interfaces fxp0 and ng0. Note that the ng0: node in this example is con-
nected to ng_tee(4). The latter sends us a copy of IP packets, which we
analyze and free. On fxp0: we do not use tee, but send packets back to
ether node.
/usr/sbin/ngctl -f- <<-SEQ
# connect ng0's tee to iface0 hook
mkpeer ng0:inet netflow right2left iface0
name ng0:inet.right2left netflow
# set DLT to raw mode
msg netflow: setdlt { iface=0 dlt=12 }
# set interface index (5 in this example)
msg netflow: setifindex { iface=0 index=5 }
# Connect fxp0: to iface1 and out1 hook
connect fxp0: netflow: lower iface1
connect fxp0: netflow: upper out1
# Create ksocket node on export hook, and configure it
# to send exports to proper destination
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/10.0.0.1:4444
SEQ
Код: Выделить всё
#1
mkpeer xl0: netflow lower iface0
name xl0:lower netflow
connect xl0: netflow: upper out0
mkpeer netflow: ksocket export inet/dgram/udp
msg netflow:export connect inet/127.0.0.1:9996
#2
connect xl1: netflow: lower iface2
connect xl1: netflow: upper out2
.....
#N
connect xlN: netflow: lower ifaceN
connect xlN: netflow: upper outN
msg netflow: setconfig {iface=0 conf=7}
msg netflow: setconfig {iface=1 conf=7}
...
msg netflow: setconfig {iface=N conf=7}
О, точно, спасибо, то что надо, вроде даже видел эту страницу, но что-то глаз не зацепился.hizel писал(а):http://forum.sysadmins.su/index.php?showtopic=21863
последний пост