Saturday, December 06, 2008

nslookup works, ping doesn't on Linux - Missing routing entry!

This one drove me nuts (for 2 hours!!) Here's my problem: I can't ping outside the LAN, but nslookup works!
Since my Linux skills are rusty enough to give anyone passing remotely close tetanus, I did what what anyone would... google. And here we go (drum roll please) with the awesome support Linux enjoys, I hit 78,200 results. To my surprise was lots of talk and no solutions. Closed that tab. Open the rusty swiss army tools

1. cat /etc/resolv.conf -> check! Silly me! How else would nslookup work? :p
2. ifconfig -> here's what i got (click to enlarge)
(Confession time: I'm working on my FSG.)
So I've eth0, eth1 and mwl0. But the last two are mapped and I'd have only eth0 and eth1

3. Next step route
(and waste 30 mins chatting, 170g Pringles, 300ml lemonade)

Finally figured there's no default routing for eth0
A quick route add default gw 192.168.1.1 eth0
192.168.1.1 is my router's IP. My gateway that is.)
And presto...
Ping!

I'm afraid this post is more from elation than providing a solution. But the troubleshooting essentially should be:
  • Checking connectivity
  • Checking routing
My summary and learning from this whole affair:
1. Linux may be popular, but finding a solution is a pain
2. Google and the Internet is a must must! Had I been in India, I'd certainly have trouble
3. Pringles is addictive. You cannot stop.
4. Finally an MBA will not necessarily turn your brain off and your tongue on. Go figure!

4 comments:

retarded said...

I can't agree to the fifth conclusion completely when seeing some examples.
no.. not u.. :))

Michaelj said...

man, i spent an hour trying to figure out why i had no WAN access on a ClearOS box. your fix did it. awesome. thanks!

Linuxonlinehelp said...

MAN YOU SAVED MY DAY!!

Thanks
Tom
www.linuxonlinehelp.de

Linuxonlinehelp said...

MAN YOU SAVED MY DAY!!

Thanks
Tom
www.linuxonlinehelp.de