Untested. Probably through firewalld’s firewall-cmd
with --remove-port
option similarly to the ones here:
From TL;DR man examples:
- View the available firewall zones:
firewall-cmd --get-active-zones
- View the rules which are currently applied (always wise to know “default” rules before changes):
firewall-cmd --list-all
- Permanently open two arbitrary ports in the specified zone:
firewall-cmd --permanent --zone=public --add-port=25565/tcp --add-port=19132/udp
- Reload firewalld to force rule changes to take effect:
firewall-cmd --reload