Community discussions

MikroTik App
 
ianjay06
just joined
Topic Author
Posts: 7
Joined: Sun Mar 18, 2018 5:02 pm

2 ISP Separate for Browsing and Online Games

Sun Mar 18, 2018 5:07 pm

Good Day...

I already Setup my Mikrotk HexLite for Single ISP, but for future purposes i want to setup it with 2 isp.

Im new to Multiple ISP so please understand me.. thanks...

My Plan is:

WAN1 will purely browsing (ex. facebook, youtube)
WAN2 also purely for Online games like dota 2

How should i do that?

ISP 1 gateway is : 192.168.8.1
ISP 2 gateway is : 192.168.7.1

is their any scripots to properly detect the gateways... without changing in routing mangles, etc..

thanks
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 23384
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 19, 2018 3:56 pm

1. Do you want failover at all. If one ISP becomes unavailable is there a case where LAN1 should use ISP2, or LAN2 should use ISP1 ??

2. Do you want any traffic between LAN1 or LAN2 or fully closed off??

3. Do you as an admin want to be able to reach certain devices on LAN2 if on LAN1 or vice versa, on LAN2 and want to reach devices on LAN1.

4. Assuming you want ISP1 bandwidth to go only to LAN1 and ISP2 bandwidth only to be available to LAN2 ??

5. Did you want to ensure equal sharing of BW amognst users in a particular LAN?

6. Did you want to ensure minimum bandwidth available to specific users in any particular LAN?
 
User avatar
null31
Member Candidate
Member Candidate
Posts: 183
Joined: Fri Dec 23, 2016 6:07 pm
Location: Brazil

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 19, 2018 4:38 pm

Hi.
The most easy way is to mark route on that destination subnets, fasttrack cannot be active.
A example of my use with various pppoe-client running.
This is a basic configuration that assume you have NAT masquerade enabled and fasttrack disabled.
/ip firewall address-list
add address=185.50.104.0/22 list=some-game comment=rl-br
add address=169.57.165.64/26 list=some-game comment=pugb
add address=208.67.48.0/23 list=some-game comment=tera-na

/ip route
add distance=3 gateway=wan1-pppoe
add distance=9 gateway=wan2-pppoe
add disabled=no distance=10 gateway=wan2-pppoe routing-mark=games-routing

/ip firewall mangle
add action=mark-routing chain=prerouting comment=mark-games disabled=no dst-address-list=some-game new-routing-mark=games-routing passthrough=yes
Remember to uncheck add-default-route in your setup to get WAN (dhcp, pppoe). If method is dhcp, you need specify the gateway address on gateway=xxx.xxx.xxx.xx instead the interface name.
 
HzMeister
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Sun Jan 28, 2018 9:48 pm

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 19, 2018 7:00 pm

lol why would you get a second isp for only online games?
 
User avatar
null31
Member Candidate
Member Candidate
Posts: 183
Joined: Fri Dec 23, 2016 6:07 pm
Location: Brazil

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 19, 2018 10:52 pm

lol why would you get a second isp for only online games?
I guess latency and when has many devices using the network.
I know many ISPs that sell 2Mbps~15Mbps over FTTH while others ISPs sell vdsl with rates of 20Mbps~70Mbps and doesn't have a good latency.

I want to hire another FTTH ISP because their route is short and very stable, but they do traffic sharping to international route leaving on 3Mbps. My current FTTH ISP has a unstable route to many games, but has great speed to national and international route.
This is why I prefer to have two WANs than one, here doesn't have one ISP that meets all my requirements.
 
ianjay06
just joined
Topic Author
Posts: 7
Joined: Sun Mar 18, 2018 5:02 pm

Re: 2 ISP Separate for Browsing and Online Games

Sun Mar 25, 2018 4:25 pm

1. Do you want failover at all. If one ISP becomes unavailable is there a case where LAN1 should use ISP2, or LAN2 should use ISP1 ??

2. Do you want any traffic between LAN1 or LAN2 or fully closed off??

3. Do you as an admin want to be able to reach certain devices on LAN2 if on LAN1 or vice versa, on LAN2 and want to reach devices on LAN1.

4. Assuming you want ISP1 bandwidth to go only to LAN1 and ISP2 bandwidth only to be available to LAN2 ??

5. Did you want to ensure equal sharing of BW amognst users in a particular LAN?

6. Did you want to ensure minimum bandwidth available to specific users in any particular LAN?
1. no, and i only want 1 lan setups as bridge
2. dont know what you mean by this
3. i only want 1 lan .
4. nope.. isp 1 should go to lan 1 , and isp 2 go to lan1 also. only specific sites like youtube should go to isp 1 and only online games should go to isp2
5. im not planning on load balancing
6. maybe
 
ianjay06
just joined
Topic Author
Posts: 7
Joined: Sun Mar 18, 2018 5:02 pm

Re: 2 ISP Separate for Browsing and Online Games

Sun Mar 25, 2018 4:26 pm

