Ros3 Split Local International

From CTWUG Wiki
Jump to: navigation, search

Info

The following is a guide on how to route traffic across two (or more) ADSL accounts, based on destination IP address.

Setup

ADSL Accounts

First, you need to create your 2 ADSL accounts. For the sake of this demo I will call them "ADSL-LocalOnly" and "ADSL-International"

Click on Interface->Add new->PPPoE Client (The little red plus at the top left of the interface window)

Enter a name and select your Ethernet port (the one that is connected to your ADSL modem) on the General tab. Enter your ADSL user name and password on the Dial Out tab.

For the local only account, uncheck the "Add Default Route" option.

"Add Default Route" lets your router know that any traffic that it does not know where it should go it must pass on to this interface. So, turn this off for all the ADSL accounts except one.

NAT

The second step is to allow multiple computers on your network to use the ADSL account on your routerboard. This is called NAT, Network Address Translation.

Click IP->Firewall. On the NAT tab add a new rule (red plus at the top left of the NAT window) Enter you computers network range into Source Address (eg. 172.18.18.0/28) on the General tab. On the Action tab choose "masquerade" action.

Do this for all your ADSL accounts you plan to share.

Routing

The last step is to tell your router what traffic needs to go over what ADSL account.

Remember, any traffic that it does not know what to do with will go over the account that has "Add Default Route" selected.

So, all you need to do is tel it what to send over the LocalOnly account.

TFyre wrote a nifty script that automatically loads all the local routes. Create a new script and schedule it to run about once a week and your routes should always be up to date:

#Change Interface for Local Only ADSL Account
:local int "adslLOCAL"

#DONT CHANGE ANYTHING BELOW THIS LINE
:local file "adslroutes"
:if ( [/file find name=($file.".rsc")] != "" ) do=[/file remove ($file.".rsc")]
/tool fetch address=web.ctwug.za.net src-path=("ctwug/".$file.".php?type=1&interface=".$int) dst-path=($file.".rsc")
:delay 1
/import $file

Gaming

If you are into online gaming you can extend this method to split all your online gaming traffic onto an expensive unshaped or semi shaped account.

Simply create another ADSL account and route the game servers traffic through that account.

You can use the Torch function on your International ADSL interface to see where traffic is going while you game, then set up a route for that traffic.

Same can be applied to VoIP and other latency dependent applications.