Static Routing and prepaid Web Africa

Fausto

Member
Joined
Oct 23, 2005
Messages
26
Reaction score
0
Location
Johannesburg, South Africa
Hello all,

I think I have finally cracked the issue that we all have after being capped (especially on IS accounts with the 28/27G local caps). I always wanted to be able to have mild international browsing available after my initial international cap on my IS account was reached (I used to use OpenBrowse in the past but I thought for the R40 I used to spend I was getting minimal value as the total transfer volume both up and down through the OpenBrowse proxies was never more than say 30mb per month - quite expensive if you do the maths). So as a typical chartered accountant I decided to investigate better options. Mr Beep, just a little shout out here - Your service is excellent and I think that the concept you brought to the market is exceptional, you are forever coming up with innovative and industry leading ideas but you know how us bean counters can be!!!

After recently breaking my Ma(ca)rconi WiFi router, I purchased a DLink DSL-G604T wireless router. Sure there are pluses and minuses on this router, but the best thing about it is that it has a tiny linux OS that makes it tick (Monta Vista Linux). So I figured surely I could set it up to make 2 pppoe connections which after some time I managed to do from the command line (the web interface is horrible and does not allow you to create 2 concurrent pppoe sessions on the same virtual circuit). Anyways to cut a long story short I managed to get the router to connect to both my IS account (which has 27G local access after my initial cap of 3Gb is breached) and my prepaid Web Africa account concurrently.

So far so good... Then I figured that if I set up static routing for all the known South African hosts (878 so far) through the ppp interface of my IS Account (in my case ppp0) and then one other static route for all other traffic (international) through the ppp interface of my WebAfrica account (in my case ppp1) I would be able to route all my local traffic through my IS account and still enjoy international browsing to my hearts content (well at least while my prepaid WA account remained in credit Gb wise). I have tested this in the current month visiting http://www.hostip.info/ (international site which reports my IP address to be 165.146.XXX.XXX which is clearly a SAIX based account i.e. WebAfrica) and http://www.sadcmet.org/Discuss/discuss3.asp and http://www.capeinfo.com/RC/reply.asp (local sites which reports my IP address to be 196.209.XXX.XXX which is clearly an IS account i.e. Internet Solutions). I havent been capped on my IS account yet so a full blown test cannot be conducted yet, but the cap is fast approaching so solid feedback can be expected in the near future! I have no reason to believe this setup wont work given my IP addresses reported above, but I should wait until Im capped before doing my victory dance!

Effectively I have managed to have the router do all the hard work, dodged installing raspppoe (didnt want to do this as I like being behind the router and not using it as a bridge) and also now I dont have to go into my router config and change my account details whenever I want to do a little international browsing/downloading. Furthermore there are 3 users on my home network, 2 of which are total techno peasants and the thought of training them to change account details etc was not appealing!

I would be more than happy to post a how-to regarding my setup (remember this uses a fair amount of telnet scripting and has only been tested on a DLink router) but Im sure with a little tweaking any decent router should be configurable!

Regards

Fausto Di-Trapani
 
basically all he's done is take the local routing table and force any local requests to use his Internet Solutions connection. The rest routes via his webafrica account. i've done the same thing with my freebsd server.

tun0 = saix
tun1 = internet solutions

eg: route add -net 168.210.0.0/16 -iface tun1

168.210.0.0/16 is a local route, any traffic destined to that local class B subnet gets routed via the tun1 interface (internet solutions)

this is classed as asynchronous routing. basically because, any local users who try and access your box require your local ip. and any international users require your international IP.

hope that makes sense.
 
No no dont understand me wrong, I understand the concept 100%, what I really wanna know is the exact commands he used as an example.

I was looking around for some custom firmware for my netgear router as I am not 100% happy with the way it works, however the hardware itself I like as it work without problems.

Thing is, it never hurts to look into other routers ect ect.

What I would really like more even for an alternative is if I could get my hands on a script that uses public-route-server.is.co.za to lookup IPs for local and set up routes automatically for those to go lets say over you IS account and you leave your default route on the SAIX account.

Preferably linux but freebsd could be fine as well.
 
Tinuva,

A couple of examples to get my router working the way i explained:

Setup routes for all local addresses
route add -net 168.209.98.0 netmask 255.255.255.0 ppp0
Just as an example this will route all traffic to 168.209.98.1 to 255 through ppp0 (incidentally this is the IP range that the IS news server lives on).

