My previous posts on my ADSL setup have generated a great deal of interest, so I’m now adding a detailed writeup on how to set up this system.
First, here is a reference diagram of how everything fits together:
Bear in mind that you could replace any part of the system with something comparable. E.g. the RTA1320 could be replaced wtih any ADSL router that supports half-bridge mode, and the WRT54GL could be replaced with a dedicated PC runing Smoothwall or some other full-blown firewall package.
Disclaimer: I’m assuming you know what you are doing. If you screw up your modem, router, PC, cat, or mother-in-law by following my instructions, it’s not my fault.
First up, let’s configure the ADSL modem. Make sure you have firewall software running on your computer, because part-way through this setup, your computer’s ethernet card will effectively be part of the internet.
Before we start, here’s what I am assuming:
- You have the RTA1320 already set up for internet access, with your ADSL authentication details set up correctly.
- Your computer is set to aquire an IP address automatically via DHCP
- The WRT54GL router is set up with factory standard config.
Update: Well, it seems that my half-bridge settings go a bit wonky if you happen to use TelstraClear Ltd (TCL) as your provider. Please read the footnote if you get your ADSL via TCL. Otherwise, carry on!
Plug the modem’s ethernet port directly into your PC (ignore the router for now). In your favourite browser, navigate to the IP address of your modem (I believe it is 192.168.1.1 by default). Now do the following:
- Change the IP range of the modem to something that will not conflict with the router. I use 10.0.0.1 for my modem, and 192.168.1.1 for my router. On my modem this is done under Advanced -> Local Network -> IP Address
- Also change the DHCP range to match the new IP address, so that we can get a valid address to communicate with the modem if the intenet connection doesn’t come up properly. This is under Advanced -> Local Network -> DHCP Server
- Now we set the elusive “half-bridge” or “IP extension” mode. This is fairly deep in the setup, but we get to it like this:
- Go to Advanced -> Internet -> Connections
- Hit the ‘edit’ button (the little pencil icon) for the existing connection
- Hit the ‘Next’ button twice (again, I’m assuming your connection is all set up and perfect already).
- You should see a page like the one below. Untick the NAT box, and tick ‘PPP IP Extension’.
- Hit the ‘Next’ button a few more times, apply the changes, and reboot the modem.
- All going well, you should see a few things happen as the modem reboots. When the modem first comes up, your PC should obtain the 10.0.0.10 address. A minute or so later, the modem will authenticate properly and you should see your PC address change to some public IP address (219.x.x.x in my case). If not, then log back into the modem on 10.0.0.1, check the logs, check your settings, etc. If things are totally broken, perhaps reset the modem to factory settings and try again.
- So now we have a modem set up in half-bridge mode. If you don’t need to share your connection, and are happy with your computer firewall for security, then you could run with this setup and it should increase the stability of your connection, and probably speed up P2P somewhat, because we’re no longer dealing with the NAT table in the crappy cheap router software inside the modem. Update: except if you’re using TCL as an internet provider of course. In that case just pray that the rest of the setup will work, or you can hunt in the router for its default gateway address and manually add this as a gateway route on your PC…I’ll leave that as an exercise for the reader.
- Plug your computer into one of the ethernet ports on the router.
- Upgrade the firmware on the WRT54GL to the latest version of DD-WRT Tomato Firmware (Tomato is much nicer and has a nice clean interface compared to DD-WRT). I’m not going to go into specifics here, the Tomato FAQ has plenty of information. The one thing I will say is: do not forget to reset to factory defaults a second time AFTER you have upgraded. Forgetting this step cost me an hour or so of frustration.
- Log in to the DD-WRT config page, go to Administration -> Management. Scroll down until you see the IP Filter Settings, and adjust them as below:
Update: A couple of applications (IRC and Battlefield 2142 so far), seem to misbehave with the timeout set this low. A safer setting would appear to be 300 seconds for both TCP and UDP timeout.
- Save the settings, reboot the router, and plug the modem into the ‘internet’ port of the router.
That’s pretty much it. Browse around the DD-WRT Wiki pages, because they have heaps of information on things like QoS, which may help if you’re sharing P2P traffic with other kinds of traffic on your network.
Footnote: TCL has a strange setup whereby the public address of your modem and the default gateway of their network are on different subnets. Normally this works OK because the modem knows about it, but in half-bridge mode connected directly to your PC, the PC tries to use the public address as the default gateway, and packets get nowhere. Which also means you can’t access the modem’s setup pages once it gets a public address :/
The good news is that it seems the particular router I’m using (and I’m expecting most other routers) are intelligent enough to work this all out (using ARP maybe?), so it all works fine when you plug it all together. Phew!