Turn on: chkconfig iptables on
Turn off: chkconfig iptables off
2) It takes effect immediately, and it will fail after restart.
Service mode
Turn on : service iptables start
Turn off: service iptables stop
Turn on the port number:
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT service iptables save service iptables restart
Related operations in man
ctrl + F or Page Down: page down
ctrl + B or Page Up: page up
gg to the first line
GG to the last line
/start: can search for start-related characters in the entire manual, use n Find the next, use N to find the previous
j, k is used as in vi, j goes down one line, k goes up one line
d turn down half page
u turn up half page
h get man use help
q to exit man
.
Centos 7 uses firewall firewall
firewall-cmd --query-port=8080/tcp firewall-cmd --add-port=9300/tcp firewall-cmd --remove-port=9998/udp --permanent
firewall-cmd --add-port=9998/udp --permanent
--permanent means that it will take effect permanently, and restart will not lose the configuration.