how to open specified port in linux


In the Linux operating system, you can use the firewall-cmd command line tool to open the specified port. After opening, other servers can connect to the port application specified by the device. This tutorial will teach you how to delete all containers at once

Command Line

Open port 3306

firewall-cmd --zone=public --add-port=3306/tcp --permanent

Parameter Description

--zoneUse this zone to set or query options, else default zone,Usable for options marked with
--add-portAdd the port.
--permanentSet an option permanently.

operation result


safety warning

If your service is on a public network, you should increase the security protection applied to the specified port after opening the specified port.


If you have any questions in use, you can leave a message below, or submit issuse on github ♥