After iptables is set, ftp cannot be accessed normally. solution:
Source: Internet
Author: User
After iptables is set, ftp cannot be accessed normally. the solution sets iptables to prohibit all ports. only after the policy is accessed, ftp cannot be accessed normally in most cases, because ftp has two active and passive connection modes, a problem occurs if you add less policies. Here I believe that the solution is: first load: # set IptablesAfter that, the ftp solution cannot be accessed normally. IptablesOnly allow access to the policy. In most cases, ftp
The problem of access failure occurs because ftp has two active and passive connection modes. if you add less policies, the problem may occur.
Here I believe that the solution is as follows:
First load:
# Modprobe ip_conntrack_ftp
# Modprobe ip_nat_ftp
Then load the policy
# Iptables-a output-m state -- state RELATED, ESTABLISHED-jACCEPT
# Iptables-a input-m state -- state RELATED, ESTABLISHED-jACCEPT
# Iptables-I INPUT-p tcp -- dport 21-j ACCEPT
# Iptables-I OUTPUT-p tcp -- dport 21-j ACCEPT
If you do not want to load the module every time, add it in/etc/sysconfig/iptables-config.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service