Remove --add-forward-port rule in firewall-cmd

Some time ago I added below rule for local port forwarding

firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=3000

How can I remove this rule now?


Solution 1:

You can remove it just as it was added:

# firewall-cmd --permanent --remove-forward-port=port=80:proto=tcp:toport=3000
# firewall-cmd --reload

Solution 2:

Instead of reloading you can also change runtime settings and then make it permanent

# firewall-cmd --permanent --remove-forward-port=port=80:proto=tcp:toport=3000
# firewall-cmd --runtime-to-permanent