Routing loop: TTL expired in transit

networkingrouterroutingvirtualbox

I 'm trying to ping from my host PC (Windows 7) to Ubuntu 13.04 (VirtualBox). However, I get the error:

Pinging 10.0.2.15 with 32 bytes of data:
Reply from 78.87.2.210: TTL expired in transit.
Reply from 78.87.2.210: TTL expired in transit.
Reply from 78.87.2.210: TTL expired in transit.
Reply from 78.87.2.210: TTL expired in transit.

Ping statistics for 10.0.2.15:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

tracert 10.0.2.15 showed that there is a routing loop.

Tracing route to 10.0.2.15 over a maximum of 30 hops

  1     1 ms    <1 ms    <1 ms  192.168.1.1
  2    42 ms    43 ms    42 ms  b5.met.cyta.gr [46.103.127.5]
  3     *       41 ms     *     178-103-193.brsl3.cyta.gr [178.59.10
  4    45 ms    42 ms    46 ms  78-2-210.itr.cyta.gr [78.87.2.210]
  5     *        *        *     Request timed out.
  6    46 ms    47 ms    44 ms  78-2-210.itr.cyta.gr [78.87.2.210]
  7     *       42 ms    42 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
  8    43 ms    44 ms    43 ms  78-2-210.itr.cyta.gr [78.87.2.210]
  9     *       43 ms    42 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 10    46 ms    42 ms    44 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 11     *        *        *     Request timed out.
 12    42 ms    43 ms    43 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 13     *        *        *     Request timed out.
 14    45 ms    44 ms    42 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 15     *        *       43 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 16    46 ms    47 ms    47 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 17     *        *        *     Request timed out.
 18    46 ms    45 ms    45 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 19     *        *        *     Request timed out.
 20    44 ms    43 ms    43 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 21     *        *       43 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 22    44 ms    44 ms    46 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 23    42 ms     *       43 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 24    45 ms    43 ms    43 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 25    43 ms     *       45 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 26    54 ms    47 ms    44 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 27    43 ms     *        *     e2-med-t7-4.itr.cyta.gr [78.87.2.199
 28    43 ms    42 ms    46 ms  78-2-210.itr.cyta.gr [78.87.2.210]
 29     *        *       42 ms  e2-med-t7-4.itr.cyta.gr [78.87.2.199
 30    43 ms    43 ms    44 ms  78-2-210.itr.cyta.gr [78.87.2.210]

Is there any way to resolve this problem?

VirtualBox Network Settings:

Host-Only Adapter

Promiscuous Mode: Deny

Cable connected

Best Answer

TL:DR;

You misconfigured the routing and you are leaking private IP addresses to the internet. Fix your routing. This might help.


Longer version:

IP numbers are unique. We only have 232 IPs and those are carefully allocated so that we know how to route IP packets from one location to another. If you connect to the Internet you must use one of these officially assigned IPs or IP ranges.

This is not always practical when you have more computers then IP addresses (and you typically only get a single IP as a home user). We work around that with RFC 1918. RFC 1918 describes a few IP ranges which should never be used publically on the Internet. This means that:

  • You can freely use them at home, but also
  • You should never leak these to the Internet. And
  • If you want to communicate from a host with an RFC1918 IP then you must use some special tricks (e.g. tunnels, a VPN, or NATting).

In your case you send packets directly from 10.0.2.15 toward the internet. You can see the packet start at 10.0.2.15, then get routed to 192.168.1.1 (which is probably your default gateway) and from there to 5.met.cyta.gr. 5.met.cyta.gr should never see your packet. It should have been dropped at the edge of your home network.

However due to misconfiguration, 5.met.cyta.gr does get the packet. For some reason it sends it to e2-med-t7-4.itr.cyta.gr. This can be either because they never expected to see this kind of wrong packet and this is e2-med-t7-4.itr.cyta.gr's default gataway, or because cyta.gr also uses the 10.0.0.0/8 range internally. e2-med-t7-4.itr.cyta.gr also does not know what to do with it and sends it to 5.met.cyta.gr, where the loop starts again.

Without careful consideration this would tie up the network between these two machines as they keep forwarding packets to each other. Eventually these last two machines will be so busy they they can not do anything else.

To prevent these kinds of problems IP datagrams have a field called TTL (time to live). Each time a packet/datagram passes a router this field gets decreased by one. If it reaches zero it gets dropped and a warning gets send back to the original sender. This causes the TTL expired in transit message to be displayed on your computer.

The fix is to properly configure your own border router (probably at 192.168.1.1). It should not forward packets for any of the RFC1918 IPs (192.168.0.0/16, 10.0.0.0/8 or 172.16.0.0/16) to the Internet.

Just what it should do with them depends on your home setup. There is not enough information in the post to answer that.

Related Question