Solved

Pinging a host that has an incorrect gateway set

Posted on 2013-12-22
7
523 Views
Last Modified: 2013-12-29
If I ping a host in a different subnet – separated by a router – and the destination host has an incorrect or missing default gateway set, will my ping succeed? What about a TCP connection like telnet or RDP? Is Linux behaviour here different to Windows?
Assumptions: my settings are correct, correct IP, GW, SM. The routers settings are correct. On the destination host, the IP and SM are correct; just the GW is wrong or missing.
Thanks in advance
Michael
0
Comment
Question by:mikhael
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 46

Accepted Solution

by:
Craig Beck earned 125 total points
ID: 39735161
No it won't work usually.  The PC in the other subnet won't know where to send the reply as it doesn't have the correct gateway.

If the other PC uses a different router address to the one the sending PC uses, it may have some success if routing is configured to redirect the other PC to the correct gateway.

However, if your network uses Proxy-ARP the PC with no gateway (not the wrong gateway) may be able to reply correctly.  If the gateway is set wrong it will fail unless routing is redirecting as I explained in the previous paragraph.
0
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 125 total points
ID: 39735174
Agree. The application protocol does not matter, that is telnet or RDP will be treated the same, and ICMP isn't different, though it is a different network layer.

Everything IP-based needs to know the route back to the source, as TCP/IP is defined as not requiring replies to travel the same way back they came in. If it were that way, every hop on the way would have to temporarily store the session info to allow that. Or packets would have to store the complete route they used. Both would require a lot of overhead, either in the packets or routers' memory, without any particular advantage.

The only way the setup with a "wrong" gateway works is if the "wrong" gateway still has sufficient forwarding info to direct the packet to another router which the proper info.
0
 
LVL 62

Expert Comment

by:gheist
ID: 39737123
You must use other machine in same subnet (physical and logical) as bad machine and reconfigure it.
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:mikhael
ID: 39737339
Thanks guys, that's what I thought - or rather what I've read. My question is kinda hypothetical. Years ago, I believed it would work, because I had experienced it working. Maybe it was Proxy-ARP or some sort of caching.
But I thought TCP being a "connection" protocol (as distinct to UDP, say) maybe establishes the connection and the reply "knows" the path back?
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 39737771
Explained in http:a39735174 - the reply only knows the target, not the way. The path taken is not recorded in the packet, and that would be a prerequisite.

Recently we had network integrated devices (based on RTOS) with a incomplete implementation of the TCP/IP stack. That led to ignoring the subnet mask, and just blowing out all traffic back as if it were on the same network, no matter of IP addresses.
So, if the TCP/IP stack implementation is buggy, it might work without gateway, but only if no routing is needed. That is, two IP networks on the same physical network.
0
 
LVL 38

Expert Comment

by:ChiefIT
ID: 39745629
It worked because of a fixed route or a cached route in Arpcache.
0
 

Author Closing Comment

by:mikhael
ID: 39745645
thanks all.
I appreciate it
Michael
0

Featured Post

Webinar May 25: Cloud Security Strategies for SMBs

Small and mid-sized businesses are a driving force behind cloud adoption, and it’s no wonder: cloud benefits are BIG.  But for all the convenience that moving to the cloud provides, where does security come into play?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question