Iptables -F use this command to turn off the firewall, but before using this command, do remember to use iptables -L look at your system default target all chain, iptables -F This command only clears all the rules, but not really close iptables. imagine if your chain is the default target DROP, you have had some of the rules to allow a specific port, but once the application iptables -L, after clearing all the rules, the default target will prevent any access, including remote course your ssh management server.
So I suggest that the command is turn off the firewall
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
Followed by another check for some time
tried to open a firewall port number
iptables -I INPUT -p tcp --dport 9501 -j ACCEPT
Save Configuration (like me will not save the rule to restart the server after no more)
If your operating system is CentOS series:
service iptables save # save iptables rules
If your operating system is Ubuntu / Debian Series:
iptables-save> /etc/iptables.up.rules # save iptables rules
———————————————
Disclaimer: This article is the original article CSDN bloggers "zu_ge", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/zu_ge/article/details/79913432