• You are losing out on amazing benefits because you are not a member. Join for free. Register now.
  • Big Two-Day Giveaway - Win an Amazon Kindle, a Mystery Gadget and Branded Gear. Enter Here.
  • Test your broadband speed and win prizes worth R5,000. Enter here.

Telkom Mega100WR2 - International and Local Traffic Splitting

Flint

Well-Known Member
Joined
Jun 2, 2005
Messages
266
#42
Ok, so with the above (insanely obvious) login in hand, I telnetted into the router this evening and got into the cli (ooh, new toy! :) ). Unfortunately, despite what 2C said on the first page of this thread it doesn't seem as if it's possible to create the second connection that way after all. The issue (which would seem to cause the above web interface 'bug' as well) is that the cli will not accept the same VPI/VCI for the second connection. After setting up the second connection, I try to apply it and receive the error:
--- vpi:vci matches existing connection: ppp1
% Apply not accepted. Please fix the above issues first
For reference, the following is the series of commands entered:
Code:
enable 5 
<enter default enable password "Admin"> 
wan
connection 2
connection type pppoe
connection name ppp2
atm pvc 8 35
atm qos ubr
nat enable
firewall enable
ppp authentication type auto
ppp authentication username <ADSL_USERNAME>
ppp authentication password <ADSL_PASSWORD>
ppp connection-mode keep-alive time 10
apply
<error here because pvc settings clash with already existing connection>
I may have missed a few settings but thats why i was trying to apply-so I could see current state with show.

Does anyone know if deleting the existing connection through the web interface and then creating both connections manually through the cli before applying and saving would help? If so if I get time tomorrow night I'll try that.

[EDIT]
One other thing. After posting this I tried setting the pvc to something different so I could just try and apply these settings. This did of course work and as expected the new connection is viewable in the web interface, however it's not shared and I don't see how this would be set with the cli (doing a show on the two connections gives identical results except for name, login and pvc). Any ideas?
[EDIT]
 
Last edited:

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#43
u need to do a manual connect from linux cmd line:

Code:
pppd plugin pppoe nas0 user XXXXXX password XXXXXX defaultroute mtu 1400 mru 1492 maxfail 10 demand idle 65520
set up ur local isp account on web interface and then use ur international account on this one. If doing it the outher way round then remove the defaultroute option.
 

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#44
What's up with these ping results (run from the router). Below is info from the router. I am able to browse both local and international sites. But when I run a wget from the router the host is unkown even though when I ping it I get results.

Code:
# ping www.google.com
PING www.l.google.com (64.233.189.104): 56 data bytes
64 bytes from 64.233.189.104: icmp_seq=0 ttl=246 time=320.0 ms
64 bytes from 64.233.189.104: icmp_seq=0 ttl=246 time=1330.0 ms (DUP!)
64 bytes from 64.233.189.104: icmp_seq=1 ttl=246 time=1010.0 ms
64 bytes from 64.233.189.104: icmp_seq=1 ttl=246 time=2020.0 ms (DUP!)
64 bytes from 64.233.189.104: icmp_seq=2 ttl=246 time=2020.0 ms
64 bytes from 64.233.189.104: icmp_seq=2 ttl=246 time=3030.0 ms (DUP!)
64 bytes from 64.233.189.104: icmp_seq=3 ttl=246 time=3030.0 ms
64 bytes from 64.233.189.104: icmp_seq=3 ttl=246 time=4040.0 ms (DUP!)

--- www.l.google.com ping statistics ---
8 packets transmitted, 4 packets received, 4 duplicates, 50% packet loss
round-trip min/avg/max = 320.0/2100.0/4040.0 ms
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
196.209.xxx.xxx    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
196.43.xxx.xxx   0.0.0.0         255.255.255.255 UH    0      0        0 ppp1
196.43.xxx.xxx   0.0.0.0         255.255.255.255 UH    0      0        0 ppp1
41.241.xxx.xxx    0.0.0.0         255.255.255.255 UH    0      0        0 ppp1
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 br0
239.0.0.0       0.0.0.0         255.0.0.0       U     1      0        0 br0
0.0.0.0         41.241.xxx.xxx    0.0.0.0         UG    0      0        0 ppp1
0.0.0.0         196.209.xxx.xxx    0.0.0.0         UG    0      0        0 ppp0
# ifconfig ppp0
ppp0      Link encap:Point-Point Protocol
          inet addr:196.209.xxx.xxx  P-t-P:196.209.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1  ASYMMTU:1500
          RX packets:588 errors:0 dropped:0 overruns:0 frame:0
          TX packets:484 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:239220 (233.6 kb)  TX bytes:43332 (42.3 kb)

# ifconfig ppp1
ppp1      Link encap:Point-Point Protocol
          inet addr:41.244.xxx.xxx  P-t-P:41.241.xxx.xxx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1  ASYMMTU:1500
          RX packets:1264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:631218 (616.4 kb)  TX bytes:186546 (182.1 kb)
umm u have two default routes that may be an issue, try removing one.
 

Flint

Well-Known Member
Joined
Jun 2, 2005
Messages
266
#45
Having created the route as above:
Code:
# ifconfig ppp0
ppp0      Link encap:Point-Point Protocol
          inet addr:41.242.101.229  P-t-P:41.242.64.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1  ASYMMTU:1500
          RX packets:3206 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3343 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1682451 (1.6 Mb)  TX bytes:511549 (499.5 kb)

# ifconfig ppp1
ppp1      Link encap:Point-Point Protocol
          inet addr:10.64.64.65  P-t-P:10.112.112.113  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1  ASYMMTU:1500
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
I added tried routing on ppp1 (local account) to news24:
Code:
# route add -net 196.14.52.0 netmask 255.255.255.0 ppp1
However on tracerting to 196.14.52.227 i find the second hop (where I hope to see which ppp is in use) times out and I think[/] the default routing takes over:
Code:
Tracing route to www.news24.co.za [196.14.52.227]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  login.router [10.0.0.2]
  2     *        *        *     Request timed out.
  3    36 ms    39 ms    36 ms  rrba [196.43.9.121]
  4    37 ms    39 ms    39 ms  196.43.25.138
  5    38 ms    40 ms    36 ms  internet [196.25.127.182]
  6    37 ms    40 ms    38 ms  168.209.86.165
  7    37 ms    39 ms    39 ms  core1a [196.26.0.7]
  8    61 ms    61 ms    59 ms  168.209.100.74
  9    61 ms    59 ms    59 ms  168.209.6.252
 10     *        *        *     Request timed out.
 11    60 ms    61 ms    62 ms  www.news24.co.za [196.14.52.227]

Trace complete.
I also found that ppp1 kept mysteriously disappearing (ifconfig would report a missing device) and would have to be re-added. Has anyone progressed beyond this point yet?
 

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#46
Maybe the guy from 2C could give some advice here. I don't have two accounts to test myself once I do then I might be able assist in more detail as in debugging specific issues.
 

Flint

Well-Known Member
Joined
Jun 2, 2005
Messages
266
#47
Thanks. Yeah he's been quiet for a while ;)
As for a second account, if you do want to get one go for the WebAfrica local top up. R20 will get you a gig that doesn't expire-perfect for testing ;)
 

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#48
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         196.209.xxx.xxx    0.0.0.0         UG    0      0        0 ppp0
I guess I need to setup that account with Default Gateway unticked.
 

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#49
yeah. You want the default route to be ur international one because u explicitly setting routes for the local account i.e. the non default routes.

if you have two default routes OS normally pushes out on the one with better metric but if they both have the same metric it may be pushing the same data out on both and getting very confused!
 

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#50
Good news: I've been able to split traffic between local and international at the router level.

Bad news for most: I only have an instruction set for linux users. By that I mean the theory has already been covered as to how it should work. But I went about the practicality of setting up the router from a Linux box. I need to tidy up how I did it but when I do (and post it here), you will see why it is specific to Linux users.
 

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#52
I suppose I might as well post my findings from the easier part. I followed 2CTelecoms instructions on the previous page:

1. I deleted the existing quickstart profile on the router.
2. Applied, Saved the settings and rebooted the router.
3. When it starts up again (after logging in), it will start you through the 'quickstart wizard'.
4. I clicked on the Advanced tab (ie I did not follow the wizard).
5. WAN --> New Connection.
6. Importantly, I setup the connection as quickstart. I found through experience that the router seems to need a quickstart profile.
7. quickstart is the international connection (ppp0). Set Sharing to Enable and VPI and VCI as 8 and 35 respectively. Enter login details. Everything else you can leave.
8. Apply, Save Settings.
9. WAN --> New Connection
10. Give the connection a name. Since it is the local one I called mine local. This is ppp1.
11. Enable Sharing. Set PVC to 8:35. Untick Default Gateway. Also enter login details of your local account.
12. Apply. Save Settings. Connect. Apply. Save Settings. Reboot Router. (This is overdo I suspect but hey).
13. Your router is now ready to take instructions as to how to split traffic.

If you do not have the routers with problems,
you should be able to do from a command line (linux or windows)

1. telnet 10.0.0.2
2. Enter username --> root
3. Enter password --> <Router Password>
4. Enter shell
5. Enter ifconfig

ifconfig should show ppp0 and ppp1 with IP addresses beginning with 41 and 196 respectively.

Here is the script that prepares everything (I've called it prepare_netroutes.sh)

Code:
#!/bin/sh
cd ~
curl http://alm.za.net/ip/localroutes4.txt | while read line
do
  [ "$( echo $line | grep \/32 )" ] && line=$( echo $line | sed s/net/host/ )
  echo $line | sed s/\$LOCAL/ppp1/
done > ~/newroutes.txt
cat ~/newroutes.txt | while read route
do
  export $(ipcalc -m $(echo $route | sed -e 's/^.*net\ \([0-9\.\/]*\).*$/\1/'))
  echo $route | sed -e "s/\/[0-9]*/ netmask $NETMASK/"
done > ~/netroutes.txt
rm -f localroutes4.txt
rm -f newroutes.txt
cat netroutes.txt | grep route > clean.txt
cat clean.txt | while read line
do
   echo 'send "'$line'\r"'
   echo 'expectprompt "#"'
done > routes.txt
rm -f setrouter.sh
cat routerlogin.txt routes.txt dns.txt > setrouter.sh
chmod +x setrouter.sh
rm -f netroutes.txt
rm -f routes.txt
rm -f clean.txt
I've only run it on my Debian install and there is a small problem which entails manually deleting environment variables in setrouter.sh before running it.

Code:
[root:~#] cat routerlogin.txt
/usr/bin/expect << EOF
proc expectprompt { txt } {
expect {
\$txt {}
timeout exit;
eof exit;
}
}

set timeout 60
spawn telnet 10.0.0.2
expectprompt "login:"
send "root\r"
expectprompt "Password:"
send "insert_your_router_password_here\r"
expectprompt "cli>"
send "shell\r"
expectprompt "#"
Code:
[root:~#] cat dns.txt
send "route add -host 196.43.46.190 ppp0\r"
expectprompt "#"
send "route add -host 196.43.38.190 ppp0\r"
expectprompt "#"
send "exit\r"
expectprompt "cli>"
send "quit\r"
So I have dns.txt and routerlogin.txt in my home directory. you also need to ensure that that the expect package is installed. You need to make sure the script is set to be executable by doing a chmod u+x prepare_netroutes.

Then what you do is run the prepare_netroutes script. This will create a file called setrouter.sh. Then run setrouter.sh to setup the routes on the router.

You will also need the following 2 files in any directory in your path.

/usr/bin/expect

/bin/ipcalc

Use this particular ipcalc especially as for instance the one I got for my Debian off the repos didn't work with this script. The ipcalc that works is the one from FC7.

DISCLAIMER: As always, if something goes wrong with your config. it is not my problem. You do this at your own risk.
 
Last edited:

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#53
ok, that all seems straightforward. now we need the issue u had and why u had to use another linux server to fix it.
 

scud

Senior Member
Joined
Sep 1, 2005
Messages
766
#54
this solution should be an awsome breakthrough!!
would this mean that the 100wr could effectively do the same as routesentry?

if so would there be any differences or advantages of using either routsentry or the 100wr to split local/int trafic?

just guessing here, but if it works, will the 100wr will loose all routing settings on reboot?
 

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#55
z3r3 - my main OS is always a linux install (whether it be debian, FC or some other variant). That is why my solution is linux based.

Here is the script that prepares everything (I've called it prepare_netroutes.sh)

EDIT: Instructions moved to post above (Post #52)
 
Last edited:

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#56
scud - unfortunately the router seems to lose all that even if I Save Settings after running the setrouter.sh.

That is probably something that must be fixed by firmware. That is, for the routing table not to be erased on reboot.
 

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#57
ok thats kewl. I thought u meant u set up the routing to the various interfaces on linux not that u scripted it thru to the router thru linux.

Based on what u've done its straight forward to make a script for XP. I'll prolly take what u've done and combine in with the spreadsheet macro from that other dude on the forums.

My next step is to get the gpl code from 2C and then compile the script into the image for the device so it isn't lost at bootup. What I might do is see if I can script programming static routes into the device via the interface but I'll have to see about that one.
 
Last edited:

Flint

Well-Known Member
Joined
Jun 2, 2005
Messages
266
#58
z3r3 if you manage to get hold of 2C an get the code please get in touch with me on PM, I'd like to see if I can help with adding those routes on the interface. Also, since I have one of the old (read-fubar) routers that need the second interface set up manually if I figure the local ip issue sorted out I'll post step by step procedures for setting that up as well.
 

z3r3

Active Member
Joined
Jun 14, 2007
Messages
34
#59
After checking out the cli quite thoroughly (I found a cpl manuals and syntax guides), I can see two problems as far as I can figure:
1) I can only add 30 static routes
2) It has to be an IP as gateway not named connection.

So I guess there's no way to use that cli to setup and save into flash all the routes I need :(. That pretty much leaves needing to get the GPL code.
 

milomak

Honorary Master
Joined
May 23, 2007
Messages
12,089
#60
Yeah when I was going through the web interface (routing table), I noticed that there seemed to be fewer than the 917 routes in the localroutes4.txt file.

EDIT: Running route -n from the router shows a whole lot more routes. And actually if I save the scripts file from the option to show the routing table (option seems to only come up if you access that page running Konqueror), the resultant file has all the routes so it loads them all no problem.
 
Last edited:
Top