要恢复 CentOS 系统中的 iptables 到默认配置,你可以按照以下步骤操作:
sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -F
sudo iptables -X
sudo service iptables save
sudo systemctl restart iptables
现在,你的 CentOS 系统应该已经恢复到了 iptables 的默认配置。请注意,这将允许所有传入、传出和转发的网络流量,因此请确保在需要时重新配置适当的规则以保护你的系统。