New application to split local and international traffic - now on Telkom Router

dawbomb

Well-Known Member
Joined
Nov 3, 2009
Messages
122
I have sorted out the instructions for the Netgear DG834GU router...
 

Trigga

Active Member
Joined
Dec 5, 2008
Messages
33
glad that the DG834GU is Supported... always wondered what the PPPoE Session 2 was for!
 

silkman

Expert Member
Joined
Aug 20, 2005
Messages
1,650
Hey guys I am not too clued up on techincal issues but wanted to give this a try. I have Netgear DG834 GT not a GU do I still follow the GU setup?
I also have a laptop that connects wirelessly to the router and a desktop that is connected via a cable to the router- do I need to setup on both laptop and desktop?
 
Last edited:

Vimage

Member
Joined
Mar 25, 2009
Messages
23
Wow nice. I wish local traffic was billed separately and local traffic should at least be unshaped!
 

ArminM

Well-Known Member
Joined
Apr 12, 2005
Messages
149
Wow nice. I wish local traffic was billed separately and local traffic should at least be unshaped!
If you get a local only account then it would be billed seperately, and it then isn't shaped either.

basically, have one account for local only and one account to do the international stuff.
 

AndrewGoldy

Active Member
Joined
Jun 19, 2007
Messages
85
I don't know if I really trust a script like this.

I think that I'm going to give that one ISP's account a try, where they automatically split your Int/Local for you!
 

Pythonista

Well-Known Member
Joined
Dec 28, 2009
Messages
403
I have been testing this script on my Duoplus300 for the last 3 weeks of last month - and I am very happy. Many thanks.
But it seems that there is one tiny little piece missing -> If you have a Telkom Internet (as your local) and another ISP
(I have Afrihost), you still have the "problem" of getting through the international part of the Telkom account first.
Now the whole point of the script is to hack only once in the modem setup and then never need to touch it again
(apart from rerunning the given script after reboot). It would seem that a "use-only-ppp1-for-ALL-access" mode is
required UNTIL the cap runs out, at which point the normal "route-local-to-ppp1-rest-to-ppp0" should be used.
Comments ? Any ideas on how to get this going ?
I'm sure it's just a route fix, but it's a mystery to me.
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,171
Hey pythonista,

Unfortunately there's no way to automate the changeover, however you can script it easily that you can run from your PC.

The easiest would be to disable the secondary (non-Telkom) account while your Telkom account still has international access.
I think something like the following would work:
Code:
ifconfig ppp2 down
To enable it again you need to run
Code:
ifconfig ppp2 up
before attempting to add all the international & local routes again.
Note: When you're just disabling the international account and then re-Enabling it again, the list of local routes would actually remain on the router. Thus it won't be necessary to setup all the local routes again. Just ensure that your ppp2 overrides the default gateway.

Typically my script would be something like:
Original script, where you're splitting Telkom (ppp1) as your local vs 2nd-account (ppp2) as your international:
Code:
# Enable ppp2
ifconfig ppp2 up
# Set ppp2 as default
route add -net 0.0.0.0 netmask 128.0.0.0 ppp2
route add -net 128.0.0.0 netmask 128.0.0.0 ppp2
# Add RSA routes for ppp1
route add -net 41.0.0.0 netmask 255.0.0.0 ppp1
...
Telkom (ppp1) as local & international:
Code:
# Disable ppp2
ifconfig ppp2 down
# Ensure that ppp1 can be used for all destinations
route add -net 0.0.0.0 netmask 0.0.0.0 ppp1
 

Pythonista

Well-Known Member
Joined
Dec 28, 2009
Messages
403
Thanks Pada. I'll give this a bash tonight. Just a small question - are the device names not "ppp0=international" and
"ppp1=telkom" ? I which case there's a small mod required - but I will test this tonight anyway.
I appreciate one can't automagically (or easily) detect the available cap on the Telkom line, but the user
invariably does know when his cap has expired - so running a separate script is very much an option.
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,171
... Just a small question - are the device names not "ppp0=international" and
"ppp1=telkom" ? I which case there's a small mod required - but I will test this tonight anyway...
The numbering are in the order the WAN connections are created. If you created your Telkom one before your international connection, then your Telkom one would be named ppp0 and the international one ppp1.
 

Pythonista

Well-Known Member
Joined
Dec 28, 2009
Messages
403
OK - I think I have this working. I have a Telkom Duoplus300WR, and I based the script below on the original scripts that separate
the international (ppp0) and local (ppp1). Then I used a bit of what Pada suggested, a bit of google and a bit of luck !

Remember the whole point is to use up the 5 GB international that Telkom supply as part of the deal as quickly as possible, so
that the cap can be reached and then we spill over into genuine local only. No point in letting Telkom get away with more
than it already does :)

Adapt as you need :

#!/bin/sh


#If your router's IP address is not 10.0.0.2, adjust the following line accordingly
host="10.0.0.2"

#If your router's login user is not root, adjust the following line accordingly
user="root"

#In the line below, replace <password> with your router login password:
passwd="password"

#If your router's local interface is not ppp1, adjust the following line accordingly
telkom_if="ppp1"
afrihost_if="ppp0"
telkom_gw="41.145.32.1"

echo "#!/usr/bin/expect --" > telkomrouter.sh

# Perform login
cat >> telkomrouter.sh << EOF

