This is the case. I learned how to install a virtual system in virtualbox in cenots. After each installation, you will find that you cannot access frequently used ports such as 80, 21, and 3306. That is to say, I can only access these ports on the local machine and want to access the ports from other machines is not OK. It took me a whole week to know that it was a port problem. You must record it today so that you do not forget it again next time.
Enable ports 80, 21, and 3306:
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT/etc/init.d/iptables save service iptables restart
Actually, I read an article I wrote earlier. This article is redundant. Alas. Now that it is written. Write it completely.
In general, we will not use the built-in firewall of Linux. In IDCs, firewalls are hardware. It must be much more powerful than software.
You can use the following methods to operate the Firewall:
Permanently disable the firewall shell:
chkconfig --level 35 iptables off
Run the following command to check whether the firewall is disabled:
service iptables status
If it is disabled correctly, the following information is output:
Iptables: no firewall is running.
If you are an English version, the information may be different.
If no firewall-like information is output, restart the system or run the following command to try it:
service iptables stop
After the firewall is turned off, all enabled ports will be exposed to Internet users. Then, someone with ulterior motives may make some damage to your system vulnerabilities.
In addition to this, there is another things like SELinux. If the firewall has opened the port, it cannot be accessed. It indicates that this item has been restricted. You can just close it.