firewall-cmd remove port 1

firewall-cmd remove port

# [sudo] firewall-cmd [--zone=zone_name] --permanent --remove-port=/tcp 
$firewall-cmd --zone=public --permanent --remove-port=3306/tcp 
$firewall-cmd --reload 

Here is what the above code is Doing:
1. We’re using the firewall-cmd command to open port 3306.
2. We’re using the –zone=public option to specify that we want to open port 3306 in the public zone.
3. We’re using the –permanent option to make the change permanent.
4. We’re using the –add-port=3306/tcp option to specify that we want to open TCP port 3306.
5. We’re using the –reload option to reload the firewall and make the change take effect.

Similar Posts