Wednesday, May 20, 2009

Magic NAT Incantation

 

How many times am I going to get bit with this?

Rebuilt the system this weekend. In addition to the expected hassles of version upgrades, aging hardware and the peculiarities of my configuration there's always one or two things I forget that cause some unnecessary stress. But this one gets me every single time.

No matter what I did, I couldn't get NAT to work. The machines on the subnet were pingable, had happy network connections. But no outside internet. I could resolve domains using my local internal cacheing nameserver but could not reach those hosts.

I spent hours staring at the iptables file, starting and stopping the network, checking cables, rebooting machines on the subnet. No packets, no joy. Finally I'm sitting at a party on Saturday night, drinking some deadly home-made liqueur (started as vodka, involved lemons) when suddenly I have a flashback to more than ten years ago, sitting in an office trying to get NAT to work. A vision appeared in my mind and a blazing hand descended from heaven to write this message across the sky in burning letters:

echo 1 > /proc/sys/net/ipv4/ip_forward

No, I will never learn. The only hope is write as much stuff down as possible for next time. Or maybe I should just accept the fact that my faculties have deteriorated past the point of being a small-time linux admin. Can I still get an account at AOL?

 

No comments: