Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packetbeat: af_packet doesn't put interface in promiscuous mode #700

Closed
tsg opened this issue Jan 12, 2016 · 3 comments · Fixed by #11366
Closed

Packetbeat: af_packet doesn't put interface in promiscuous mode #700

tsg opened this issue Jan 12, 2016 · 3 comments · Fixed by #11366
Assignees
Labels
bug Packetbeat Team:Integrations Label for the Integrations team

Comments

@tsg
Copy link
Contributor

tsg commented Jan 12, 2016

It seems that the af_packet code from gopacket never puts the interface in promiscuous mode, which results in Packetbeat not seeing any packets when using mirror ports. The workaround is simple, make sure to run this command before starting packetbeat:

 ip link set enp5s0f1 promisc on

We should try to do the same programmatically from the af_packet code, so this is no longer required.

@dedemorton
Copy link
Contributor

If you decide not to do this programmatically, it would be a good candidate to mention in the FAQ tracked by #699

@andrewkroh
Copy link
Member

andrewkroh commented Feb 14, 2018

This one gets me every time I use af_packet. +1 on doing it programmatically within Packetbeat.

BTW this command works for me:

ifconfig eth0 promisc

@andrewkroh
Copy link
Member

My workaround for this issue was to have systemd put the interface into promisc before it starts the service and stop it afterwards.

ip a
mkdir -p /etc/systemd/system/packetbeat.service.d
cat << EOF >> /etc/systemd/system/packetbeat.service.d/local.conf
[Service]
ExecStartPre=/sbin/ip link set dev eth0 promisc on
ExecStopPost=/sbin/ip link set dev eth0 promisc off
EOF
systemctl daemon-reload
systemctl restart packetbeat
ip a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Packetbeat Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants