aabc / ipt-netflow

Netflow iptables module for Linux kernel (official)
https://github.com/aabc/ipt-netflow
502 stars 129 forks source link

Several netflow sensors on single server #103

Open Zur0 opened 5 years ago

Zur0 commented 5 years ago

Hi! Хотелось бы настроить несколько сенсоров ipt_NETFLOW на одном и том же сервере, но не знаю как это можно сделать.

Например, у меня есть несколько интерфейсов eth0 и eth1. И я хочу собирать данные трафика по этим интерфейсам и передавать по netflow на разные коллекторы.

aabc commented 5 years ago

Такой функционал не досутпен.

Zur0 commented 5 years ago

Я тут выскажу свои идеи, вдруг, что-то из этого будет возможно?

aabc commented 5 years ago

На nag.ru люди как-то решают эту проблему, возможно, они поделятсья с вами своим решением.

heimdal-31 commented 5 years ago

I'm pretty sure Google translate is working enough that I'd like to second this request.

I have two different ISPs and have my linux box set up as a router for two different LANs behind a third interface with rather complex iptables rules.

My life would be much easier digging into issues or fixing my own mistakes if I could make certain the netflow was just for one interface.

I could acheive the same thing if captured netflow has an interface number in it, but I don't see it in the raw output using nfdump. It's possible it is there or there is a way of getting it there I'm unaware of.

With an interface number, I can use nfdump to filter based on that. Adding an interface number may be easier than adding a destination option to the target of an iptables jump.

heimdal-31 commented 5 years ago

Let me EDIT the above and say that there is an interface in the exported netflow, it just doesn't show in RAW.

So, I can achieve the original request by adding something like 'IF 1' or 'IF 0' to my nfdump query.

aabc commented 5 years ago

@heimdal-31 Interface number is always exported, if it's known (which depends on in what chain you capture traffic). Look first with Wireshark (or tshark) what are interface numbers for your traffic in the NetFlow stream. If the interface is -1 then it's "unknown", and you may try to put NETFLOW rule into a different chain. If Wireshark shows that interface number is not -1, but you don't see it in nfdump then it's a problem of nfdump usage.