Hi everyone, after looking the previous configuration, I changed it a
bit, but so far I still can't seeing the unknown traffic.
The actual configuration, is cleaner than previous one.
# /etc/pmacct/network.lst
192.168.0.0/24
192.168.1.0/24
172.16.0.0/23
172.16.2.0/24
172.16.250.0./24
# /etc/pmacct/pretag_in.map
set_label=client%wknwnnet1 dst_net=172.16.0.0/23 jeq=eval_type
set_label=client%wknwnnet1 dst_net=172.16.2.0/24 jeq=eval_type
set_label=client%wknwnnet2 dst_net=172.16.250.0/24 jeq=eval_type
set_label=type%mynet1 src_net=192.168.0.0/23 label=eval_type
set_label=type%mynet2 src_net=192.168.2.0/24 label=eval_type
set_label=type%tip src_net=0.0.0.0/0 label=eval_type
# /etc/pmacct/pretag_out.map
set_label=client%wknwnnet1 src_net=172.16.0.0/23 jeq=eval_type
set_label=client%wknwnnet1 src_net=172.16.2.0/24 jeq=eval_type
set_label=client%wknwnnet2 src_net=172.16.250.0/24 jeq=eval_type
set_label=type%mynet1 dst_net=192.168.0.0/23 label=eval_type
set_label=type%mynet2 dst_net=192.168.2.0/24 label=eval_type
set_label=type%tip dst_net=0.0.0.0/0 label=eval_type
# /etc/pmacct/pretag_unknown.map
dst_net=172.16.0.0/23
dst_net=172.16.2.0/24
dst_net=172.16.250.0/24
src_net=172.16.0.0/23
src_net=172.16.2.0/24
src_net=172.16.250.0/24
set_label=client%unknown src_net=0.0.0.0/0 jeq=eval_type
set_label=type%mynet1 dst_net=192.168.0.0/23 label=eval_type
set_label=type%mynet2 dst_net=192.168.2.0/24 label=eval_type
set_label=type%unknown dst_net=0.0.0.0/0 label=eval_type
#/etc/pmacct/sfacctd.conf
daemonize: false
debug: true
networks_file: /etc/pmacct/networks.lst
sfacctd_net: file
sfacctd_port: 8152
sfacctd_renormalize: true
sfacctd_time_new: true
plugin_buffer_size: 1024000
plugin_pipe_size: 10240000
propagate_signals: true
timestamps_secs: true
pre_tag_label_encode_as_map: true
plugins: kafka[in],kafka[out],kafka[unknown]
kafka_topic[in]: input_traffic
kafka_output[in]: json
kafka_broker_host[in]: 10.0.0.1
kafka_broker_port[in]: 5094
kafka_refresh_time[in]: 180
kafka_history[in]: 3m
kafka_history_roundoff[in]: m
pre_tag_map[in]: /etc/pmacct/pretag_in.map
aggregate_filter[in]: vlan and (dst net 172.16.0.0/23 or dst net
172.16.2.0/24 or dst net 172.16.250.0/24)
aggregate[in]: etype,label
kafka_topic[out]: output_traffic
kafka_output[out]: json
kafka_broker_host[out]: 10.0.0.1
kafka_broker_port[out]: 5094
kafka_refresh_time[out]: 180
kafka_history[out]: 3m
kafka_history_roundoff[out]: m
pre_tag_map[out]: /etc/pmacct/pretag_out.map
aggregate_filter[out]: vlan and (src net 172.16.0.0/23 or src net
172.16.2.0/24 or src net 172.16.250.0/24)
aggregate[out]: etype,label
kafka_topic[unknown]: unknown_traffic
kafka_output[unknown]: json
kafka_broker_host[unknown]: 10.0.0.1
kafka_broker_port[unknown]: 5094
kafka_refresh_time[unknown]: 180
kafka_history[unknown]: 3m
kafka_history_roundoff[unknown]: m
pre_tag_map[unknown]: /etc/pmacct/pretag_unknown.map
pre_tag_label_filter[unknown]: -null
aggregate[unknown]:
src_host,src_port,src_net,src_mask,dst_host,dst_port,dst_net,dst_mask,proto,etype,vlan,in_iface,out_iface,peer_src_ip,label
Any advice?
Regards,
Federico
On 10/1/23 21:46, Federico Urtizberea wrote:
An errata, in the copy and paste process I made a mistake. My
pretag.map file is:
/etc/pmacct/pretag.map
set_label=client%wknwnnet1 src_net=172.16.0.0/23 jeq=eval_out_type
set_label=client%wknwnnet1 src_net=172.16.2.0/24 jeq=eval_out_type
set_label=client%wknwnnet2 src_net=172.16.250.0/24 jeq=eval_out_type
set_label=client%wknwnnet1 dst_net=172.16.0.0/23 jeq=eval_in_type
set_label=client%wknwnnet1 dst_net=172.16.2.0/24 jeq=eval_in_type
set_label=client%wknwnnet2 dst_net=172.16.250.0/24 jeq=eval_in_type
set_label=direction%output,type%mynet1 dst_net=192.168.0.0/23
label=eval_out_type
set_label=direction%output,type%mynet2 dst_net=192.168.2.0/24
label=eval_out_type
set_label=direction%output,type%tip dst_net=0.0.0.0/0 label=eval_out_type
set_label=direction%input,type%mynet1 src_net=192.168.0.0/23
label=eval_in_type
set_label=direction%input,type%mynet2 src_net=192.168.2.0/24
label=eval_in_type
set_label=direction%input,type%tip src_net=0.0.0.0/0 label=eval_in_type
Regards,
Federico
On 10/1/23 20:55, Federico Urtizberea wrote:
Hi to all, i need some suggestions to resolve this.
I have severeral well known networks connected to my network, and i
provide transit to them. I need to measure the traffic between them
and my network, the ip transit traffic, and the unknown generate
traffic. To achieve this, I have configured several SFLOW exporters.
Let's say thay my networks are (mynet1) 192.168.0.0/24 and (mynet2)
192.168.1.0/24 and the well known networks 1 (wknwnnet1) are
172.16.0.0/23 and 172.16.2.0/24, and the well known network 2
(wknwnnet2) is 172.16.250.0/24.
So I wrote a network.lst file with all of these networks.
/etc/pmacct/network.lst
192.168.0.0/24
192.168.1.0/24
172.16.0.0/23
172.16.2.0/24
172.16.250.0./24
Then i wrote a pretag.map file, to set labels to the different kind
of traffic.
/etc/pmacct/pretag.map
set_label=client%wknwnnet1 src_net=172.16.0.0/23 jeq=eval_out_type
set_label=client%wknwnnet1 src_net=172.16.2.0/24 jeq=eval_out_type
set_label=client%wknwnnet2 src_net=172.16.250.0/24 jeq=eval_out_type
set_label=client%wknwnnet1 dst_net=172.16.0.0/23 jeq=eval_in_type
set_label=client%wknwnnet1 dst_net=172.16.2.0/24 jeq=eval_in_type
set_label=client%wknwnnet2 dst_net=172.16.250.0/24 jeq=eval_in_type
set_label=direction%output,type%mynet1 dst_net=192.168.0.0/23
label=eval_out_type
set_label=direction%output,type%mynet2 dst_net=192.168.2.0/24
label=eval_out_type
set_label=direction%output,type%tip dst_net=0.0.0.0/0
label=eval_out_type
set_label=direction%input,type%mynet1 src_net=192.168.0.0/23
label=eval_out_type
set_label=direction%input,type%mynet2 src_net=192.168.2.0/24
label=eval_out_type
set_label=direction%input,type%tip src_net=0.0.0.0/0 label=eval_out_type
and my sfacctd.conf is this:
daemonize: false
debug: true
networks_file: /etc/pmacct/networks.lst
sfacctd_net: file
sfacctd_port: 8152
sfacctd_renormalize: true
sfacctd_time_new: true
plugin_buffer_size: 1024000
plugin_pipe_size: 10240000
propagate_signals: true
timestamps_secs: true
pre_tag_map: /etc/pmacct/pretag.map
pre_tag_label_encode_as_map: true
plugins: kafka[known],kafka[unknown]
kafka_topic[known]: known
kafka_output[known]: json
kafka_broker_host[known]: 10.0.0.1
kafka_broker_port[known]: 5094
kafka_refresh_time[known]: 180
kafka_history[known]: 3m
kafka_history_roundoff[known]: m
aggregate_filter[known]: vlan and (net 172.16.0.0/23 or net
172.16.2.0/24 or net 172.16.250.0/24)
aggregate[known]: etype,label
kafka_topic[unknown]: unknown
kafka_output[unknown]: json
kafka_broker_host[unknown]: 10.0.0.1
kafka_broker_port[unknown]: 5094
kafka_refresh_time[unknown]: 180
kafka_history[unknown]: 3m
kafka_history_roundoff[unknown]: m
aggregate_filter[unknown]: vlan and not (net 172.16.0.0/23 or net
172.16.2.0/24 or net 172.16.250.0/24)
aggregate[unknown]:
src_host,src_port,src_net,src_mask,dst_host,dst_port,dst_net,dst_mask,proto,etype,vlan,in_iface,out_iface,peer_src_ip
The aggregated traffic for "known" plugin is working fine, but the
"unknown" plugin is not working, it doesn't aggregate any traffic. If
I remove the aggregate_filter for that plugin, and do the filter in
my backend "src_net=0.0.0.0/0 and dst_net=0.0.0.0/0" I obtain the
searched traffic.
Do you have any suggestions?
Thanks in advance,
Federico
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists