Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two networks: 192.168.13.0/24 (blue) and 192.168.15.0/24 (green).
Computer A is connected to the 13-net, only. Computer B has two interfaces, one in each network.
There is third computer that acts like a router and connects the 13-net to the 15-net (only in this direction).

alt text

Now, I'd like to ping 192.168.15.100 from computer A to B. Unfortunately there is never a reply. But when I use a hub instead of a switch it works.

In my opinion the ping packet travels through the switch to the router (which is the default route/gateway for A). The router sends the packet back to the switch to B. Probably B receives it on its 15-net interface but answers with it's 15th interface? Is this possible?
The problem is, that B may have only a gateway 192.168.13.50 - but I am not really sure of it (B is a embedded system with limited configuration possibilities).

Can anyone explain what happens here? Thank you!

share|improve this question
    
why don't you ping the 13.100 from A ? –  silviud Dec 22 '10 at 16:48
    
@Silviud: unfortunately there are some services bound (hardcoded) to the 15-net. We would like to avoid recompiling the services and instead use a hardware/routing solution. The ping command only represents these services. –  tanascius Dec 22 '10 at 17:11
    
What sort of machine is the router? If it's running Linux, is net.ipv4.ip_forward=1 enabled in sysctl.conf? –  Gerald Combs Dec 22 '10 at 17:44

3 Answers 3

In both cases the ping starts by an arp requests to get the MAC address of the router. Then the ping message is wrapped in a layer 2 packet with the router for destination.

What happens When you use a hub:

  • the ping is broadcasted to all clients (B x 2 and the router),
  • the B.13.100 interface drops the packet,
  • but its 15.100 interface gets it, being probably in promiscuous mode (ignoring the MAC target),
  • thus B replies directly to A on its 13.100 interface.

Using a switch,

  • B does not get the packet directly. The switch knows that the A packet is directed to the router (thanks to its destination MAC address) and does not involve the other ports.
  • The router should normally get the packet on its 13.50 interface,
  • and should forward it via its 15.50 interface, directed to B.
  • B should get it on its 15.100 interface and reply from its 13.100 interface
  • A should get it directly, it doesn't.

There is probably something wrong at the router.
Try a traceroute command from A, using the switch.

share|improve this answer
    
Just out of curiosity, could you assess what the problem was? –  ring0 Jan 2 '11 at 4:54
    
Sorry for the delay, but I didn't manage it to work on the solution before Christmas came. Meanwhile we solved the issue by using 255.255.0.0 as the netmask, effectively creating one single net. –  tanascius Jan 3 '11 at 11:54

What you are probably seeing is this:

  1. Packet Goes out interface on A (13.10)
  2. Gets Routed to B via Router (15.100 via router)
  3. Gets Recieved by B (15.100)
  4. B goes to reply and says "Oh Hey I'm on the same network!"
  5. Packet goes out interface on B(13.100)
  6. Gets Recieved by A (13.10)
  7. A say's I'm not expecting this from 13.100 drops packet

You can confirm this by running a packet trace on A & B while sending the ping, look at the headers and check the source & destination addresses.

The only real way to solve this is to add a /32 routing entry on host B to force the packet out 15.100 but that doesn't scale well.

share|improve this answer
    
Do you have any idea why a hub instead of a switch works? –  tanascius Dec 22 '10 at 16:46
    
hmm the only thing i can think of is some wierdness with the fact hubs broadcast to all ports so both nics get the packet one via the router one via the 13 network. Best bet is to throw a packet sniffer on and see what is coming and going over the wire –  Zypher Dec 22 '10 at 16:57
    
Unfortunately it is not possible to add a routing entry to B (this is an embedded system which we try not to modify in any way). But we solved the issue by using 255.255.0.0 as the netmask, effectively creating one single net. –  tanascius Jan 3 '11 at 11:56

a) Do a tracert from computer A to computer B, that should reveal what hops its taking
b) What are the Default Gateways Set on computer B ?
c) What type of switch it is ? Layer-2, Layer-3 ?
d) can you try disabling the 13.100 NIC on computer B completely and then reboot that machine and ping it to see if that works ?

share|improve this answer
    
Unfortunately we can not modify host B. But we solved the issue by using 255.255.0.0 as the netmask, effectively creating one single net. –  tanascius Jan 3 '11 at 11:58

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.