kernel module

Linux kernel module files are usually named <modulename.ko>

The kernel modules in centos7 are placed in /lib/modules/`uname -r`/

View loaded kernel modules

lsmod

The output information is the name of the module, the size of the memory occupied, and whether it is in use.

The third column is 0, the module can be uninstalled at any time

If it is not 0, you cannot execute modprobe to delete the module

Dynamically load modules:

modprobe ip_vs

Check if the module is loaded successfully:

lsmod | grep ip_vs

Dynamic unloading module information:

modrpobe -r ip_vs

View module information:

modinfo ip_vs

filename:       /lib/modules/3.10.0-514.el7.x86_64/kernel/net/netfilter/ipvs/ip_vs.ko
license:        GPL
rhelversion:    7.3
srcversion:     DCEE1A9F152ED56E5E6EF3C
depends:        nf_conntrack,libcrc32c
intree:         Y
vermagic:       3.10.0-514.el7.x86_64 SMP mod_unload modversions
signer:         CentOS Linux kernel signing key
sig_key:        D4:88:63:A7:C1:6F:CC:27:41:23:E6:29:8F:74:F0:57:AF:19:FC:54
sig_hashalgo:   sha256
parm:           conn_tab_bits:Set connections' hash size (int)

The above is only valid at present, it will not take effect after the computer restarts

For automatic mounting, write the command to /etc/rc.d/rc.local

echo  "modprobe ip_vs" >> /etc/rc.d/rc.local

Remove this command when the kernel module is not needed, but requires a reboot.

modprobe -r ip_vs removes the kernel module

Permanently adjust kernel parameters

vim /etc/sysctl.conf

net.ipv4.ip_forward = 1

net.ipv4.icmp_echo_ignore_all = 1

fs.file-max = 108248

sysctl -p

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325375464&siteId=291194637
Recommended