A bit off-topic, but useful nonetheless. One day cable went down. Optimum online is usually great — but they totally dropped the ball that day. We wanted to use our Novatel Ovation U720 cellular modem to power our network as a backup. Lots of credit goes to Dragon, and this wiki. Here's how we did it:

Grab the modules we need; throw on JFFS

You need usbserial.o and option.o. You can get these here and here. Note: The ones at http://www.dd-wrt.com/phpBB2/viewtopic.php?t=43358 did not work for me. I got mine courtesy of Oleg's Asus wl500gP Linux build (modules-1.9.2.7-d-r211.tar.bz2 @ Google Code). It should probably work for you as long as you're using a Broadcom-based router.

Install chat

See http://www.dd-wrt.com/wiki/index.php/Ipkg. You just need to install chat so that we can send the right strings to the modem to connect. You might also want to install "microcom" to debug interactively. Cellular modems are just like analog modems of yesterday. Yep, ATZ. Yep, ATD. Same old strings Hayes invented for modems in the 70s.

Create a chat script; /jffs/isp-connect.chat

TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'ERROR'
SAY 'Starting Up…\n'
# Get the modem's attention and reset it.
"" 'ATZ'
# E0=No echo, V1=English result codes
OK 'ATE0V1′
# List signal quality
'OK' 'AT+CSQ'
'OK' 'ATDT#777′
CONNECT

Create a PPP script referencing that chat script; /jffs/isp-connect.ppp

/dev/usb/tts/0 # modem
921600 # faster than this has no effect, and actually can be detrimental
defaultroute # use cellular network for default route
usepeerdns # use the DNS servers from the remote network
#nodetach # keep pppd in the foreground
#debug
crtscts # hardware flow control
lock # lock the serial port
noauth # don't expect the modem to authenticate itself
local # don't use Carrier Detect or Data Terminal Ready
persist # Redial if connection lost
user
ppp
holdoff 5 # Reconnect after 5s on connection loss
lcp-echo-failure 4 # prevent timeouts
lcp-echo-interval 65535 # prevent timeouts
connect "/jffs/usr/sbin/chat -v -f /jffs/isp-connect.chat"

Load it all up in a script; /jffs/isp-connect.sh

#!/bin/sh
insmod /jffs/usbserial.o
insmod /jffs/option.o
pppd file /jffs/isp-connect.ppp
iptables -A FORWARD -i br0 -o ppp0 -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Done!

If it doesn't work, set connection type to Disabled or DHCP before running the above script. This is not 100% automated/streamlined, but it works!

Tell an amigo:
  • Sphinn
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Facebook



No related posts.