Red Hat Enterprise Linux  “Use CAP_NET_ADMIN and alias netdev-bondX instead” Message on Boot

Issue

Environment :

  • RHEL 6.2

  • kernel-2.6.32-220.el6

  • Bonding configuration

When load bonding driver in /etc/modprobe.d/bonding.conf on boot, the following message will be logged.

# cat /etc/modprobe.d/bonding.conf
alias bond0 bonding

kern: Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).
Use CAP_NET_ADMIN and alias netdev-bond0 instead

Solution

dev_load() of kernel-2.6.32-220.el6 is the below.

void dev_load(struct net *net, const char *name)
{

no_module = !dev;
if (no_module && capable(CAP_NET_ADMIN))
no_module = request_module(“netdev-%s”, name);
if (no_module && capable(CAP_SYS_MODULE)) {
if (!request_module(“%s”, name))
pr_err(“Loading kernel module for a network device “
“with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s “
“instead\n”, name);
}
}

Root which run /etc/rc.d/rc.sysinit has both CAP_SYS_MODULE and CAP_NET_ADMIN capability. If not use netdev-xxx alias, above message will be logged.

Though this message can be ignored, if use netdev-xxx alias in /etc/modprobe.d/bonding.conf , it will not be logged.

# cat /etc/modprobe.d/bonding.conf
alias netdev-bond0 bonding

source : http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c03244209

Comments are closed.