Archive for the ‘Kernel’ Category

Basic kernel related commands

Wednesday, August 12th, 2009

depmod -a :
it will add new module automaticaly
modprobe drivername:
it will add that specifiq driver
Preventing “ping of death” :
cat /proc/sys/net/ipv4/tcp_syncookies , output should be 1
to show the installed kernel module
/lib/modules/kernel_virson/Directory :
here all kernel modules are stored
modprobe -r modulename :
will remove that module

Kernel Tuning: Kernel Runtime Parameters
Several kernel features, such as IP forwarding or the maximum number of files, can be
turned on or off without compiling and installing a new kernel or module. These tunable
parameters are controlled by the files in /proc/sys directory. Parameters that you set are made
in the /etc/sysctl.conf file. You use the sysctl command directly. The -p option causes
sysctl to read parameters from the /etc/sysctl.conf file (you can specify a different file). You
can use the -w option to change specific parameters. You reference a parameter with its key.
A key is the parameter name prefixed with its proc system categories (directories), such as
net.ipv4.ip_forward for the ip_forward parameter located in /proc/sys/net/ipv4/. To
display the value of a particular parameter, just use its key. The -a option lists all available
changeable parameters. In the next example, the user changes the domain name parameter,
referencing it with the kernel.domainname key (the domainname command also sets the
kernel.domainname parameter):
# sysctl -w kernel.domainname=””
The following example turns on IP forwarding:
# sysctl -w net.ipv4.ip_forward=1
If you use just the key, you display the parameter’s current value:
# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1