Route command hangs

Whenever I type route or netstat -r the command hangs when it should display my default gateway.  What is causing this problem.  RH 6.0 kernel 2.2.15.

Also if I try to ftp 192.168.1.8 the connection is closed by host but if I telnet 192.168.1.8 (address of the linux machine) and I wait about 3-5 minutes I will eventually get a connection and the speed is normal.

Thanks,
Scott.
wat0075Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Barn_OwlCommented:
Are your network address supposed to be? Try remove in the the default gateway then run route. Is your gateway machine IP resolved in the /etc/hosts file? Route attempts to resolve all ip address it encounters to ip names. This often cuases problem with gateways and Diald's slip addresses.
0
shane_painterCommented:
Generally this behavior is due to incorrect routing tables, ...however in your case you cannot see it. Try issuing the command 'netstat -rn' this should show you the routing tables and help us solve your problem. Also please include the output from the 'ifconfig' command.
0
wat0075Author Commented:
Here is all I could think of to include

[root@linux /root]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:97:30:D6:12  
          inet addr:192.168.1.8  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:298 errors:0 dropped:0 overruns:0 frame:0
          TX packets:211 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:10 Base address:0x300

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0


[root@linux /root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.8     *               255.255.255.255 UH    0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo

CONTROL C to get out of this

[root@linux /root]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.8     0.0.0.0         255.255.255.255 UH        0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.1.254   0.0.0.0         UG        0 0          0 eth0

[root@linux /root]# cat /etc/hosts
127.0.0.1       localhost       localhost.localdomain
192.168.1.8     linux.orion     linux

[root@linux /root]# cat /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4="no"
HOSTNAME="linux.orion"
DOMAINNAME=orion
GATEWAY="192.168.1.254"
GATEWAYDEV="eth0"

[root@linux /root]# cat /etc/hosts.allow
#
# hosts.allow   This file describes the names of the hosts which are
#               allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.
#
all:all

[root@linux /root]# echo $HOSTNAME
linux.orion
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

j2Commented:
This is because you do not have a working DNS. Unless you are connected to your ISP, or have a local DNS, or a correct /etc/hosts this will happen.

route -n tells route to "do not lookup the hosts in the DNS, just give me the numerics"

So in your case, adding .1.254 to /etc/hosts would (should :) ) fix the problem.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Barn_OwlCommented:
Exactly what we needed. j2 I think has the right of it.
0
Barn_OwlCommented:
And make sure you have the ftpd running on the target machine.
0
wat0075Author Commented:
What puzzels me is that I had this working before.  I decided to do a fresh install of red hat and wham networking no longer worked like it use to.  I know I never had an entry like you porposed in my /etc/hosts file and I have never set up Bind (or a DNS server).

I will try your proposed solution when I get home tonight but why do I need a default gateway anyway?  I just want to connect two computers together on my local lan.  One windows pc, one linux with a hub.

I thought it might have to do with my domain name and the name I had as a workgroup defined on my windows PC.  Could that not cause this problem as well.

I would also like to appologize to shane.  I didn't realize I could post a comment without not rejecting his answer.

Thanks,
Scott.
0
Barn_OwlCommented:
The default Gateway is not required but as you have one installed it does have to be accounted for.
0
wat0075Author Commented:
Ok my route command comes back right away but I am still getting the following error when I try to ftp to myself.  Secondly, I don't understand why I need this entry now.  My box was working fine before and I didn't have that extra entry and the route command didn't hang.

[root@linux /etc]# ftp 192.168.1.8
Connected to 192.168.1.8.
421 Service not available, remote server has closed connection
ftp> bye

[root@linux /etc]# ftp localhost
Connected to localhost.
421 Service not available, remote server has closed connection
ftp> bye
0
Barn_OwlCommented:
Looks  like you do not have the ftpd daemon running on the 192.168.1.8 box.
0
j2Commented:
1. Ftpd isnt running (check inetd.conf)
2. You have used ftpshut (delete /etc/shutmsg)
3. You have firewalling rules preventing access

Does "ftp localhost" from the server itself work?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.