List of Loaded iptables Modules

Emre Yazici picture Emre Yazici · Jan 7, 2010 · Viewed 46.1k times · Source

Is there any convenient way to show loaded iptables module list? I can show installed modules by listing /lib/iptables/ (or /lib64/iptables/) directory but I need active module list.

Answer

Emre Yazici picture Emre Yazici · Jan 15, 2010

Loaded iptables modules can be found in /proc/net/ip_tables_matches proc filesystem entry.

cat /proc/net/ip_tables_matches

In PHP I can access the loaded iptables modules by loading and exploding file contents:

$content = file_get_contents('/proc/net/ip_tables_matches');
$modules = explode("\n", $content);

Of course it requires proc filesystem to be mounted (Most GNU Linux distros mount it by default)