How to read all traffic received on one network interface using Erlang

Papa Tana papa.tana101@REDACTED
Tue Aug 11 14:12:26 CEST 2020

Hi All,

Great day!

I have one network interface, connected with a client:

[client]------> [(eth0)::Me]

Whenever I want to read all traffic I received on my (eth0) interface, I'm
using tcpdump.
# tcpdump -i eth0 -w file.pcap

And only after that, I can pass the pcap file to Erlang as an Argument, and
I can process/modify it:

It's working, but as you can see, it's not real time :-/

gen_tcp/gen_udp are not working because I would only capture all traffic
matching ip address and udp port and for me only. But I want all traffic in
my eth0 (traffic can be for other destination, not Me).

I have checked

they are great jobs, but seem to be encoding/decoding and need to specify
protocol for socket:bind

Can anyone advice please?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list