Solved

Pinging a host that has an incorrect gateway set

Posted on 2013-12-22
7
460 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
7 Comments
 
LVL 45

Accepted Solution

by:
Craig Beck earned 125 total points
Comment Utility
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 68

Assisted Solution

by:Qlemo
Qlemo earned 125 total points
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
You must use other machine in same subnet (physical and logical) as bad machine and reconfigure it.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mikhael
Comment Utility
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 68

Expert Comment

by:Qlemo
Comment Utility
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
Comment Utility
It worked because of a fixed route or a cached route in Arpcache.
0
 

Author Closing Comment

by:mikhael
Comment Utility
thanks all.
I appreciate it
Michael
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now