Ubuntu – Problem with ufw enable: libkmod: ERROR ../libkmod/libkmod.c

firewallufw

I am trying to enable ufw and this is the output:

root@p:~# ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
FATAL: Module nf_conntrack_ftp not found.
libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
FATAL: Module nf_nat_ftp not found.
libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
FATAL: Module nf_conntrack_netbios_ns not found.
iptables-restore: line 69 failed
iptables-restore: line 30 failed
ip6tables-restore: line 65 failed
sysctl: permission denied on key 'net.ipv4.tcp_sack'

Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/after.rules'
Problem running '/etc/ufw/before6.rules'

It's a fresh installation of an Ubuntu 13.04 64 bits, what is wrong?

Best Answer

I have found out that my issue was related to peculiarities of using Ubuntu in an OpenVZ environment.

I was able to "fix" the problem (I beleive) by following those two resources:

http://blog.kylemanna.com/linux/2013/04/26/ufw-vps/

http://blog.bodhizazen.com/linux/how-to-use-ufw-in-openvz-templates/

Related Question