Community discussions

MikroTik App
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Dual wan PCC using one wan only

Fri Aug 22, 2014 7:32 am

Dear all,
I am stucked in a situation and I need your help.

I have a mikrotik RB acting as a PCC (gateway) load balancing two wan links. both links are of same quality. I have tested them separately and they work fine equally. Issue is that only one WAN-1 link is used and second WAN-2 remains idle, If i disconnect WAN-1 , then WAN-2 start working fine. I can see in mangle that WAN-2 counts very less packets as compared to WAN-1. Following is my config.
Any help would be highly appreciated. Thank you in advance :)
/ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2
 
/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=4000KiB max-udp-packet-size=512 servers=8.8.8.8
 
/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
 
add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
 
add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local
 
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=WAN2_conn passthrough=yes
 
add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
 
/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping
 
add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
 
/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade
 
User avatar
TrollMan
Member Candidate
Member Candidate
Posts: 168
Joined: Mon Apr 04, 2011 9:25 pm

Re: Dual wan PCC using one wan only

Fri Aug 22, 2014 9:06 am

As I understand it you need to manually controll which internal ip uses what wan. Thus rbos does not automatically load balance for you.
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Dual wan PCC using one wan only

Fri Aug 22, 2014 10:15 am

I am using both-addressess-and-ports classifier so it should auto load balance requests among both wan, I am testing by putting maximum load from LAN side, using IDM to download multiple big files, but still it downloads from WAN-1 only. and if power of wan-1 , then the wan-2 starts to utilize fully.
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Dual wan PCC using one wan only

Fri Aug 22, 2014 11:33 am

Are the counters on mangle rules running? Do you see there packets captured by those mangle rules?
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

Re: Dual wan PCC using one wan only

Fri Aug 22, 2014 12:27 pm

yes both wan rules packets are counting in mangle, but as i mentioned previous, WAN-1 is counting fine, but wan-2 mangle rule is counting very less packets ratio is something like
packets for wan1 = 100 ,
wan2 = 5 or 10
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Dual wan PCC using one wan only

Fri Aug 22, 2014 1:12 pm

Try changing per-connection-classifier to both-addresses only and see what happens.

Who is online

Users browsing this forum: No registered users and 68 guests