Vsftp cannot be connected. The system prompts No route to host.
Cause: port 21 is not enabled for iptables
[Root @ localhost sysconfig] # iptables -- list
Chain INPUT (policy ACCEPT)
Target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere
Chain FORWARD (policy ACCEPT)
Target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere
Chain OUTPUT (policy ACCEPT)
Target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
Target prot opt source destination
ACCEPT all -- anywhere
ACCEPT icmp -- anywhere icmp any
ACCEPT esp -- anywhere
ACCEPT ah -- anywhere
ACCEPT udp -- anywhere 224.0.0.20.udp dpt: mdns
ACCEPT udp -- anywhere udp dpt: ipp
ACCEPT tcp -- anywhere tcp dpt: ipp
ACCEPT all -- anywhere state RELATED, ESTABLISHED
ACCEPT tcp -- anywhere state NEW tcp dpt: ssh
REJECT all -- anywhere reject-with icmp-host-prohibited
From the above iptables, we can see that the system has not opened port 21.
Solution: Modify iptables and open port 21.
Add the following statement to/etc/sysconfig/iptables-config:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 21-j ACCEPT
Restart iptables: service iptables restart.
Solve the problem!
This article is from the "leom_lee" blog