Community discussions

MikroTik App
 
rrameezsalamat
just joined
Topic Author
Posts: 19
Joined: Tue Nov 03, 2015 1:09 pm

pcc load balance dropping packets

Tue Mar 30, 2021 10:51 am

hello everyone,

i am facing outlook disconnect every about 3 -5 minutes and reconnect automatically, mozila thunderbird is not sending email on first attempt (if email sent again after few seconds then it goes successfully). i think i am missing something in my script can anyone check my script(below) and tell me where the problem is?
i have 2 wan (50mb each) and using pcc method load balancing. i have a dhcp configured on interface=lan with 172.16.0.0/22

/ip address
add address=172.16.0.1/22 network=172.16.0.0 broadcast=172.16.3.255 interface=Lan
add address=192.168.100.2/24 network=192.168.100.0 broadcast=192.168.100.255 interface=Wan1
add address=192.168.50.2/24 network=192.168.50.0 broadcast=192.168.50.255 interface=Wan2

/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000KiB 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.50.0/24 action=accept in-interface=Lan
add chain=prerouting dst-address=192.168.100.0/24 action=accept in-interface=Lan

add chain=prerouting dst-address-type=!local in-interface=Lan 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=Lan 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=Lan action=mark-routing new-routing-mark=to_Wan1
add chain=prerouting connection-mark=Wan2_conn in-interface=Lan action=mark-routing new-routing-mark=to_Wan2

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.100.1 routing-mark=to_Wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.50.1 routing-mark=to_Wan2 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=192.168.100.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.50.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
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: pcc load balance dropping packets

Tue Mar 30, 2021 8:42 pm

Start using connection-mark=no-mark like in https://wiki.mikrotik.com/wiki/Manual:P ... _Balancing
I not see anything else bad here.
 
rrameezsalamat
just joined
Topic Author
Posts: 19
Joined: Tue Nov 03, 2015 1:09 pm

Re: pcc load balance dropping packets

Wed Mar 31, 2021 10:02 am

Start using connection-mark=no-mark like in https://wiki.mikrotik.com/wiki/Manual:P ... _Balancing
I not see anything else bad here.
if you didnt see anything bad in the script then why my network is not so smooth? why the packets are dropping and why both wans are not equally utilizing the bandwidth, sometimes wan 1 is using full 50mb and wan 2 is 300kb , 400kb (see image attached)
You do not have the required permissions to view the files attached to this post.
 
User avatar
Znevna
Forum Guru
Forum Guru
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: pcc load balance dropping packets

Wed Mar 31, 2021 10:29 am

https://wiki.mikrotik.com/wiki/How_PCC_ ... eginner%29
The connectivity issues are from you not using per-connection-classifier=src-address, which is not the best option (every clients traffic will go out either through WAN1 OR WAN2) but it doesn't break so many things like HTTPS and other services (Cisco Webex etc) that require you to make requests from one IP only.
Regarding the "load balance", using only PCC you won't be having a nice split of traffic over those two WANs, one user can watch some 4K stream and some other will be reading a forum, chances are that one will use WAN1 and the other WAN2 .. there's no way those two will be equal in bandwidth.

Who is online

Users browsing this forum: Google [Bot], mada3k, muona, pe1chl, TheCat12 and 99 guests