LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No route to host error while connecting to ftp server (https://www.linuxquestions.org/questions/linux-newbie-8/no-route-to-host-error-while-connecting-to-ftp-server-4175490515/)

praveen.amboji 01-08-2014 01:55 AM

No route to host error while connecting to ftp server
 
I have two virtual machines running in my virtualbox I have configured
ftp server on machine '1'
the ipaddress of the machine is 10.0.2.15
and the ip of the other machine is 10.0.2.16
i could ping from machine 1 to machine 2 but while connecting to the ftp server the error was "no route to host"
#################Detils of Machine2##################################

[root@ktcl5 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:C5:3B:06
inet addr:10.0.2.16 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fec5:3b06/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12340 errors:0 dropped:0 overruns:0 frame:0
TX packets:12294 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11892554 (11.3 MiB) TX bytes:2504123 (2.3 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:59 errors:0 dropped:0 overruns:0 frame:0
TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5102 (4.9 KiB) TX bytes:5102 (4.9 KiB)

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

[root@ktcl5 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 * 255.255.255.0 U 1 0 0 eth0
default 10.0.2.2 0.0.0.0 UG 0 0 0 eth0

pingu 01-08-2014 10:42 AM

Seems to me the firewall is not accepting connections on port 21 (ftp).
Add a rule before the INPUT reject rule to allow port 21 in.
To make it a bit easier, I suggest you change policy for INPUT to DROP. Then you can remove the "reject" rule and just add new allow rules without needing to bother about the order.


All times are GMT -5. The time now is 07:23 PM.