Note that I have 878 routes that get configured on my router - effectively all South African IP addresses. What I am saying is that 878 commands have to be issued to my router to get the routing table complete (for all SA subnets).

Once that is complete I then issue the command

/usr/sbin/pppd plugin pppoe nas0 linkname nas1 user XXXXXX password XXXXXX defaultroute usepeerdns mtu 1400 mru 1492 maxfail 10 demand idle 65520

To get my Web Africa account up and running.

Then one more static route for all other traffic with the following command:

route add -net 0.0.0.0 netmask 0.0.0.0 ppp1

With the following setup there is no need for your so called public-route-server.is.co.za as the router is aware of all the required local routes, everything else is pushed through the WebAfrica account (which is international traffic)!

I have an excel table which I am happy to share with all the local South African subnets. Not sure about the netgear routers though... Time to do some reading and Ill start working on a generic howto.

Cheers

Fausto Di-Trapani
 
The netgear router is very interesting.

Some facts: 14mb ram
only /tmp is writable, but once you reboot all that is lost.

However, I found out its kind of like a linksys wrt40 (or something like that) where it uses the same OS almost, but most important, i can extract the firmware and make changes to it, repack it and upload that to the router and it should work if i didnt screw up, if i did screw up there is the emergency util that i can use to recover the router with official firmware again.

So what I am going to try to do is find out most of what I need, make a script that should work for dialing a 2nd account, keep default routing on the saix account and make fixed routes for the IS account.

What I have figured out so far is, how to manually enable bridged mode on this router, it just sucks that once that is on the router itself cannot dial out pppoe connections anymore, but maybe if i try the above pppd command I can maybe just make it dial out over br0 instead of nas0, will see though as this gets quite interesting.
 
Hello all,

A little update. It works, and it works beautifully! Full tilt international browsing while my IS account is capped. No OpenBrowse, no raspppoe, no RouteSentry, and no BSD server!

Please, if youre interested download http://faustodt.googlepages.com/Routes.zip and try it out, cant say it will work on all routers, but I think many should be configurable.

I have included an Excel SS with a little macro to generate a script file, TST10.exe which is a telnet scripting program, and router.bat used to start the scripting process. All the macro's are safe and uprotected so you can see them before executing them.

Let me know how it works for you.

Cheers

Fausto Di-Trapani
 
This sounds like a winner! If only I could download the zip file: "sorry openbrowse is a browsing only proxy" :rolleyes:

Think I'm going to give it a shot next month.
 
Hello all

A couple of updates have happened since I last posted (sitting on V0.13 so far)... Please visit the following Google page for the update

http://faustodt.googlepages.com/routes

Havent really seen much interest in my original post, so for the time being I am not going to pursue this for other makes and models of routers. I have to a certain extent included limited support for NetGear routers, but this keeps falling flat on its face (why you may ask, well Ive been trying to do it via remote control with a fellow MyADSL forumite, just isnt as good as physically having the router in my possession).

If anyone in the Bedfordview area in JHB is willing to do a quick router swap (NetGear preferrably) for say a couple of days so I can tweak my tool to incorporate NetGears drop me a PM.

Anyways, It has been really fun and interesting pursuing this and it really has improved my online experience, I want to share this with the wider community to make ADSL in SA just that little bit more enjoyable (in other words bearable)....

Cheers

Fausto Di-Trapani
 
Just read this, i was always wondering whether it was possible with my router (Dlink G604-T) but never got off my lazy butt to persue it... So reading this post, I have to congratulate you, will you marry me!

I also have 3other users in my house and at the moment using bridging it horrible!

Question, when the 24hour reset happens does the Dlink router automatically recreate the session or do i have to telnet in and recreate the ppp link?
 
Well, it works! But did you find it slowed down your internet connection a bit?
 
Ziglet

Glad to hear it works for you!!! Man I wish this was working for everyone else!!

About the speed, you're right, main reason being (and I just worked this out tonight) DNS.

You see in my excel file I included the variable usepeerdns in the pppd command, there really isnt a reason for the inclusion of that variable since DNS is already set up with the initial IS account signing in. I removed that variable (from cell B16) reran the script and sent the settings to the router and now it seems to be flying. One thing to remember is that if the IS news server is saturating your line, your international browsing will suffer to a certain extent, but given the performance of that ****e server the last couple of weeks saturating your line through it is near impossible!!!

