Took an interest in WSL2. It was my way of gettin into Linux and messed around for a while until I decided to install Nginx and allow it in ufw. When I enabled it with :
sudo ufw enable It responded with :
ERROR: problem running ufw-initiptables-restore v1.8.4 (legacy): Couldn't load match `limit':No such file or directoryError occurred at line: 63Try `iptables-restore -h' or 'iptables-restore --help' for more information.iptables-restore v1.8.4 (legacy): Couldn't load match `limit':No such file or directoryError occurred at line: 21Try `iptables-restore -h' or 'iptables-restore --help' for more information.Problem running '/etc/ufw/before.rules'Problem running '/etc/ufw/user.rules'So, I've been tried a bunch of things. First of all, restart the service, then reseting ufw, removing and reinstalling. At some point, I decided to switch to Ubuntu 18.04 instead of 20.04 got an error pretty similar.
ERROR: problem running ufw-initmodprobe: FATAL: Module nf_conntrack_ftp not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2modprobe: FATAL: Module nf_nat_ftp not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2modprobe: FATAL: Module nf_conntrack_netbios_ns not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2iptables-restore: line 75 failediptables-restore: line 27 failedip6tables-restore: line 27 failedProblem running '/etc/ufw/before.rules'Problem running '/etc/ufw/user.rules'Problem running '/etc/ufw/user6.rules'I went to the files to comment the line and with some success, could get ride of the two first errors but not the last. I added a rule for Windows Firewall, tried to use the Debian distro, which returned me something way worst than the two first.
ERROR: problem running ufw-initmodprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.72-microsoft-standard-WSL2/modules.dep.bin'modprobe: FATAL: Module nf_conntrack_ftp not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.72-microsoft-standard-WSL2/modules.dep.bin'modprobe: FATAL: Module nf_nat_ftp not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.72-microsoft-standard-WSL2/modules.dep.bin'modprobe: FATAL: Module nf_conntrack_netbios_ns not found in directory /lib/modules/5.4.72-microsoft-standard-WSL2iptables-restore v1.8.2 (nf_tables):line 22: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 23: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 24: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 25: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 26: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 27: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 29: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 30: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 31: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 32: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 33: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 34: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 36: RULE_APPEND failed (No such file or directory): rule in chain FORWARDline 41: RULEiptables-restore v1.8.2 (nf_tables): Couldn't load match `conntrack':No such file or directoryError occurred at line: 2Try `iptables-restore -h' or 'iptables-restore --help' for more information.iptables-restore v1.8.2 (nf_tables):line 5: RULE_APPEND failed (No such file or directory): rule in chain ufw-skip-to-policy-inputline 6: RULE_APPEND failed (No such file or directory): rule in chain ufw-skip-to-policy-outputline 7: RULE_APPEND failed (No such file or directory): rule in chain ufw-skip-to-policy-forwardiptables-restore v1.8.2 (nf_tables): Couldn't load match `conntrack':No such file or directoryError occurred at line: 25Try `iptables-restore -h' or 'iptables-restore --help' for more information.iptables-restore v1.8.2 (nf_tables): unknown option "--dport"Error occurred at line: 19Try `iptables-restore -h' or 'iptables-restore --help' for more information.iptables-restore v1.8.2 (nf_tables): unknown option "--log-prefix"Error occurred at line: 21Try `iptables-restore -h' or 'iptables-restore --help' for more information.iptables-restore v1.8.2 (nf_tables): Chain 'ufw-before-input' does not existip6tables-restore v1.8.2 (nf_tables):line 22: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 23: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 24: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 25: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 26: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 27: RULE_APPEND failed (No such file or directory): rule in chain INPUTline 29: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 30: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 31: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 32: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 33: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 34: RULE_APPEND failed (No such file or directory): rule in chain OUTPUTline 36: RULE_APPEND failed (No such file or directory): rule in chain FORWARDline 41: RULEip6tables-restore v1.8.2 (nf_tables): Couldn't load match `conntrack':No such file or directoryError occurred at line: 2Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.ip6tables-restore v1.8.2 (nf_tables):line 5: RULE_APPEND failed (No such file or directory): rule in chain ufw6-skip-to-policy-inputline 6: RULE_APPEND failed (No such file or directory): rule in chain ufw6-skip-to-policy-outputline 7: RULE_APPEND failed (No such file or directory): rule in chain ufw6-skip-to-policy-forwardip6tables-restore v1.8.2 (nf_tables): Couldn't load match `rt':No such file or directoryError occurred at line: 24Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.ip6tables-restore v1.8.2 (nf_tables): unknown option "--dport"Error occurred at line: 19Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.ip6tables-restore v1.8.2 (nf_tables): unknown option "--log-prefix"Error occurred at line: 21Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.ip6tables-restore v1.8.2 (nf_tables): Chain 'ufw6-before-input' does not existProblem running '/etc/ufw/before.rules'Problem running '/etc/ufw/after.rules'Problem running '/etc/ufw/user.rules'Problem running '/etc/ufw/before6.rules'Problem running '/etc/ufw/after6.rules'Problem running '/etc/ufw/user6.rules'So, I'm taking a wild guess and imagine that the problem come from Windows itself instead of WSL2 but I didn't found anything on the web that could help me. Some here I am.
Does someone know anything to help me, please ?Thanks.