How to use libpcap in a Podman container?

51 Views Asked by At

I'm trying to run a program that depends on libpcap called masscan. I've installed libpcap both on the container and the host system. When I try to run masscan in the container, I'm getting this error:

[-] FAIL: failed to load libpcap shared library
    [hint]: you must install libpcap or WinPcap

I've tried running podman as root, no success. I've tried using host's network with net: "host" in my docker-compose.yml, the same happens.

Edit: I have solved the issue with libpcap not loading, turns out I had to install libpcap-dev too. With net host I have solved my issue too, turns out that podman-compose ignores net settings. Now when executing the container directly, I can get masscan to not complain about libpcap, but I still can't run a scan, due to this error:

[-] FAIL: permission denied
    [hint] need to sudo or run as root or something
[-] if:enp4s0:init: failed

It happens even if I run podman with root.

0

There are 0 best solutions below