I am doing some research to figure out what distro's of linux contain kernel packet filtering and are compatible with BPF.



These two articles lead me to believe there is a package somewhere taht includes the libraries, and binaries?

I am specifically looking for the "pfctl" command like I have in FreeBSD



I think you have mixed two different things:

  1. The OpenBSD packet filter facilities (sometimes called pf, and mostly controlled by pfctl). These are the basis of OpenBSD firewalling, the Linux equivalent is netfilter, mostly controlled by the iptables command. Comparable, but not compatible (and most say that OpenBSD is superior to Linux in this aspect).

  2. The (Berkeley) packet filter (mostly controlled by the libpcap library). This is a feature of the kernel that allows an application to be notified of packets flowing through a network interface. Since usually any client is only interested in a subset of all packets, most of the library is about filtering which packets should be forwarded to the application and which shouldn't. It's used for network analyzers like tcpdump and Wireshark.

The articles you link are not about a port of the OpenBSD pf, instead they describe a new JIT that optimizes the kernel-resident filters used by libpcap.

| improve this answer | |
  • Thanks for the explanation. Does this essentially mean that any kind of network program must be explicitly ported between linux variations and BSD variations (FreeBSD in my case)? I guess the code I have looked at included some of the bpf headers, but the rules and such were set up with pfctl. I think the mix is what was confusing me. – Derek Jul 31 '12 at 0:55
  • 3
    There's a big gap between the firewall configuration utility and "Any kind of network program". Linux network programming interfaces are basically the same as BSD in most ways, including BPF (the one that has nothing to do with pfctl) – Alan Curry Jul 31 '12 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.