Friday, October 14, 2005

More FiOS + OpenBSD

OpenBSDWhen Verizon came to install FiOS at my house, they didn't immediately bury the cable from the curb to my house. During the day today, I was unable to connect back to my servers at home. When I got home, I found that the cable was buried so I had been disconnected. I'm sure the Dlink that Verizon provides would have happily reconnected and I would have been able to reconnect, but my OpenBSD box did not reconnect.

After doing some looking through the misc -at- openbsd -dot- org archives, I found someone that came up with a quick, simple solution to this problem.

At the bottom of his post, Daniel Melameth posts a script that I've since instituted on my gateway:
# pppoecheck - attempt to restart pppoe interface if it is down
# Contributed by on misc @ openbsd . org
# pppoe0 interface exists
if [ -f /etc/hostname.pppoe0 ]; then
down=`ifconfig pppoe inet | fgrep`
if [ "$down" ]; then
logger -p user.err pppoe0: phase restart
sudo /sbin/ifconfig pppoe0 up

Then, with the following line in my crontab:
*/5 * * * * /home/mike/bin/pppoecheck > /dev/null 2>&1
And the following line in my /etc/sudoers:
mike ALL=NOPASSWD:/sbin/ifconfig pppoe0 up
My OpenBSD gateway should reconnect within 5 minutes of losing it's connection.

We'll see if it works when it goes down... Thanks, Daniel.