Though I have gone through quite a few threads on AskUbuntu (1, 2, 3), and elsewhere, I'm little confuse on how to proceed.
I'd like to completely remove ufw, delete all iptables chains and rules, for a fresh start with nftables firewall in Ubuntu MATE 19.04
If I understand correctly (from the threads I have linked), I need to run the following:
sudo systemctl reset ufw
sudo systemctl disable ufw
sudo apt purge ufw gufw
sudo iptables -F
sudo iptables -Z
Then ?
for i in `iptables -L INPUT --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D INPUT $i ; done
for i in `iptables -L FORWARD --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D FORWARD $i ; done
for i in `iptables -L OUTPUT --line-numbers |grep '[0-9].*ufw' | cut -f 1 -d ' ' | sort -r `; do iptables -D OUTPUT $i ; done
for i in `iptables -L | grep 'Chain .*ufw' | cut -d ' ' -f 2`; do iptables -X $i ; done
The questions I have are:
(1) How do I "disable or deactivate" iptables so it doesn't interfere with Nftables firewall later on.
(2) In addition to removing ufw, should I remove iptables too:
sudo apt remove --auto-remove iptables
(3) Then proceed with installing and configuring nftables, is this the correct order?