As I recently moved to a new house, I don’t have my DSL subscription anymore and I decided to try to share the internet connection provided by my Nokia 5230 to the whole house using a wireless router (as a switch).

I’ve installed Ubuntu with pendrivelinux on a USB memory stick. It was fast and easy to connect to the internet and share it. After installing ubuntu I’ve installed wvdial:

# apt-get install wvdial

And it comes from the USB key itself, great thoughfulness because at this stage I can’t connect to the internet yet.

After that I’ve edited /etc/wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 9600
Phone = *99#
Username = user
Password = pass
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 =
Dial Command = ATDT

Note that username and password can be anything in my case. By typing “wvdial” the internet connection is working, but only on this computer, is not shared yet. To share it, I wrote a small script, internet_share.sh

#!/bin/sh
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth0 -d 192.168.1.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/24 -o ppp0 -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

After executing the script the connection is shared and will work, provided that other hosts of the network use the IP address of this computer as gateway. The connection is generally good and fast and I’m not missing my old DSL at all (that wasn’t that great actually).

Update: this configuration works with Smart Philippines, the configuration for Globe is a little different and I can post it if anyone is interested. I switched from Smart to Globe because Smart was stealing money from my account! Even if I was subscribed to a unlimited internet package, the account balance kept on shrinking, of several hundred pesos, despite I didn’t make any phone call or sent SMS. Globe doesn’t have this problem.