LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-10-2014, 08:02 AM   #1
ikbendegoeiste
LQ Newbie
 
Registered: Jan 2014
Location: Netherlands
Distribution: Debian, Ubuntu, CentOS
Posts: 2

Rep: Reputation: Disabled
block a kernel module to be loaded


Hi All,

I have a loadbalancer with keepalived, which handles a lot of connections. That is why I use a stateless firewall (no connection tracking).

Everything goes well, but by accident I gave the command 'iptables -L -t nat'. Now the modules nf_nat, iptable_nat, nf_conntrack and nf_conntrack_ipv4 were loaded. I didn't see this, so the loadbalancer suffered high load and nodes were removed from the loadbalancer.

A google session came up with /etc/modprobe.d/blacklist.conf, which only prevents modules to be loaded at boot time. Also blacklisting the module in /etc/modprobe.d/nf_nat.conf, only prevents the module to be loaded during boottime.

This is not what I seek. I seek a solution which prevents a module to be loaded at all. Even if a command like 'iptables -L -t nat' is given.

Does anyone know a solution?

---
Enrico
 
Old 01-10-2014, 10:33 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Have you tried something like

install <problem-module> /bin/true (= instead of installing x, do this).

In /etc/modprobe.d somewhere? That should exit quietly when the install is called for and certainly not install the thing.
 
Old 01-14-2014, 03:09 AM   #3
ikbendegoeiste
LQ Newbie
 
Registered: Jan 2014
Location: Netherlands
Distribution: Debian, Ubuntu, CentOS
Posts: 2

Original Poster
Rep: Reputation: Disabled
This worked! Thanks!

I've created the file /etc/modprobe.d/connectiontracking.conf with the following content:
install nf_conntrack /bin/true
install nf_conntrack_ipv4 /bin/true
install nf_nat /bin/true
install iptable_nat /bin/true
iptables -L -t nat
iptables v1.4.8: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 
Old 01-15-2014, 02:39 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I doubt if insmod will do it, or modprobe. You can't have them until you change modprobe.d/whatever
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Show options that kernel module was loaded with? fmyhr Linux - General 7 01-29-2009 08:28 AM
Truecrypt: Kernel module not loaded Synatic Linux - Software 4 01-21-2006 02:43 PM
the kernel module for tv support could not be loaded ylts SUSE / openSUSE 3 04-15-2005 08:14 AM
Module loaded into kernel at Boot Wolf_Assassin Linux - Software 11 08-11-2004 05:57 PM
kernel: No module symbols loaded - kernel modules not enabled. Qucho Debian 9 05-26-2004 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration