1

I have problem enabling ufw on startup, it works fine if I do:

sudo ufw enable. But after restart puf, I've to redo it.

I tried:

sudo /lib/ufw/ufw-init stop ; sudo /lib/ufw/ufw-init start

And received following errors:

WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module nf_conntrack_ftp not found.
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module nf_nat_ftp not found.
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module nf_conntrack_netbios_ns not found.
iptables-restore: line 69 failed
iptables-restore: line 30 failed
ip6tables-restore: line 65 failed

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

In file /etc/ufw/after.rules problem was COMMIT last line, so I went with trial and error and found original culprit:

-A ufw-after-input -m addrtype --dst-type BROADCAST -j ufw-skip-to-policy-input

Uncommented and it was removed from errors.

As for the rest I couldn't go through all of them as they contain allot of rules!

Any ideas how to fix startup problem?

1

As an alternative working solution on OpenVZ (since ufw works from command line but not on init due to modprobe, rsyslog, ipv6, and others) which doesn't require no-oping modprobe and other tweaks, one could enable ufw via /etc/rc.local.

In that case, use ufw --force enable to skip the warning prompt for yes/no .

You can also add your rules (e.g. ufw allow 22) before the enable command to make sure you're not locked out of your system in case the rules were lost or modified somehow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy