Linux System Administration – Part 3
How to monitor the loaded kernel modules A Linux system administrator may be required to watching the loaded kernel modules. The command that help to achieve this is “lsmod”. Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ /sbin/lsmod Module Size Used by ctr 16384 1 ccm 20480 1 ipt_MASQUERADE 16384 3 nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE iptable_nat 16384 1 nf_nat_ipv4 16384 1 iptable_nat nf_nat 24576 2 nf_nat_ipv4,nf_nat_masquerade_ipv4 nf_conntrack_ipv4 16384 2 nf_defrag_ipv4 16384 1 nf_conntrack_ipv4 xt_conntrack 16384 1 nf_conntrack 106496 5 nf_nat,nf_nat_ipv4,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4 ipt_REJECT 16384 2 nf_reject_ipv4 16384 1 ipt_REJECT xt_CHECKSUM 16384 1 iptable_mangle 16384 1 xt_tcpudp 16384 6 bridge 110592 0 stp 16384 1 bridge llc 16384 2 stp,bridge ip6table_filter 16384 0 ip6_tables 28672 1 ip6table_filter iptable_filter 16384 1 |
Another way to list all currently loaded kernel modules is to use “cat /proc/modules”. Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ cat /proc/modules ctr 16384 1 - Live 0x0000000000000000 ccm 20480 1 - Live 0x0000000000000000 ipt_MASQUERADE 16384 3 - Live 0x0000000000000000 nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE, Live 0x0000000000000000 iptable_nat 16384 1 - Live 0x0000000000000000 nf_nat_ipv4 16384 1 iptable_nat, Live 0x0000000000000000 nf_nat 24576 2 nf_nat_masquerade_ipv4,nf_nat_ipv4, Live 0x0000000000000000 nf_conntrack_ipv4 16384 2 - Live 0x0000000000000000 nf_defrag_ipv4 16384 1 nf_conntrack_ipv4, Live 0x0000000000000000 xt_conntrack 16384 1 - Live 0x0000000000000000 nf_conntrack 106496 5 nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat,nf_conntrack_ipv4,xt_conntrack, Live 0x0000000000000000 ipt_REJECT 16384 2 - Live 0x0000000000000000 nf_reject_ipv4 16384 1 ipt_REJECT, Live 0x0000000000000000 xt_CHECKSUM 16384 1 - Live 0x0000000000000000 iptable_mangle 16384 1 - Live 0x0000000000000000 xt_tcpudp 16384 6 - Live 0x0000000000000000 bridge 110592 0 - Live 0x0000000000000000 stp 16384 1 bridge, Live 0x0000000000000000 llc 16384 2 bridge,stp, Live 0x0000000000000000 ip6table_filter 16384 0 - Live 0x0000000000000000 ip6_tables 28672 1 ip6table_filter, Live 0x0000000000000000 iptable_filter 16384 1 - Live 0x0000000000000000 ip_tables 28672 3 iptable_nat,iptable_mangle,iptable_filter, Live 0x0000000000000000 |
Getting information about files The “ls …