"cs****@elfware.za.net" <el*****@gmail.comwrote in news:653b4e2e-ca41-
45********************@8g2000hse.googlegroups.com:
Perhaps, if you traceroute an IP and if the path is greater than 2
hops, then the traffic is being routed. I am not sure if you determine
if the device routing your traffic is a router though. ??
Only a router would decrement the TTL, which is what traceroute uses.
I'm still interested in knowing why the OP wants to know if the router is
present.
Another approach is to just ping the default gateway. If ping isn't
firewalled by the router, one should get a response. One could also port-
scan the firewall, in hopes that one of the ports is an administrative
interface and will respond to a connection request. Only a high-end router
with a very sophisticated firewall would totally obscure such an interface.
(For example, a very paranoid router might use port knocking to hide its
administrative interface, or it might not be available via the subnet that
the querying host is attached to.)
This isn't really a C# question, though. The best expertise would be found
at comp.protocols.tcp-ip. But frame the question in generic programming
terms, not as a C# question.