Hi.
The most easy way is to mark route on that destination subnets, fasttrack cannot be active.
A example of my use with various pppoe-client running.
This is a basic configuration that assume you have NAT masquerade enabled and fasttrack disabled.
/ip firewall address-list
add address=185.50.104.0/22 list=some-game comment=rl-br
add address=169.57.165.64/26 list=some-game comment=pugb
add address=208.67.48.0/23 list=some-game comment=tera-na

/ip route
add distance=3 gateway=wan1-pppoe
add distance=9 gateway=wan2-pppoe
add disabled=no distance=10 gateway=wan2-pppoe routing-mark=games-routing

/ip firewall mangle
add action=mark-routing chain=prerouting comment=mark-games disabled=no dst-address-list=some-game new-routing-mark=games-routing passthrough=yes
Remember to uncheck add-default-route in your setup to get WAN (dhcp, pppoe). If method is dhcp, you need specify the gateway address on gateway=xxx.xxx.xxx.xx instead the interface name.
thanks..
but how about setting up the 2 isps?
 
solar77
Long time Member
Long time Member
Posts: 586
Joined: Thu Feb 04, 2016 11:42 am
Location: Scotland

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 26, 2018 1:19 pm

easiest way is to mark routing in Firewall, Mangle (yes, have to use mangle rules) so that the traffic from your xobx/ps4 or gaming PC is routed to ISP2.
You can even only enable this mangle rule when you play games, and disable it when you done.

or you will have to find out destination IP for the games you play and mark routing by destination IP. this is not always easy and those IP may change. this way only gaming traffic goes to ISP2 and all other traffic still goes through ISP1.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 23384
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 2 ISP Separate for Browsing and Online Games

Mon Mar 26, 2018 7:10 pm

1. Do you want failover at all. If one ISP becomes unavailable is there a case where LAN1 should use ISP2, or LAN2 should use ISP1 ??

2. Do you want any traffic between LAN1 or LAN2 or fully closed off??

3. Do you as an admin want to be able to reach certain devices on LAN2 if on LAN1 or vice versa, on LAN2 and want to reach devices on LAN1.

4. Assuming you want ISP1 bandwidth to go only to LAN1 and ISP2 bandwidth only to be available to LAN2 ??

5. Did you want to ensure equal sharing of BW amognst users in a particular LAN?

6. Did you want to ensure minimum bandwidth available to specific users in any particular LAN?
1. no, and i only want 1 lan setups as bridge
2. dont know what you mean by this
3. i only want 1 lan .
4. nope.. isp 1 should go to lan 1 , and isp 2 go to lan1 also. only specific sites like youtube should go to isp 1 and only online games should go to isp2
5. im not planning on load balancing
6. maybe
I too would love to be able to make wine from water................
In other words the requirements are challenging (at least for me with little experience).

So as to understand the correct ideas...........
You want users from a single LAN to be able to connect to a specific WAN depending upon what they are doing.
Regular use all are directed to ...........wan1, gaming directed to.......... wan2

As noted this will have to be done, if possible, with a combination of MANGLE rules (marking route) and ROUTE rules.
I would go further and state, the Mangle rules are best suited to detect gaming and that is easier to work with.

In terms of two ISPs I would set up my WAN1 as the primary and WAN2 as the secondary.
In this regard all traffic will to WAN1 (general use).
Then apply a mangle rule and IP route rule to CATCH all gaming traffic and send that out WAN2.

The difficulty as noted by SOLAR is that there is no practical way of knowing destination IPs...

a. However, you may have some success in identifying specific ports on outgoing traffic. (a first mangle rule).
b. There may be a way of identifying WORDs, such as names of games or even names of game servers (steam for example), maybe the common domain names, in some sort of address list and apply the mangle rule to the address list containing all the names.
/ip firewall address-list
add list=forceWan2 address=www.gamesiteA.com
add list=forceWan2 address=www.gamesiteB.com.
add list=forceWan2 address=www.gameserverA.com
add list=forceWan2 address=www.gameserver.B.com

I noted in the tabs of the mangle rule there is a CONTENT entry, whereby the router can match a text.
However I don't know if one can
- use a list in CONTENT?
- can put more than one word in CONTENT?
( what the format would be if one can put more than one word)?
( if the router matches any of the words or has to match all the words)??

IP Mangle
a. Chain- prerouting
source address: 0.0.0.0/0
dstn ports xx,yyy,ttttt,uuuuu, protocol TCp
In Interface: LAN
Action Mark routing
new marking route "gaming_ports_TCp"

b. Chain-prerouting
source addresss 0.0.0.0/0
dstn ports xx,yyy,tttt,uuuu, protocol UDP
In Interface: LAN
Action: Mark routing
new marking route "gaming_ports_UDP"

I am not sure if one can use the same marking route name such as 'gaming_ports" and have both rules use the same marking route????

b. Chain-prerouting
Source address; 0.0.0.0/0
Dst:address - forceWan2 address
In INterface: LAN
Action- mark routing
new marking route "gaming_domains"

Then basically create two IP routes one for each mangle rule.
Destination 0.0.0.0/0
Interface: Gateway IP of WAN2
Marking - gaming_ports

Destination 0.0.0.0/0
Interface: Gateway IP of WAN2
Marking - gaming_domains