use ufw(Uncomplicated Firewall) on ubuntu.

Add ufw rules

ufw enable 80/tcp

Delete ufw rules

Check the existing UFW rules:

sudo ufw status numbered

Delete a specific UFW rule.

sudo ufw delete [rule_number]

NOTE: the ufw delete command does not support deleting multiple rules at once. You need to delete the rules one by one using the ufw delete command for each rule you want to remove.

Alternatively, you can also delete a rule by specifying the rule itself. For example, if the rule is allow 80, you can delete it using:

sudo ufw delete allow 80