Hello everyone,
I had set up a RB2011 as a load balancer for 4 WAN connections as shown below. It worked fine for around 2 months, and then recently I started seeing really poor performance. Around the same time, I also added a 5th WAN connection in the same way, which I doubt is the problem, but I am not so sure. I tried disconnecting the 5th WAN, and I am still getting problems.
The behavior we’re getting is, when you request a web-page, 20% of the time it will work right away, but most of the time, you get nothing for several minutes or you never get it. It just says “Connecting” or similar in the browser. If you keep hitting reload for a few minutes, then maybe you get it, and then it loads quickly. Sometimes rebooting the router resolves the problem for a few minutes, or an hour or two, but not always.
I am thinking it could be one of three things:
- The configuration is incorrect
- The RB2011 “burnt out” or something after 2 months
- We are being attacked, DDoS or similar
So I wanted to run this configuration by you guys to try and rule out that I did a bad job of setting it up, before I jump to the latter 2 more extreme conclusions.
If its not the config, how do I go about troubleshooting this?
For my setup, basically, I have 5 PPPoE connections, going through bridged ADSL modems, each providing 1Mbps of bandwidth (which is the best I can get from my ISP in this location, and the main reason why I am doing this setup to aggregate bandwidth).
I have placed the 5 WANs on ports called gate1..gate5, and I’ve put each on a separate 192.168.X.0/24 subnet.
Ports ether1 and ether2 are bridged and connect to the LAN, which is a 10.1.0.0/16 subnet.
I then use PCC to load balance connections from the LAN to one of the WAN connections.
I am also allowing access to SSH and HTTP/HTTPS to 2 local servers, using port forwarding.
Here is my full config, from an export command. I’ve replaced private specifics with Xs.
/interface bridge
add admin-mac=XX:XX:XX:XX:XX:XX arp=proxy-arp auto-mac=no l2mtu=1598 name=bridge-local
/interface ethernet
set [ find default-name=ether3 ] name=gate1
set [ find default-name=ether4 ] name=gate2
set [ find default-name=ether5 ] name=gate3
set [ find default-name=ether6 ] name=gate4
set [ find default-name=ether7 ] name=gate5
set [ find default-name=ether8 ] name=gate6
set [ find default-name=ether9 ] name=gate7
set [ find default-name=ether10 ] name=gate8
/ip neighbor discovery
set gate1 discover=no
set gate2 discover=no
set gate3 discover=no
set gate4 discover=no
set gate5 discover=no
set gate6 discover=no
set gate7 discover=no
set gate8 discover=no
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=3des
/ip pool
add name=default-dhcp ranges=10.1.200.1-10.1.209.254
/interface pppoe-client
add ac-name=“” add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=gate1 keepalive-timeout=5
max-mru=1480 max-mtu=1480 mrru=disabled name=pppoe1 password=XXX profile=default service-name=“” use-peer-dns=no user=XXX
add ac-name=“” add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=gate2 keepalive-timeout=5
max-mru=1480 max-mtu=1480 mrru=disabled name=pppoe2 password=XXX profile=default service-name=“” use-peer-dns=no user=XXX
add ac-name=“” add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=gate3 keepalive-timeout=5
max-mru=1480 max-mtu=1480 mrru=disabled name=pppoe3 password=XXX profile=default service-name=“” use-peer-dns=no user=XXX
add ac-name=“” add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=gate4 keepalive-timeout=5
max-mru=1480 max-mtu=1480 mrru=disabled name=pppoe4 password=XXX profile=default service-name=“” use-peer-dns=no user=XXX
add ac-name=“” add-default-route=no allow=pap,chap,mschap1,mschap2 dial-on-demand=no disabled=no interface=gate5 keepalive-timeout=5
max-mru=1480 max-mtu=1480 mrru=disabled name=pppoe5 password=XXX profile=default service-name=“” use-peer-dns=no user=XXX
/interface bridge port
add bridge=bridge-local interface=ether1
add bridge=bridge-local interface=ether2
/ip address
add address=10.1.1.1/16 interface=bridge-local network=10.1.0.0
add address=192.168.1.100/24 interface=gate1 network=192.168.1.0
add address=192.168.2.100/24 interface=gate2 network=192.168.2.0
add address=192.168.3.100/24 interface=gate3 network=192.168.3.0
add address=192.168.4.100/24 interface=gate4 network=192.168.4.0
add address=192.168.5.100/24 interface=gate5 network=192.168.5.0
/ip dns
set allow-remote-requests=yes servers=X.X.X.X,X.X.X.X
/ip dns static
add address=10.1.1.1 name=mikrotik
add address=192.168.1.1 name=dsl1
add address=192.168.2.1 name=dsl2
add address=192.168.3.1 name=dsl3
add address=192.168.4.1 name=dsl4
add address=192.168.5.1 name=dsl5
add address=10.1.100.1 name=localserver1
add address=10.1.100.2 name=localserver2
/ip firewall filter
add chain=input protocol=icmp
add chain=input connection-state=established
add chain=input connection-state=related
add chain=forward connection-state=established
add chain=forward connection-state=related
add action=drop chain=forward connection-state=invalid
/ip firewall mangle
add chain=prerouting dst-address=10.1.0.0/16 in-interface=bridge-local
add chain=prerouting dst-address=192.168.1.0/24 in-interface=bridge-local
add chain=prerouting dst-address=192.168.2.0/24 in-interface=bridge-local
add chain=prerouting dst-address=192.168.3.0/24 in-interface=bridge-local
add chain=prerouting dst-address=192.168.4.0/24 in-interface=bridge-local
add chain=prerouting dst-address=192.168.5.0/24 in-interface=bridge-local
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe1 new-connection-mark=wan1
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe2 new-connection-mark=wan2
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe3 new-connection-mark=wan3
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe4 new-connection-mark=wan4
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe5 new-connection-mark=wan5
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-local
new-connection-mark=wan1 per-connection-classifier=both-addresses:5/0
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-local
new-connection-mark=wan2 per-connection-classifier=both-addresses:5/1
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-local
new-connection-mark=wan3 per-connection-classifier=both-addresses:5/2
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-local
new-connection-mark=wan4 per-connection-classifier=both-addresses:5/3
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-local
new-connection-mark=wan5 per-connection-classifier=both-addresses:5/4
add action=mark-routing chain=prerouting connection-mark=wan1 in-interface=bridge-local new-routing-mark=wan1
add action=mark-routing chain=prerouting connection-mark=wan2 in-interface=bridge-local new-routing-mark=wan2
add action=mark-routing chain=prerouting connection-mark=wan3 in-interface=bridge-local new-routing-mark=wan3
add action=mark-routing chain=prerouting connection-mark=wan4 in-interface=bridge-local new-routing-mark=wan4
add action=mark-routing chain=prerouting connection-mark=wan5 in-interface=bridge-local new-routing-mark=wan5
add action=mark-routing chain=output connection-mark=wan1 new-routing-mark=wan1
add action=mark-routing chain=output connection-mark=wan2 new-routing-mark=wan2
add action=mark-routing chain=output connection-mark=wan3 new-routing-mark=wan3
add action=mark-routing chain=output connection-mark=wan4 new-routing-mark=wan4
add action=mark-routing chain=output connection-mark=wan5 new-routing-mark=wan5
/ip firewall nat
add action=masquerade chain=srcnat out-interface=all-ppp to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface=gate1 to-addresses=192.168.1.0/24
add action=masquerade chain=srcnat out-interface=gate2 to-addresses=192.168.2.0/24
add action=masquerade chain=srcnat out-interface=gate3 to-addresses=192.168.3.0/24
add action=masquerade chain=srcnat out-interface=gate4 to-addresses=192.168.4.0/24
add action=masquerade chain=srcnat out-interface=gate5 to-addresses=192.168.5.0/24
add action=dst-nat chain=dstnat dst-port=22 in-interface=all-ppp protocol=tcp to-addresses=10.1.100.1 to-ports=22
add action=dst-nat chain=dstnat dst-port=80 in-interface=all-ppp protocol=tcp to-addresses=10.1.100.2 to-ports=80
add action=dst-nat chain=dstnat dst-port=443 in-interface=all-ppp protocol=tcp to-addresses=10.1.100.2 to-ports=443
/ip route
add check-gateway=ping distance=1 gateway=X.X.X.X%pppoe1 routing-mark=wan1
add check-gateway=ping distance=1 gateway=X.X.X.X%pppoe2 routing-mark=wan2
add check-gateway=ping distance=1 gateway=X.X.X.X%pppoe3 routing-mark=wan3
add check-gateway=ping distance=1 gateway=X.X.X.X%pppoe4 routing-mark=wan4
add check-gateway=ping distance=1 gateway=X.X.X.X%pppoe5 routing-mark=wan5
add check-gateway=ping distance=2 gateway=X.X.X.X%pppoe2
add check-gateway=ping distance=2 gateway=X.X.X.X%pppoe1
add check-gateway=ping distance=2 gateway=X.X.X.X%pppoe3
add check-gateway=ping distance=2 gateway=X.X.X.X%pppoe4
add check-gateway=ping distance=2 gateway=X.X.X.X%pppoe5
/ip upnp
set allow-disable-external-interface=no
/system clock
set time-zone-name=Etc/GMT-3
/system identity
set name=mikrotik
/system ntp client
set enabled=yes primary-ntp=196.43.1.14 secondary-ntp=41.73.40.9
/tool graphing interface
add
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=bridge-local
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=bridge-local