CentOS 7.0 uses firewall as the firewall by default
View firewall status
firewall-cmd --state
start firewall
systemctl start firewalld.service
stop firewall
systemctl stop firewalld.service
Prohibit firewall from booting
systemctl disable firewalld.service
restart firewall
systemctl restart firewalld.service
reload configuration;
firewall-cmd –reload
To expose the port, enter the command:
firewall-cmd --zone=public --add-port=8080/tcp --permanent
–zone=public: Indicates that the scope is public;
–add-port=8080/tcp: Add port 8080 of the tcp protocol;
–permanent: Take effect permanently, if there is no such parameter, it can only be maintained within the current service life cycle, restart Failed after startup;
Check open ports
firewall-cmd --zone=public --list-ports
View port usage
netstat -lntp | grep 3355