reserved for those occasions when i feel the need to share my excitement with the world
ramblinations

2006-09-26

gentoo, netgear, and dhcpcd
i love fixing things in linux. it's so much more satisfying than fixing things in windows. my latest: flushing the dhcp client cache!

i use a netgear wgr614 wireless router and dhcp server for our home lan. hadn't had any problem with it, except that one of my port forwarding rules mysteriously disappeared. (it still existed, i just couldn't see that the port was open--or close it, for that matter.) not a huge deal, it wasn't a critical port. i'd been happily netgearing along until yesterday, when my gentoo box started receiving the wrong ip address. (the router does serve as a dhcp server, but i've got reserved ips for all our home machines.)

i'm sure a real geek would just shrugged, restarted the router, flushed the dhcp client cache, grumbled a bit over netgear's ineptitude, and gone on her merry way. i'm a networking ninny, so my first thought was to force the ip. worked half-way: i got the ip i wanted, and i could access the lan, but couldn't get outside the router. (i'm still a networking ninny; anyone want to explain why that is?) couldn't find any relevant info online--just lots of people from 2004 with no solution. took a look at the router again, and discovered it had reset ALL my port forwards to a completely bizarre destination ip. that's it,, thunk i. i reset the router to its factory defaults and re-configured it.

short interlude here; benjamin and i watched an episode of star trek (next generation). while in windows (i haven't set up xvid in gentoo yet), i noticed the ip address was correct! hurrah! it's fixed!

alas, 'twas not so in gentooland. i tried all kinds of things--setting the reserved ips to outside the dhcp server range, on both sides; changing dns settings and gateways (not that that should make any kind of difference); etc. finally, it occurred to me to check the mahvelous little dhcpcd tool, to see if it might have a solution built in. it's linux, after all.

i discovered -k: "Sends SIGHUP signal to the dhcpcd process associated with the specified interface if one is currently running. If dhcpcd receives SIGHUP it will send DHCP_RELEASE message to the server and destroy dhcpcd cache."

$ sudo dhcpcd -k eth1
$ sudo /etc/init.d/net.eth1 restart
$ sudo wpa_cli reassociate


bingo.

so now i feel a little ridiculous that it was such an easy fix, and that i wrote a book about it, but it was so satisfying!
# ramblinated by gemma : 06:47 : :