Think before you speak, read before you think.

lsmod modinfo modprobe查看启用内核模块

by

in

lsmod为查看内核模块,查看的原文件是/proc/modules
modinfo后面跟上具体模块,可查看信息
modprobe可以添加或删除模块

查看有无bridge模块

# lsmod | grep bridge
bridge 79078 0
stp 2218 1 bridge
llc 5546 2 bridge,stp

查看具体bridge模块的信息

modinfo bridge
filename: /lib/modules/2.6.32-358.el6.x86_64/kernel/net/bridge/bridge.ko
version: 2.3
license: GPL
srcversion: 10C5CB47F80758600F32F24
depends: stp,llc
vermagic: 2.6.32-358.el6.x86_64 SMP mod_unload modversions

有时连接 pptp vpn 连接不上是由于没有加载 ip_gre 引起的
加载 ip_gre

/sbin/modprobe ip_gre >/dev/null 2>&1

开机启动自动加载模块

cat /etc/sysconfig/modules/ip_gre.modules
/sbin/modprobe ip_gre >/dev/null 2>&1

需要有执行权限

chmod +x ip_gre.modules

Comments

One response to “lsmod modinfo modprobe查看启用内核模块”

  1. […] 如果发现连不上,还需要启用 ip_gre 模块。参见这里。 […]

Leave a Reply

Your email address will not be published. Required fields are marked *