FTP connect Error: No route to host [How to Solve]

Problem Description: the FTP client implemented by Java reports an error when it is connected to no route to host

Through the ping command to test the network, you can access

Through the Yun install – y FTP installation client test, it also returns no route to host

Turn off the server firewall, and the test can be accessed

The reason is said to be that IPtable doesn’t preset the part of NAT processing

solution:

1、

In the/etc/sysconfig/iptables config file

Change iptables_ Modules = “is iptables_ MODULES=”ip_ nat_ ftp ip_ conntrack_ ftp”

Restart iptables service

2、

Direct loading module

modprobe ip_ nat_ ftp
modprobe ip_ conntrack_ ftp

With the above settings, it doesn’t work

The modprobe – L | grep FTP command can not be used in CentOS 7 system, but lsmod | grep FTP is used instead

Finally, through modifying the firewall rules, the following two rules are added:

-I INPUT -s 10.50.0.6 -p tcp -m tcp –dport 21 -j ACCEPT
-I INPUT -s 10.50.0.6 -p tcp -m tcp –dport 20 -j ACCEPT

In the/etc/sysconfig/iptables file

Similar Posts: