Linux open port access is accessed by the outside

Basic use of firewalld

Basic command

Start: systemctl start firewalld

Auto-start at boot: systemctl enable firewalld

停止:systemctl disable firewalld

Disable: systemctl stop firewalld

Add a port that needs to be opened:
firewall-cmd --zone=public --add-port=9333/tcp --permanent (–permanent takes effect permanently, and it becomes invalid after restart without this parameter)

Reload to make the port take effect:
firewall-cmd --reload

Remove port:
firewall-cmd --zone=public --remove-port=9333/tcp --permanent

Check whether firewall is running:
systemctl status firewalld or firewall-cmd --state

Check which ports are opened: the xml file under /usr/lib/firewalld/services
Check which ports are opened command line: firewall-cmd --list-ports

Guess you like

Origin blog.csdn.net/qq_46970849/article/details/110423171