REDHAT7 Firewall (firewall)
Start, stop firewall
# Systemctl Start\stop\restart\status Firewalld
Master configuration file:
/etc/firewalld/zones/public.xml
Firewall command:
Open service:
# Firewall-cmd--permanent--add-service=ssh
To close the service:
# Firewall-cmd--permanent--remove-service=ssh
View Open Services:
# Firewall-cmd--list-services
Open ports:
# Firewall-cmd--permanent--add-port=53/tcp
To close the port:
# Firewall-cmd--permanent--remove-port=53/tcp
To view open ports:
# Firewall-cmd--list-port
Port forwarding:
# Firewall-cmd--permanet--add-forward-port=port=81:proto=tcp:toport=80:toaddr=10.0.0.2
(Note: At this time others access 10.0.0.2 81 is access 80) (seemingly restart firewall after the forwarding is gone)
To cancel Port forwarding:
# Firewall-cmd--permanet--remove-forward-port=port=81:proto=tcp:toport=80:toaddr=10.0.0.2
To view port forwarding:
# Firewall-cmd--list-forward-port
Reload Firewall:
# Firewall-cmd--reload
Or
# Firewall-cmd--complete-reload (more thorough)
This article is from the "Linux" blog, so be sure to keep this source http://yangzhiming.blog.51cto.com/4849999/1722511
REDHAT7 Firewall (firewall)