Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It's Debian 6.0 setup, I used to have the ip manually set to 192.168.7.50 but now I have a new server with that IP I want to just copy some stuff over through the network but now I can't seem to get it to play nicely on the network, all over network access is fine but 192.168.7.50 always reroutes to itself.

I've set up my config as so in /etc/network/interfaces

auto lo eth0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

performing a ping produces:

ping 192.168.7.50
PING 192.168.7.50 (192.168.7.50) 56(84) bytes of data.
From 192.168.7.100 icmp_seq=1 Destination Host Unreachable
From 192.168.7.100 icmp_seq=2 Destination Host Unreachable
From 192.168.7.100 icmp_seq=3 Destination Host Unreachable
From 192.168.7.100 icmp_seq=4 Destination Host Unreachable
From 192.168.7.100 icmp_seq=5 Destination Host Unreachable
From 192.168.7.100 icmp_seq=6 Destination Host Unreachable

Do I need to clear a cache somewhere which is causing the forwarding? What other things can I do to diagnose the problem?

share|improve this question
    
not sure but check the command: route If you need you can reset yours. –  vfbsilva Sep 2 '13 at 18:12
add comment

2 Answers

up vote 1 down vote accepted

Since your system appears to have gotten an IP address successfully from the DHCP server (192.168.7.50), this would appear to be a routing issue. As @ash has suggested try the command:

$ netstat -rn

This command is synonymous with the other suggestion route -n. Either command will produce output similar to this:

route

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0

netstat

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
0.0.0.0         192.168.1.254   0.0.0.0         UG        0 0          0 wlan0

The line that's the interesting one is the line that has the UG in its Flags column. This is your systems default gateway. This is the default destination for any IP packets that don't have an explicit match to any network definitions (the 1st column).

In your case you're probably going to have lines similar to mine above, except the IPs will be different. Your network address will be 192.168.7.0.

If this all looks OK then make sure that you can ping your default route first. Sometimes systems have firewall configured such that they won't respond to ping packets (ICMP packets).

The other thing to try would be a traceroute:

$ traceroute 192.168.1.254
traceroute to 192.168.1.254 (192.168.1.254), 30 hops max, 60 byte packets
 1  router1.bubba.net (192.168.1.254)  1.399 ms  1.586 ms  1.904 ms

This will show you the path a packet would take to get from you to a destination.

share|improve this answer
    
@Sly - what was the eventual issue? –  slm Sep 2 '13 at 21:40
add comment

There is nothing in that output that shows any type of forwarding. What that output shows is that the server does not know how to reach the IP address 192.168.7.100.

To diagnose the "Destination Host Unreachable" error, check the network routing:

netstat -rn

Take off the -n if you want network IP address to translate back to server names.

Look for an entry that has a mask and destination such that, when 192.168.7.100 has the mask applied (bitwise anded), the destination value is matched. For example:

Destination   Mask
192.168.7.0   255.255.255.0

This would match since 192.16.7.100 masked with 255.255.255.0 gives 192.168.7.0.

share|improve this answer
    
Sorry to be clear, the Server i'm using used to have a fixed IP address of 192.168.7.50 but now has a DHCP assigned address of 192.168.7.100 and can ping all over network addresses except 192.168.7.50 –  Sly Sep 2 '13 at 21:31
    
Even so, the routing table holds the key to your problem, if I'm reading this right. The host is not reachable comes from routing. There could be an interaction with something else on the network (such as a router) that leads to that error as well, but that seems unlikely based on the description given. –  ash Sep 2 '13 at 21:35
    
Posting the routing table (output of netstat -rn) will help us to answer. –  ash Sep 2 '13 at 21:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.