7

I am experimenting with ping command on Windows 7.

According to the help of ping command.

-j host-list Loose source route along host-list (IPv4-only).

My computer sits in a home LAN. The default gateway is 192.168.199.1. I tried the following 2 ping commands.

The first one is a direct ping to an external host.

ping 114.80.143.158

It works.

Then I tried to check the loose source routing, which is this command:

ping -j 192.168.199.1 114.80.143.158

But it gives me Request timed out.

I think all my requests will go through the default gateway, so the loose source routing ping should work. but why it doesn't ping through?

2 Answers 2

7
+50

Why doesn't ping -j work?

Loose Source Routing, specified using ping -j, tracert -j or pathping -g, can be used to specify a system through which the packets should pass through before proceeding on to their destination.

However, source routing has a great potential for abuse (see later), and therefore most network administrators block all source-routed packets at their border routers.

So, in practice, Loose Source Routes aren't going to work.

This is unfortunate as the ability to see a Reverse Route (which can be done using Source Routing) would be very useful when using tracert and pathping to diagnose network issues.

  • Normal and Reverse Routes may be (and often are) completely different ("Asymmetric").
  • If they differ, a problem in the connection could be a problem with either the route to the target, or with the route back from the target.
  • A problem reflected in a Traceroute output may actually not lie with the obvious system in the trace; it may rather be with some other system on the reverse route back from the system that looks, from the trace, to be the cause of the problem.

The reverse path itself is completely invisible in the normal Traceroute output.

There is an interesting article at The Dangers of Source Routing explaining the risks when Loose Source Routing is enabled.


What is source routing?

Source Routing is a technique whereby the sender of a packet can specify the route that a packet should take through the network.

Remember that as a packet travels through the network, each router will examine the "destination IP address" and choose the next hop to forward the packet to. In source routing, the "source" (i.e. the sender) makes some or all of these decisions

In strict source routing, the sender specifies the exact route the packet must take. This is virtually never used.

The more common form is loose source record route (LSRR), in which the sender gives one or more hops that the packet must go through

LSRR can be used in a number of ways for hacking purposes. Sometimes machines will be on the Internet, but will not be reachable. (It may be using a private address like 10.0.0.1). However, there may be some other machine that is reachable to both sides that forwards packets. Someone can then reach that private machine from the Internet by source routing through that intermediate machine.

Source Source Routing


Should source routing be disabled?

Cisco routers normally accept and process source routes. Unless a network depends on it, source routing should be disabled.

Source routing is a technique whereby the sender of a packet can specify the route that a packet should take through the network. As a packet travels through the network, each router will examine the destination IP address and choose the next hop to forward the packet to. In source routing, the "source" (i.e., the sender) makes some or all of these decisions.

Attackers can use source routing to probe the network by forcing packets into specific parts of the network. Using source routing, an attacker can collect information about a network's topology, or other information that could be useful in performing an attack. During an attack, an attacker could use source routing to direct packets to bypass existing security restrictions.

Source IP-source routing is enabled for the router (CiscoIpsourceRoutingEnabled)


What is a reverse route?

Any connection over the Internet actually depends on two routes: the route from your system to the server, and the route from that server back to your system. These routes may be (and often are) completely different (asymmetric). If they differ, a problem in your connection could be a problem with either the route to the server, or with the route back from the server. A problem reflected in a traceroute output may actually not lie with the obvious system in your trace; it may rather be with some other system on the reverse route back from the system that looks, from the trace, to be the cause of the problem.

So a traceroute from you to the server is only showing you half of the picture. The other half is the return route or reverse route. So how can you see that route?

In the good old days, you could use source routing with traceroute to see the reverse trace back to you from a host. The idea is to specify what is called a loose source route, which specifies a system your packets should pass through before proceeding on to their destination.

The ability to use loose source routing to see the reverse route could be pretty handy. Unfortunately, source routing has a great potential for abuse, and therefore most network administrators block all source-routed packets at their border routers. So, in practice, loose source routes aren't going to work.

These days, the only hope you likely have of running a reverse traceroute is if the system you want to trace from has a traceroute facility on their web site. Many systems, and Usenet providers in particular, have a web page where you can run a traceroute from their system back to yours. In combination with your trace to their system, this can give you the other half of the picture. I have a list of Usenet provider traceroute pages here.

Source Using Tracert

5
  • It looks like the first line is confusing the "source routing" and "record route" options (which do opposite things)
    – user1686
    Jun 13, 2015 at 16:17
  • @grawity I've tried to clarify a bit... /
    – DavidPostill
    Jun 13, 2015 at 17:50
  • Well-researched answer! Perhaps you can add an attribution to the Using Traceroute article as well?
    – Karan
    Jun 14, 2015 at 18:54
  • @Karan Done -- thanks for the reminder, I forgot that one :/
    – DavidPostill
    Jun 14, 2015 at 19:18
  • @DavidPostill Thanks a lot for the detailed answer. Jun 15, 2015 at 8:10
3

These days, IP source routes are ignored practically everywhere, due to various security issues that they introduce. While it's not a very good idea to rely on IP routing for security, source routing still makes it unnecessarily easy to bypass firewalls, as well as spoof your IP address, while having practically no good uses.

In other words, your packets with a source-route are dropped by security policies. So you won't get a reply even if you specify the same route they'd normally take.

On Linux-based routers, you can still enable this by setting a sysctl:

sysctl -w net.ipv4.conf.<interface>.accept_source_route=1

FreeBSD (pfSense) has sysctls net.inet.ip.sourceroute and net.inet.ip.accept_sourceroute.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.