spawn telnet
expect "telnet>"
send "open $host\r"
expect "ogin: "
send "$user\r"
expect "word: "
send "$passwd\r"
expect "# "
send "route add default gw $telkom_gw\r"
expect "# "
send "ifconfig $afrihost_if down\r"
expect "# "
send "route add -net 0.0.0.0 netmask 0.0.0.0 $telkom_if\r"
expect "# "
send "exit\r"
send "!\r"
expect "$ "
EOF

# Make telkomrouter.sh executable
chmod a+x telkomrouter.sh

# Execute script
./telkomrouter.sh
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,171
Pythonista, the following 2 lines are redundant:
Code:
send "route add default gw $telkom_gw\r"
send "route add -net 0.0.0.0 netmask 0.0.0.0 $telkom_if\r"
The last one is the preferable one! Since it would work for any interface and not just Telkom accounts...

Another thing you have to remember. Once you enable your Afrihost account, you have to remove the default route on the Telkom interface again OR add smaller IP blocks for the Afrihost account to override the Telkom default route.
Here are the 2 options:
Code:
#Remove Telkom interface's default route
send "route add -del 0.0.0.0 netmask 0.0.0.0 $telkom_if\r"
expect "# " 
#Enable Afrihost again
send "ifconfig $afrihost_if up\r"
expect "# " 
#Add default route for Afrihost
send "route add -add 0.0.0.0 netmask 0.0.0.0 $afrihost_if\r"
expect "# "
Code:
#Enable Afrihost again
send "ifconfig $afrihost_if up\r"
expect "# " 
#Override Telkom's default route with smaller blocks with the Afrihost account
send "route add -add 0.0.0.0 netmask 128.0.0.0 $afrihost_if\r"
expect "# "
send "route add -add 128.0.0.0 netmask 128.0.0.0 $afrihost_if\r"
expect "# "
 

Saber

Well-Known Member
Joined
Mar 7, 2005
Messages
116
Hi Chaps

My old D-Link DSL-2500U got fried this week so I bought a new one yesterday afternoon. It has newer firmware which I updated to the latest (DSL-2500U_BRU_D_RU_1.54_12162009).

However, I can no longer get the script to work: telnet no longer seems to support any arguments such as "-n" or "-net", etc.

Do you happen to know what the issue might be?
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,171
Saber, I find it hard to believe that 'route -n' and 'route add -net <ip address> netmask <subnetmask> <network interface>' doesn't exist any more. I think you should log in on the router using Telnet - without the script - and see if those commands exists. Simply type in 'route -h'
 

Saber

Well-Known Member
Joined
Mar 7, 2005
Messages
116
Hi Pada

Thanks for responding and being willing to help.

Script
The script seems to freeze when trying to send the first "route add" line. I've tried editing this in various ways.

Telnet
I am able to log in. Here are the results of several commands and their responses
"route -h"
route: invalid option
"route -n"
route: invalid option
"route add -net 41.0.0.0 netmask 255.224.0.0 ppp_0_8_35_2"
route: invalid parameters for option 'add'
"route add 41.0.0.0 netmask 255.224.0.0 ppp_0_8_35_2"
route: invalid subnet mask 'netmask' for option 'add'
"route add 41.0.0.0 255.224.0.0 ppp_0_8_35_2"
is not default cfg.
I'd really appreciate it if you would be able to help me out here. I'm not sure if there is a setting on the firmware that I'm unaware of.
 
Last edited:

W@P

Expert Member
Joined
Sep 10, 2007
Messages
3,694
Hey Guys

I have a mega 100wr and the ip is 192.168.0.215 and the login is admin - admin.
Now I have followed the steps to change the ip in the script and so on but I keep getting the followin message when I run the batch file.

BusyBox on localhost login: admin
admin
Password: admin

route add -net 41.0.0.0 netmask 255.224.0.0 ppp1
route add -net 41.0.0.0 netmask 255.224.0.0 ppp1
Login incorrect

BusyBox on localhost login: Password:


This is the exact message I get when running the batch file. I have both connections connected in my router but my local account shows no usage.

Any help please ? ?

TIA
 

Pada

Executive Member
Joined
Feb 18, 2009
Messages
8,171
Saber, sorry for getting back to you so late. Feel free to PM me if you want a quick response.
My guess is that you'll have to get a different firmware that includes those standard commands.

W@P, I think your script executed too fast, without waiting for the appropriate response from the router. Ensure that your script starts with:
Code:
192.168.0.215
wait "ogin: "
send "admin\m"
wait "word: "
send "admin\m"
 

W@P

Expert Member
Joined
Sep 10, 2007
Messages
3,694
Saber, sorry for getting back to you so late. Feel free to PM me if you want a quick response.
My guess is that you'll have to get a different firmware that includes those standard commands.

W@P, I think your script executed too fast, without waiting for the appropriate response from the router. Ensure that your script starts with:
Code:
192.168.0.215
wait "ogin: "
send "admin\m"
wait "word: "
send "admin\m"
Ok here is my script, only thing i changed was the ip. the rest is as i got it from the website. any ideas. should i keep it on ppp1 or change it?


Code:
192.168.0.215
 wait "ogin: "
 send "admin\m"
 wait "word: "
 send "admin\m"
send "route add -net 41.0.0.0 netmask 255.224.0.0 ppp1 \m"
wait "# "
send "route add -net 41.66.64.0 netmask 255.255.192.0 ppp1 \m"
wait "# "
send "route add -net 41.72.128.0 netmask 255.255.248.0 ppp1 \m"
wait "# "
s
 

Terata

Active Member
Joined
Jul 7, 2009
Messages
35
I got Telkom Netgear and I want to split my traffic I am using ubuntu as my OS please people help I also want to benefit
 
Top