What if centos 6.5 does not have a firewall file ?, Centos6.5
1. The general cause is that no firewall is configured and the firewall has been disabled when the CentOS system is installed.
In this way, the firewall cannot be started using the service iptables start statement.
2. Write an iptables command to configure a firewall rule: (execute this command anywhere)
Iptables-P OUTPUT ACCEPT
3. Save iptables changes
Service iptables save
4. Now you can see the/etc/sysconfig/iptables file.
5. Run vim/etc/sysconfig/iptables to open the file, add port 22 of ssh to it, and save
-A input-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT
6. Start the Firewall
Service iptables start
Note:
If you use SSH to connect and modify this configuration, add port 22 to start the firewall. Otherwise, the ssh connection may fail.
Write an iptables command to configure firewall rules:
Iptables-P OUTPUT ACCEPT