Welcome to It-Slav.Net blog
Peter Andersson

I've already got a female to worry about. Her name is the Enterprise.
-- Kirk, "The Corbomite Maneuver", stardate 1514.0


I wanted to use a 3G dongle with a twin SIM card as my Internet connection when I’m traveling. I have earlier decribed howto share the Internet connection and make it more flexible by using an OpenWRT router with USB interface as a bridge between Wlan and 3G/GPRS provided internet.

Unfortunatly Tele2s support personel cannot keep track of the unlogical rules among their different subscriptions so they fouled my to buy a twincard to my regular subscription and use that for data. After a couple of more calls to Tele2, including that they listened to a recording of when I ordered the twincard I have to give up that track because it was not possible. The twincard only works for phone calls, not data connections and especially not when I had a flatrate subscription on my master SIM card.

After some investigation I came to the conclusion that I have to use my Regular phone, a HTC Desire with Android as my connection to internet.

Unfortunatly the work done with getting the USB 3G dongle was a waste of time.



An OpenWRT router with a working USB interface and a rndis enabled modem, I use a HTC Desire.



root@WRT160NL:~# opkg install kmod-usb-net-rndis

I also installed some USB packages, probably not all of them are necessery:

root@WRT160NL:~#opkg install kmod-ar9170 kmod-usb-acm kmod-usb-core kmod-usb-ohci kmod-usb-serial comgt
kmod-usb-serial-option kmod-usb-storage kmod-usb-uhci kmod-usb2  usb-switch


Add the following to /etc/config/network

config 'interface' 'usb0'
    option 'name' 'usb0'
    option 'proto' 'dhcp'
    option 'ifname' 'usb0'
    option 'defaultroute' '0'
    option 'peerdns' '0'

Use the same firewall rules with your 3G connection as your normal WLAN, add the yellow marked line to /etc/config/firewall:

config 'zone'
    option 'name' 'wan'
    option 'input' 'REJECT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'
    option 'masq' '1'
    option 'mtu_fix' '1'
    option 'network' 'wan usb0 ppp0'

Do a reboot


To use your new connection, run ifup

root@WRT160NL:~# ifup usb0
udhcpc (v1.15.3) started
root@OpenWrt:~# Sending discover...
Sending select for
Lease of obtained, lease time 864000
udhcpc: ifconfig usb0 netmask broadcast +
udhcpc: setting default routers:
udhcpc: setting dns servers:

root@WRT160NL:~# ping www.google.com
PING www.google.com ( 56 data bytes
64 bytes from seq=0 ttl=51 time=371.025 ms
64 bytes from seq=1 ttl=51 time=388.617 ms
64 bytes from seq=2 ttl=51 time=316.767 ms
--- www.google.com ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 316.767/358.803/388.617 ms

Shutdown the connection with ifdown

root@WRT160NL:~# ifdown usb0


Leave a Reply

Filled Under: Android, Cool things, english, Fon

Book reviews
FreePBX 2.5
Powerful Telephony Solutions

Asterisk 1.6
Build a feature rich telephony system with Asterisk

Learning NAGIOS 3.0

Cacti 0.8 Network Monitoring,
Monitor your network with ease!