Debian – How to reliable re-install nf_conntrack module after removal

debiankernel-modulesmodprobe

I want to remove the nf_conntrack module from debian. However I don't want to do this until I know how to get it back (if I have to), and currently am not confident about this. The steps another user took to remove the module are listed in this answer (step 4). Specifically:

sudo modprobe -r xt_NOTRACK nf_conntrack_netbios_ns nf_conntrack_ipv4 xt_state
sudo modprobe -r nf_conntrack

Can I just run the modprobe add commands (in reverse order) to get these back as it was? E.g. (updated based on wurtel's feedback):

sudo modprobe nf_conntrack
sudo modprobe xt_NOTRACK
sudo modprobe xt_state
sudo modprobe nf_conntrack_netbios_ns
sudo modprobe nf_conntrack_ipv4

Or are the other considerations I need to rake into account?

EDIT: Just to clarify I believe I've removed any IPTables rules that use these modules.

Best Answer

You can only safely remove these modules if they are not being used in any iptables rules.

Loading them again will happen automatically when needed (i.e. when loading iptables rules) so there's no need to load them manually. That said, you can't supply a list of modules to load to modprobe.

Related Topic