English Spanish
List all allowed ports:
This command will only give you a list of ports that have been opened as ports. You will not be able to see any open ports that have been opened as a service. Therefore, you should consider using the --list-all option instead of --list-ports.
Remove the port from the allowed ports to close it for the incoming traffic:
$ sudo firewall-cmd --remove-port=port-number/port-type
$ firewall-cmd --list-ports
$ firewall-cmd --list-ports
$ sudo firewall-cmd --runtime-to-permanent
$ sudo firewall-cmd --runtime-to-permanent
Closing a port Cerrando un puerto
Closing a port using the command line Cerrando un puerto usando la línea de comandos
When an open port is no longer needed, close that port in firewalld. It is highly recommended to close all unnecessary ports as soon as they are not used because leaving a port open represents a security risk. Cuando ya no es necesario un puerto abierto, cierre ese puerto en firewalld. Es altamente recomendable cerrar todos los puertos innecesarios tan pronto como dejen de usarse puesto que dejar un puerto abierto representa un alto riesgo para la seguridad.
Make the new settings persistent: Hacer persistentes los nuevos ajustes:
To close a port, remove it from the list of allowed ports: Para cerrar un puerto, bórrelo de la lista de puertos permitidos: