Linux

The common order of the firewalld of Linux.

xmg · 7月24日 · 2020年

1. open a port(e.g. 1234)

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

2. Close a port(e.g. 1234)

firewall-cmd --zone=public --remove-port=1234/tcp --permanent

3. Make the change take effect at once

firewall-cmd --reload

4. list all the opened ports

firewall-cmd --zone=public --list-ports

5. show the state of firewalld

firewall-cmd --state

6. show the listening ports

netstat -lnpt

7. show the details of a progress(e.g. 1234)

ps 6832

8. kill a certain progress(e.g. 1234)

kill -9 6832

9. start/stop/enable autostart the firewalld

systemctl start firewalld
systemctl stop firewalld
systemctl enable firewalld
0 条回应