Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of loaded iptables modules

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 modules list.

like image 575
Emre Yazici Avatar asked Jan 07 '10 20:01

Emre Yazici


2 Answers

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)

like image 167
Emre Yazici Avatar answered Sep 19 '22 04:09

Emre Yazici


This is a really old post but here we go:

# lsmod | grep ip

shows a list of loaded modules, which I think most are related to iptables... /proc/net/ip_tables_matches doesn't show modules (at least not in RHEL 6)

like image 34
Gonio Avatar answered Sep 19 '22 04:09

Gonio