Automatic loading of 802.1q modules in CentOS

Source: Internet
Author: User

To automatically load kernel modules in CentOS, you need to add a script in the/etc/sysconfig/modules/directory to load the required modules in this script.

Here is a script called 8021q.modules that I used to automatically load the 802.1Q module in my CentOS 5.3:

#! /bin/sh/sbin/modinfo-f filename 8021q >/dev/null 2>&1if [$?-eq 0]; Then    

The above script first checks to see if the 8021q module file exists and, if present, calls the /sbin/modprobe command to load the module.

Put this file in the /etc/sysconfig/modules/directory and add executable permissions to it. This way, the 802.1Q module will be loaded automatically the next time the system is restarted.

Some articles on the web suggest adding the modprobe command in the/etc/rc.local file, which may not work properly in some cases. Because/etc/rc.local executes the program in the RC.D directory at startup,if a program in RC.D uses the module it needs to load, an error occurs.

In addition, some articles refer to modifying the/etc/modprobe.conf file, which is actually wrong. This file simply defines the aliases of some kernel modules, as well as some special loading and unloading commands. Modifying this file does not allow the module to be loaded automatically at startup.

Automatic loading of 802.1q modules in CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.