LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-04-2008, 05:24 PM   #1
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
FTP server "No Route to Host"


Hi Soldiers,

I have just setup FTP sever. Its working well from the same Linux Box.
# ftp server1

works fine.

But when i tried it from another linux box its not working

# ftp server1
ftp: connect: no route to host
ftp>

Please help

Thanks
 
Old 08-04-2008, 05:28 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Can server2 ping server1 ?

No route to host means there is no routing table entry to get to the IP address of server1.

Last edited by Mr. C.; 08-04-2008 at 05:29 PM.
 
Old 08-04-2008, 06:31 PM   #3
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Original Poster
Rep: Reputation: 34
Hi Mr C

Thanks for help

Yes! Other computer is able to ping server1
as well as through IP

My two computer' are directly connected to internet through DSL Modem/Gateway/ provided by my ISP.

And both are configured to get IP automatically

so both have ip

Server1 (FTP server) 192.168.2.11
Linux box 192.168.2.10

Both ip are automatically provided.

when i tried to gave server1 (ftp server) a static ip , it was disconnected from the internet (showing no Connectivity) . please tell me
am i able to gave these computer a static ip

e.g. 192.168.0.254
192.168.0.01

while the gateway has ip address 192.168.2.1.

please reply

thanks for help
 
Old 08-04-2008, 06:38 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
If your DSL appliance provides IP addresses for you, and you have no access to its administrative pages, its best to let DHCP do its job. With only two computers connected, you could as static IPs, but technically, unless you know the range of IP addresses that the DHCP server owns, you can't assume they won't be used. Now, in practice, for your situation, you could us static IPs if everything seems to work OK. I cannot know what other restrictions that DSL appliance may impose on your network, so can't answer as to why your static IP configuration doesn't work. It could be that the DSL appliance only allows certain IP ranges (like .1 to .10). The only way to know is to try out different IP addresses within the range of host numbers allowed by your network mask.

You can't use 192.168.2.1, as that IS the IP address of the LAN interface of the DSL appliance. Try .2 and up.

Please show the output of :

ifconfig -a
netstat -rn

on both systems.
 
Old 08-04-2008, 08:20 PM   #5
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Original Poster
Rep: Reputation: 34
the out of the command is

#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0F:1F9:24:CA
inet addr:192.168.2.11 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20f:1fff:fed9:24ca/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:34061 errors:0 dropped:0 overruns:0 frame:0
TX packets:19551 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:45189359 (43.0 MiB) TX bytes:2028899 (1.9 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:3981 errors:0 dropped:0 overruns:0 frame:0
TX packets:3981 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:199403 (194.7 KiB) TX bytes:199403 (194.7 KiB)

pan0 Link encap:Ethernet HWaddr 7E:76:60:0D:50:01
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

the 2nd is as follows

[root@server1 ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

This for Server1 (ftp Server)


The out put for client is as follows

# ifocnfig -a
-bash: ifocnfig: command not found
[root@station1 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:5A:72:C5:3C
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::204:5aff:fe72:c53c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4361 errors:0 dropped:0 overruns:0 frame:0
TX packets:1223 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:425674 (415.6 KiB) TX bytes:68637 (67.0 KiB)
Interrupt:17 Base address:0xc00

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:1833 errors:0 dropped:0 overruns:0 frame:0
TX packets:1833 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:92312 (90.1 KiB) TX bytes:92312 (90.1 KiB)

pan0 Link encap:Ethernet HWaddr 5E:91:FB:E4:A8:7C
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

Thanks for help again

Last edited by KinnowGrower; 08-04-2008 at 08:28 PM.
 
Old 08-04-2008, 08:33 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
On the client, what is in /etc/hosts ?

We need to see what IP address "server1" translates to on the client. You have a route, so the No route to host only error only makes sense if the IP address lookup for server1 results in an IP on a different network.
 
Old 08-05-2008, 12:19 AM   #7
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Original Poster
Rep: Reputation: 34
Yes Mr C.

/etc/hosts do the name resolution correctly for server1.I tried

# ping server1

&

#ping 192.168.2.11

its working


I think its something wrong with iptables/firewalls

it may be protecting the ftp client. But i am not sure

How?

if u can explore please help

Thanks
 
Old 08-05-2008, 01:34 AM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
iptables -L
 
Old 08-05-2008, 03:31 AM   #9
hardcorelinux
Member
 
Registered: Jan 2005
Location: India
Distribution: RHEL,CentOS,SUSE,Solaris10
Posts: 183

Rep: Reputation: 31
Make sure port 20 and 21 is opened on your firewall. Try to stop firewall some time and try to connect, if it works firewall is blocking.
 
Old 08-05-2008, 10:47 AM   #10
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Original Poster
Rep: Reputation: 34
yes Soldiers

Finally i got it. It was the issue of firewalls

I have opend the ports through system-config-firewall.Now its working

Can you freinds, tell me how i can learn as well as practice these iptables/firewalls

Please reply

Thanks for help

Its great

Thanks again dear friends.
 
Old 08-05-2008, 10:38 PM   #11
hardcorelinux
Member
 
Registered: Jan 2005
Location: India
Distribution: RHEL,CentOS,SUSE,Solaris10
Posts: 183

Rep: Reputation: 31
Try following urls to know more about iptables



http://www.linuxsecurity.com/resourc...-tutorial.html

http://www.sns.ias.edu/~jns/wp/2006/...-does-it-work/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shorewall routing issue: "no route to host" from dmz spargonaut Linux - Networking 0 06-07-2007 10:09 AM
Ftp/ls "Connection timeout" - only on one host to one server pingu Linux - Networking 2 03-30-2007 04:24 AM
a/p connected, route correct, ping router: "Destination Host Unreachable". DebianEtch shinyblue Linux - Wireless Networking 1 08-29-2006 09:34 PM
could "no route to host" be caused by non-crossover cable? brandonweinberg Linux - Networking 13 01-31-2004 09:47 AM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration