0

I need to capture live packets from more than one interface using Live Capture module in Pyshark. cap=pyshark.LiveCpature(interface='eth0')

How can I add one more interface using Live Capture. Ex: I need to capture packets from interfaces eth0 and eth1.

Thanks in advance.

Dhia
  • 10,119
  • 11
  • 58
  • 69
Kranti Kumar
  • 325
  • 2
  • 6
  • 16

1 Answers1

4

There's no way to do that directly in the constructor at the moment in pyshark, but you can do:

cap = pyshark.LiveCapture()
cap.interfaces = ['eth0', 'eth1']

This should work. I've opened an issue in the pyshark repo to add this feature.

KimiNewt
  • 501
  • 3
  • 14