home of the madduck/ blog/
Recovering a lost default route

Tired and under the influence of beer, I tried to remove the currently broken IPv6 default route from my primary mailserver via an SSH connection and accidentally executed instead:

ip r d default
# I meant: ip -6 r d default

Unfortunately, I didn't immediately realise what I had done, and then it was too late.

Robert Collins told me that I could have saved the session because even without a default route, packets still reach the machine. Unfortunately, due to Nagle's algorithm, you pretty much only have one shot, so the next time this happens to me (or you), quickly type

ip r a default via <gateway>

into a separate window, then copy and paste it into the SSH session and you may get lucky.

Update: one lesson I learnt from this is to add specific routes for at least the IPv6 tunnel peer, and possibly another machine (or two) under my control out there. I now have that in place on all machines I own.

NP: The Phoenix Foundation: Pegasus