Can Network with Default Gateway Ping PC in Another Network Without Gateway? – Routing Analysis

routerrouting

Please see the picture first.

Let someone ping from PC1 to PC2 (which has no default gateway). Would it be possible for the ping to successfully reach to PC2 and then come back in the fashion mentioned in the picture?

I have got this question in my mind because of the NAT. I think one would be able to ping PC2 successfully because the router will forward that ping to PC2 and the PC2 would assume that the 192.168.2.1 (which is in its network) has pinged it so now it would reply to 192.168.2.1 which will in turn send that reply back to PC1.

Am I right, or am I in complete darkness?

Can you please tell me what would happen in this scenario?

enter image description here

Best Answer

Well I suppose it is without gateway but only works if you have network address translation which really takes place on routers. The details of the addresses aren't however correct on segment 1. (The first ping packet would ping the router and get a direct reply.)

  1. PC1 sends src=192.168.1.2 dst=192.168.2.2 to routerether1 on seg1
  2. Router sends src=192.168.2.1 dst=192.168.2.2 to PC2ether on seg2
  3. PC2 receives it and replies to src=192.168.2.2 dst=192.168.2.1 to routerether2 on seg2 as it is local
  4. Router sends src=192.168.2.2 dst=192.168.1.2 to pc1ether on seg1

NAT requires considerable complexity and remembers a great deal in order to remember which connection is supposed to go where; NAT for ping is especially complex in maintaining the table of mappings.

NAT might be very common on domestic routers and inside 4g networks and so on, but you've really got to get the base case super clear before understanding NAT.

Hope that helps,

Jonathan.

Related Topic