ADSL issues…

Of course nothing is as easy as it should be, and this is definitely true for installing a DSL connection at home. My previous internet connection was also ADSL, so I thought switching to a new DSL provider would be easy. Yeah sure.

After talking for more than half an hour with the helpdesk, making me go through endless modem settings while I was already convinced it was a line problem, I decided to just open the wall connection to see what is going on there. Apparently every land line (in The Netherlands) has two physical phone lines. Line 1 (red/blue wire pair) and line 2 (orange/white wire pair). The old ADSL connection was configured on line 2, and of course the new one on line 1. No one told me this, so with nothing to lose I decided to switch some wires and move to line 1 (red/blue). This turned out to solve the problem indeed. So, finally ADSL again after using 3G for way to long 🙂

POTS wires

The new Fritz!Box works fine, but takes a very long time to get ADSL line sync. The DrayTek Vigor 120 is much faster (I used this one initially to test my line hacking)… Not sure if this will be a problem in the future, but the Fritz!Box wizard was unable to successfully test the Internet connection after setting it up because the line wasn’t synced yet. Waiting another minute solved that.

Very helpful resource (in Dutch) that explains all about the wiring can be found here.

Advertisements

Linksys Surgery

So I bricked my Linksys WRT160NL last week, today the USB to serial device arrived by mail. The special thing is that it supports 3.3V on the serial port as opposed to the more traditional 5V that is used on PCs. A search on e.g. eBay for “rs232 to ttl” will show a lot of cheap devices you can get.

I opened the router and attached the cables that were included with the USB device to make the serial connection work. On the OpenWRT wiki some other information is included about using the external accessible serial port, but I didn’t want to risk frying the WAN/LAN port by fiddling with wires. So what I ended up with is this (click for larger version):

Linksys Surgery

After this I followed the TFTP flash procedure as described here which worked like a charm 🙂

I used Ubuntu 11.04 for this procedure with minicom (apt-get install minicom) and start it with minicom -D /dev/ttyUSB0. For TFTP upload I used the basic TFTP client, tftp (apt-get install tftp).

OpenWrt, 3G, IPv6

While waiting for ADSL from XS4ALL to be connected, I’m playing with the 3G UMTS dongle I got in the meantime. Configuring a dongle like this on Windows or Mac is a disaster, lots of crapware (you can install this from the CD-drive emulated by the stick) which never works and behaves like a virus. On Linux (tried with Fedora) with NetworkManager (or more specifically ModemManager) installing this is very easy. Just plug it in, select your provider (even XS4ALL is listed!) and you are in business.

It turns out it is also quite easy to get this to work on OpenWrt. I am using OpenWrt 10.03.1-RC5-testing on an Alix board with USB2 port. I tried first to do this on my Linksys WRT160NL, but unfortunately I “bricked” it for now and am waiting for a 3.3V serial cable to fix it :).

Alix and 3G modem

3G

I assume OpenWrt (the version specified above) is installed on the machine and you can access it using SSH (configuring the LAN and WLAN is out of scope here). First the network configuration in /etc/config/network:

config 'interface' 'wan'
option 'ifname' 'ppp0'
option 'device' '/dev/ttyUSB0'
option 'service' 'umts'
option 'proto' '3g'
option 'pincode' '0000'
option 'apn' 'umts.xs4all.nl'
option 'username' 'xs4all'
option 'password' '1234'

For this to work you need a number of packages from OpenWrt:

# opkg update && opkg install kmod-usb2 kmod-usb-serial-option kmod-usb-serial chat comgt kmod-ppp

I probably forgot a few, see also OpenWrt documentation here.

This should make everything work! No other fiddling around needed… Except, modifying the 3G dongle to not emulate a CD drive… See this site. I used AT^U2DIAG=0, that at least made my Vodafone 3G (K3765) adapter not emulate a CD drive. I didn’t try this on the one I got from XS4ALL (Huawei E180), as I have to return that at some point :). I issued this AT command in Linux to /dev/ttyUSB0 after ModemManager performed a usb_modeswitch to enable the modem instead of the CD drive. This way I didn’t need it on OpenWrt, and it would also work in for instance a FritzBox.

IPv6

As a fan of IPv6 I also wanted to get this to work. I didn’t feel like using a tunnelbroker so instead opted for trying out 6to4, something I wanted to do already for a while…

Turns out, this is also quite easy. You just install the 6to4 package, just add a new entry to /etc/config/network:

config 'interface' 'wan6'
option 'proto' '6to4'

Next modify one line in the firewall (/etc/config/firewall):

config zone
option name 'wan'
option network 'wan wan6'
...
...

To make it available on the LAN, install the package radvd and enable it with /etc/init.d/radvd enable. Bringing the interface wan6 up will configure radvd for you. Don’t forget to restart the firewall and bring up the interface:

# /etc/init.d/firewall restart
# ifup wan6

A last thing would be to make sure net.ipv6.conf.all.forwarding=1 is set in /etc/sysctl.conf.

Unfortunately it seems that at least Mac OS X prefers IPv4 over IPv6 when using a 6to4 tunnel, which makes sense I assume as 6to4 tends to be flaky…