Community discussions

MikroTik App
 
User avatar
mdsekawsar
just joined
Topic Author
Posts: 19
Joined: Tue Nov 04, 2014 12:55 am
Location: Joypurhat, Bangladesh
Contact:

How to pass traffic by different gateway in mikrotik without loadbalancing?

Sat Jun 18, 2016 11:15 pm

Dear Concern,

I am kawsar from BD and really new on this field. I don't know more about mikrotik. If anyone could help me I will be glade.

My exceptation-

I have to WAN connection on same mikrotik [CCR-1009-1S-1S+]. ether1 and ether2. I have outpur LAN on ether6. I have WAN1=25 Mbps and WAN2=20 Mbps bandwidth. I made PCC load balance and Its not working properly. When I start loadbalance, all of my customer makes complain to me that the NET is really very slow. Eventhough sometimes GMAIL is not opened. When I stop loadblance its works fine. Customer also don't have any problem.

Now lets think about another thing.

I have two WAN port in my Mikrotik CCR-1009-1S-1S+. Example: WAN1 and WAN2.

I have one LAN port named LOCAL.

I have 4 IP block for my local users. Example: 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24.

Now I want I will pass my user by two WAN port. Example: By WAN1 port I will pass 192.168.0.0/24, 192.168.1.0/24 users block and by WAN2 I will pass 192.168.2.0/24, 192.168.3.0/24. 

Could anyone help me to solve this issue and is that possible really?

Thanks
Md Sarwar E Kawsar
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: How to pass traffic by different gateway in mikrotik without loadbalancing?

Sun Jun 19, 2016 4:35 am

If load balancing gives problems, then you may have problems with simple policy routing because they're basically the same thing. Load balancing should be the best way to go - check the archives for MUM2012 USA - there were two good presentations on load balancing that year.

Google MUM USA 2012 load balancing
 
User avatar
mdsekawsar
just joined
Topic Author
Posts: 19
Joined: Tue Nov 04, 2014 12:55 am
Location: Joypurhat, Bangladesh
Contact:

Re: How to pass traffic by different gateway in mikrotik without loadbalancing?

Sun Jul 03, 2016 10:28 pm

If load balancing gives problems, then you may have problems with simple policy routing because they're basically the same thing. Load balancing should be the best way to go - check the archives for MUM2012 USA - there were two good presentations on load balancing that year.

Google MUM USA 2012 load balancing
Thanks Sir,
I got the script of MUM 2012. I applied it. same script I have used. Just changed the interface and IP address. I am getting bandwidth from WAN1, not getting bandwidth from WAN2 links. do you have any solution?
Thanks in advance.
Step-1 [2-3]
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no in-interface=WAN1 new-connection-mark=WAN1 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no in-interface=WAN2 new-connection-mark=WAN2 passthrough=yes

Step-2 [4-5]
add action=mark-routing chain=output connection-mark=WAN1 disabled=no new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2 disabled=no new-routing-mark=to_WAN2 passthrough=yes

Step-3 [6-7]
/ip firewall mangle
add action=accept chain=prerouting disabled=no dst-address=172.17.0.0/30
add action=accept chain=prerouting disabled=no dst-address=172.18.0.0/30


Step-4 [8-9]
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no dst-address-type=!local \
in-interface=LOCAL new-connection-mark=WAN1 passthrough=yes per-connection-classifier=both-addresses:2/0

add action=mark-connection chain=prerouting connection-mark=no-mark disabled=no dst-address-type=!local \
in-interface=LOCAL new-connection-mark=WAN2 passthrough=yes per-connection-classifier=both-addresses:2/1


Step-5 [10-11]
/ip firewall mangle
add action=mark-routing chain=prerouting connection-mark=WAN1 disabled=no in-interface=LOCAL new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2 disabled=no in-interface=LOCAL new-routing-mark=to_WAN2 passthrough=yes



Step-6
add dst-address=0.0.0.0/0 gateway=172.17.0.1 distance=1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=172.18.0.1 distance=1 routing-mark=to_WAN2 check-gateway=ping

Step-7
add dst-address=0.0.0.0/0 gateway=172.17.0.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=172.18.0.1 distance=2 check-gateway=ping
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: How to pass traffic by different gateway in mikrotik without loadbalancing?

Tue Jul 05, 2016 7:55 pm

Do both routes in step 6 show as Active in your routing table?
 
User avatar
mdsekawsar
just joined
Topic Author
Posts: 19
Joined: Tue Nov 04, 2014 12:55 am
Location: Joypurhat, Bangladesh
Contact:

Re: How to pass traffic by different gateway in mikrotik without loadbalancing?

Tue Jul 05, 2016 10:51 pm

Do both routes in step 6 show as Active in your routing table?
Thanks Sir for your q.
Yes both routes shows active in routing table.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: How to pass traffic by different gateway in mikrotik without loadbalancing?

Wed Jul 06, 2016 3:21 am

Try adding two more routes - the same as step 6, but opposite GW's and distance = 2... Backup default GW for both policy routing tables. Then disable the ISP1 connection and see if ISP2 becomes active.