When setting up FTP server on Redhat 7 Linux box the following error message ftp: connect: No route to host may pop-up during FTP client session:
ftp server error client rhel7 ftp: connect: No route to host


230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (10,1,1,110,138,70).
ftp: connect: No route to host
ftp> 
The cause of the above error is a missing ip_conntrack_ftp kernel module. Quick fix solution is to load this module using modprobe:
# modprobe ip_conntrack_ftp
However, you will need to do this every time you reboot your RedHat server. Thus as a more permanent solution you can persistently load this module after each reboot by creating executable shell script within /etc/sysconfig/modules/ directory. Create file /etc/sysconfig/modules/iptables.modules with the following content:
#!/bin/sh
exec /sbin/modprobe ip_conntrack_ftp >/dev/null 2>&1
Once you save this file you also need to make it executable:
# chmod +x /etc/sysconfig/modules/iptables.modules
The above script will load the following modules after each reboot:
[root@rhel7 ~]# lsmod | grep ftp
nf_conntrack_ftp       18638  0 
nf_conntrack          101024  9 nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,ip6table_nat,nf_conntrack_ftp,iptable_nat,nf_conntrack_ipv4,nf_conntrack_ipv6
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: