Routing local + international traffic through separate adsl accounts

From MikroTik Wiki
Revision as of 21:07, 22 July 2008 by Headstrong (talk | contribs) ('''Get a list of local IP's''')
Jump to: navigation, search

Introduction

                                    • WIKI PAGE UNDER CONSTRUCTION**********************

This tutorial will show you how to use a cheap local-only adsl account for local traffic and a normal adsl account for international traffic. This will work for your mikrotik web proxy aswell

This worked for me in ROS 3.10 but should work for all ROS 3.x


Create the two pppoe connections


Steps for International ADSL Account
1) click on "Interfaces:                                                       
2) click on the red cross to add a new interface.                        
3) select pppoe client.                                                  
4) under General, select the interface which is connected to your modem.
5) under dial out, add your normal adsl account's username and password. Make sure that "add default route is on",
"dial on demand" is off and "use peer DNS is off"
6) click apply
7) Add another pppoe client but use your local-only adsl account

Steps for Local-only ADSL Account
Do steps 1-7 above but make sure that "add default route is OFF"


Notes: Both pppoe client connections can share the same interface   

                 


Create the routes

There should already be a default route which sends all internet traffic over the international adsl account. Local traffic also gets routed over the same account so we need to create individual routes for this

Firstly you need to get a list of your countries specific IP ranges. I am from south Africa so I use this one http://alm.za.net/ip/localroutes4.txt....You should use your country specific ip addresses

Copy the list into microsoft excel and edit the cells so that they read.

/ip route add dst-address=aaa.aaa.aaa.aaa/aa gateway=yyy.yyy.yyy.yyy.
/ip route add dst-address=bbb.bbb.bbb.bbb/bb gateway=yyy.yyy.yyy.yyy.
/ip route add dst-address=ccc.ccc.ccc.ccc/cc gateway=yyy.yyy.yyy.yyy.


Replace aaa.aaa.aaa.aaa/aa with the local ip ranges. Replace yyy.yyy.yyy.yyy with the gateway ip from the local adsl account.

Example

/ip route add dst-address=17.255.248.0/23 gateway=165.146.180.1
/ip route add dst-address=32.106.152.0/24 gateway=165.146.180.1
/ip route add dst-address=32.106.153.0/24 gateway=165.146.180.1
/ip route add dst-address=32.107.9.0/24 gateway=165.146.180.1
/ip route add dst-address=32.238.152.0/24 gateway=165.146.180.1
/ip route add dst-address=32.238.153.0/24 gateway=165.146.180.1
/ip route add dst-address=32.239.182.0/24 gateway=165.146.180.1
/ip route add dst-address=41.0.0.0/16 gateway=165.146.180.1
/ip route add dst-address=41.0.16.0/21 gateway=165.146.180.1
/ip route add dst-address=41.0.72.0/21 gateway=165.146.180.1
/ip route add dst-address=41.0.208.0/22 gateway=165.146.180.1
/ip route add dst-address=41.0.248.0/24 gateway=165.146.180.1
/ip route add dst-address=41.1.0.0/18 gateway=165.146.180.1
/ip route add dst-address=41.1.64.0/18 gateway=165.146.180.1
...
...
...

We have +-1300 routes for South africa so I obviously didnt put them in the wiki but you get the idea

To get the ip of your ISP specific gateway:

1) Click on "IP" > "Addresses"
2) It is the Network ip address for the pppoe-out2 (local) interface