As far as I know, the connection should survive a reset, the demand variable in the pppd command does this (I think). The new account settings will however not survive a router reboot (as a result of loss of power say for example). Zilet did you include error checking in your script, if you did, the script will abort before sending any route commands to the router (pointless sending the router over 800 commands for something that is already fully set up!). All you gotta do is edit B20 to read YES, the default settings are perfect for your router.

I am still spending a little time on my tool, just cant get the freeking NetGears to do what I want!!!!! Frustrating...

I gotta get the big guns to get a poll going on what routers are in use on the forum... Would be nice to see so I can concentrate my efforts accordingly!

Regards
Fausto Di-Trapani
 
While all this stuff is over my <head>, just want to say thanks Fausto for posting this info here and helping other users. And thanks for knowing how to use punctuation and capitalisation and paragraphs and structure...... (that's the equivilent of a come-on from me :D Kidding!)

I'll draw the correct person's attention here to put up a poll on what routers are being used by MyADSLers.
 
Last edited:
WOW !! Thank YOU !!! Fausto !!

I bougth a D-Link 604T just to ensure I could get this working, but it did not work out of the box. Then I saw you were running on a different firmware. Updated mine to the same firmware, and BOOM, working PERFECT !

Thanks A MILLION for this... Now, I just need to find out how this News server works :)
 
Sleeper,

Whoa that makes 2 users that I have sorted out!!! I'm itching to get this to work for many others! This has really imporved my internet experience and I sincerely hope it does the same for you and Ziglet alike.

Many thanks for the feedback regarding the firmware, I have updated my Google page. The NetGear issue is really getting under my skin, but I am working on one final hack before I call it quits and go out and buy myself a NetGear and bend the thing until it does what I want it to do...

I am too competitive to let this get the better of me!!!

Regards
Fausto Di-Trapani
 
Fausto, this is brilliant! Exactly the kind of solution I was looking for.

Unforuntately I have a Billion 7202GR2, which seems to run a REALLY watered down OS. I can't find anywhere in the CLI to enable a second PPPoE session :(

But kudos to you for sharing your solutions with everyone, anyway - you're doing those with semi-powerful routers a great service :)
 
Good job Fausto!

Took your idea and tweaked it a little to get some decent local news server speeds (IS).

Made 3 pppoe connections and 3 user accounts on my linux file server. Then used the iptables owner match to mark outbound connections based on those UIDs. Setup iproute2 to look for these marks and then direct them through different ppp interfaces, and setup the default gateway. Did a test on www.hostip.info and got a different ip coming out of each user. Then setup SABnzbd (my fav nzb client ;o) for each user, and made 4 connections to work.isdsl.net and another 4 to ethon.isdsl.net for each user. I found that connecting directly to these news servers without going through news.is.co.za causes the servers to kill you after a while, requiring you to get a new ip and start again (load balancing issue?). So i setup a script for each user to ping news.is.co.za every 5 mins, which solved this problem. Been averaging 350KB/s for pretty much this whole week.

speedometer.py showing 3 pppoe connections and 1 eth0 (modem):
[.] - last sample only
[c] - last few samples smoothed
[A] - average of all samples taken

http://i86.photobucket.com/albums/k83/k4v/k4_1.jpg

SABnzbd:
http://i86.photobucket.com/albums/k83/k4v/k4_2.jpg

Sorry for the HIGH QUALITY pics ;p

Cheerz
--K4
 
I've been looking into this a bit more, and like I said, I don't think my router can do this, and I don't have a Linux file server lying around.

However the WinXP 'Route' command looks like it can do the same thing. The only problem I can see is that you HAVE to specify a gateway IP (from the tests I did. Just specifying the interface doesn't work).

This obviously isn't too useful if your IP gets reset every 24 hours. Does anyone else more knowledgable than me have 2 or 3 cents to add regarding the Windows routing table?
 
Took your idea and tweaked it a little to get some decent local news server speeds (IS).

--K4

I would not go around splashing this around. A lot of people will start to get very irritated as they having trouble just getting some decent speeds on IS news server. IS implemented the max number of connections on the server for a reason and greedy buggers like you don't seem to see that...

Hope IS takes your account and limits it to 1concurrent connection...
 
Top
Sign up to the MyBroadband newsletter
X