If I investigate my firewall connections, address-lists and interface loads I see the following:/ip firewall mangle
add action=mark-connection chain=prerouting comment="" disabled=no in-interface=local new-connection-mark=odd passthrough=yes src-address-list=odd
add action=mark-routing chain=prerouting comment="" disabled=no in-interface=local new-routing-mark=odd passthrough=no src-address-list=odd
add action=mark-connection chain=prerouting comment="" disabled=no in-interface=local new-connection-mark=even passthrough=yes src-address-list=even
add action=mark-routing chain=prerouting comment="" disabled=no in-interface=local new-routing-mark=even passthrough=no src-address-list=even
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=odd nth=2,1 passthrough=yes
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=odd nth=2,1 passthrough=yes src-address-list=!even
add action=add-src-to-address-list address-list=odd address-list-timeout=1d chain=prerouting comment="" connection-mark=odd disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=odd disabled=no in-interface=local new-routing-mark=odd passthrough=no
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=even nth=2,2 passthrough=yes
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=even nth=2,2 passthrough=yes src-address-list=!odd
add action=add-src-to-address-list address-list=even address-list-timeout=1d chain=prerouting comment="" connection-mark=even disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=even disabled=no in-interface=local new-routing-mark=even passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL2
/ip route
add check-gateway=arp comment="Route odd ToADSL1" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL1 routing-mark=odd
add check-gateway=arp comment="Route even ToADSL2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL2 routing-mark=even
add check-gateway=arp comment="Route router traffic ToADSL2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL2
/ip firewall mangle
add action=mark-connection chain=prerouting comment="" disabled=no in-interface=local new-connection-mark=even passthrough=yes src-address-list=even
add action=mark-routing chain=prerouting comment="" disabled=no in-interface=local new-routing-mark=even passthrough=no src-address-list=even
add action=mark-connection chain=prerouting comment="" disabled=no in-interface=local new-connection-mark=odd passthrough=yes src-address-list=odd
add action=mark-routing chain=prerouting comment="" disabled=no in-interface=local new-routing-mark=odd passthrough=no src-address-list=odd
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=odd nth=4,1 passthrough=yes
add action=add-src-to-address-list address-list=odd address-list-timeout=1d chain=prerouting comment="" connection-mark=odd disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=odd disabled=no in-interface=local new-routing-mark=odd passthrough=no
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=even nth=4,2 passthrough=yes
add action=add-src-to-address-list address-list=even address-list-timeout=1d chain=prerouting comment="" connection-mark=even disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=even disabled=no in-interface=local new-routing-mark=even passthrough=no
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=even nth=4,3 passthrough=yes
add action=add-src-to-address-list address-list=even address-list-timeout=1d chain=prerouting comment="" connection-mark=even disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=even disabled=no in-interface=local new-routing-mark=even passthrough=no
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no in-interface=local new-connection-mark=even nth=4,4 passthrough=yes
add action=add-src-to-address-list address-list=even address-list-timeout=1d chain=prerouting comment="" connection-mark=even disabled=no in-interface=local
add action=mark-routing chain=prerouting comment="" connection-mark=even disabled=no in-interface=local new-routing-mark=even passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL2
/ip route
add comment="Router traffic To ADSL1" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL1
add check-gateway=arp comment="Route odd ToADSL1" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL1 routing-mark=odd
add check-gateway=arp comment="Route even ToADSL2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL2 routing-mark=main
/ip firewall mangle
add action=add-src-to-address-list address-list=ADSL1 address-list-timeout=0s chain="mark new unseen" comment="" disabled=no nth=2,1
add action=add-src-to-address-list address-list=ADSL2 address-list-timeout=0s chain="mark new unseen" comment="" disabled=no nth=2,2
add action=add-src-to-address-list address-list=seen address-list-timeout=0s chain="mark new unseen" comment="" disabled=no
add action=jump chain="mark new unseen" comment="" disabled=no jump-target="mark connection"
add action=mark-connection chain="mark connection" comment="" disabled=no new-connection-mark=ADSL1_conn passthrough=yes src-address-list=ADSL1
add action=mark-connection chain="mark connection" comment="" disabled=no new-connection-mark=ADSL2_conn passthrough=yes src-address-list=ADSL2
add action=mark-routing chain="mark connection" comment="" connection-mark=ADSL1_conn disabled=no new-routing-mark=ADSL1 passthrough=no
add action=mark-routing chain="mark connection" comment="" connection-mark=ADSL2_conn disabled=no new-routing-mark=ADSL2 passthrough=no
add action=mark-routing chain=prerouting comment="" connection-mark=ADSL1_conn disabled=no new-routing-mark=ADSL1 passthrough=no src-address-list=ADSL1
add action=mark-routing chain=prerouting comment="" connection-mark=ADSL2_conn disabled=no new-routing-mark=ADSL2 passthrough=no src-address-list=ADSL2
add action=jump chain=prerouting comment="" connection-state=new disabled=no in-interface=local jump-target="mark connection"
add action=jump chain=prerouting comment="" connection-state=new disabled=no in-interface=local jump-target="mark new unseen"
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ADSL2
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL1
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL1 routing-mark=ADSL1
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ADSL2 routing-mark=ADSL2
Are you useing l2tp/ipsec? if so then yes it would be affected by the flush since it uses higher level protocol than the routing protocols. Thus when the routes are flushed everything in the upper layers have to reconnect. Since the ipsec is considered lvl4/5 (depending on who you talk to) it will have to reconnect on a route flush since that happens on lvl3.By the way, PPTP works with ECMP + route table flush workarounds, but L2TP does not. I mean from the router itself to a external router somewhere in the wild. Tested. I wonder how come L2TP does not work, what is so special about it that is different from PPTP for example? L2TP gets hit by the flush, the tunnel drops each 10 minutes +/- 2 or 3 or ?. I guess the connection-state=new does not catch it.
l2tp is UDP, and therefore has a very short conntrack entry.The mangle rules that we use (route table flush workarounds as I call em) fix the TCP connections (no reconnects, no loss in performance (not 100% analyzed for perf)) so they should fix everything. But L2TP somehow we miss. Maybe it is missed by connection-state=new as I said. Not sure.
ECMP - cannot. use http://wiki.mikrotik.com/wiki/NTH_load_ ... masqueradeMikroTik RouterOS currently can not handle this scenario. This is very sad.
Nth Can not as wellWell they could patch the kernel to get rid of the route table flushing or make it an option, so we can turn it off when we use masq/local ip addresses for customers.
By the way, me and a friend recently needed to route certain connections over interfaces in the same broadcast domain with the same gateway. Something like ECMP with the same gateway, but without PPPoE or PPTP tunnels to simplify things. MikroTik RouterOS currently can not handle this scenario. This is very sad.
This problem is attacked with routing-test package. Will test in matter of hours and post results + send supout to support e-mail. edit: no success....
By the way, me and a friend recently needed to route certain connections over interfaces in the same broadcast domain with the same gateway. Something like ECMP with the same gateway, but without PPPoE or PPTP tunnels to simplify things. MikroTik RouterOS currently can not handle this scenario. This is very sad.
A single web page load will sometimes use 20-30 connections... it's not just a single connection for each page. You are probably loading the captcha image on one connection and hitting their form on another.In this case we are aproximatly
returning to this page every 30 seconds, so it's obvious it has nothing to do with the flush of
connections.
didn't you forget about keep-alive connections?.. all modern browsers use themA single web page load will sometimes use 20-30 connections... it's not just a single connection for each page.
they use load balancing via DNS. maybe just browser sends request to different IP, so ECMP uses another gateway?C:\Documents and Settings\Chups>nslookup
> cqcounter.com
Name: cqcounter.com
Addresses: 75.160.72.234, 63.231.252.74
so ur using nthno, sorry, I'm RouterOS fan =)
and I used only 'Nth' (it was 'Random' really =) ), no ECMP
well, if you have two computers - yes, you need ECMP. if you have two hundred computers, Nth is quite enough. I love you, the law of large numbers =)The problem I have with nth is that first you can experience different
internet perfomance with two different adjacent computers, next,
most important I think, is you need to configure some extra scripts
for failover.
actually, it was not Nth, it was my own setup developed from scratch. it worked fine while we use it =) and as far as I can see it was using the same principles as Nth in Wikiso ur using nth
i tried to use it but it didn't works fine .
all connections used only 1 wan .
so is there any changes u did to make NTH works fine ?
and if there is changed can u share it with us pls ?
now i'm using nthactually, it was not Nth, it was my own setup developed from scratch. it worked fine while we use it =) and as far as I can see it was using the same principles as Nth in Wikiso ur using nth
i tried to use it but it didn't works fine .
all connections used only 1 wan .
so is there any changes u did to make NTH works fine ?
and if there is changed can u share it with us pls ?
yesas I can see by 'Sent To Client', proxy is working. but is not caching =) did you enabled web cache at all?
enabled: yes
src-address: 0.0.0.0
port: 8080
parent-proxy: 0.0.0.0
parent-proxy-port: 0
cache-administrator: "master"
max-cache-size: none
cache-on-disk: yes
max-client-connections: 1000
max-server-connections: 1000
max-fresh-time: 3d
serialize-connections: no
always-from-cache: yes
cache-hit-dscp: 4
cache-drive: primary-master
chain=dstnat action=redirect to-ports=8080 protocol=tcp dst-port=80
i think it works nowchange max-cache-size: none no max-cache-size: unlimited
Added: but you cannot use Nth to load-balance transparent proxy. use ECMP for Web-Proxy or wait for PCC...
well, now all your proxy traffic should go through one gateway. but for proxy you may use ECMP - it's not long-time connections like instant messengers, etc.if there is prob i will disable proxy and wait for PCC
2 A S ;;; 1 GW
0.0.0.0/0 xxx.xxx.82.1 1
3 X S ;;; 2 GWs
0.0.0.0/0 xxx.xxx.82.1 1
xxx.xxx.169.1
xxx.xxx.169.1
0 ;;; masquarade WAN1
chain=srcnat action=masquerade out-interface=WAN1
1 ;;; masquarade WAN2
chain=srcnat action=masquerade out-interface=WAN2
3 ;;; RDC to WAN1
chain=dstnat action=dst-nat to-addresses=192.168.0.11 to-ports=3389
protocol=tcp in-interface=WAN1 dst-port=8000
4 ;;; RDC to WAN2
chain=dstnat action=dst-nat to-addresses=192.168.0.11 to-ports=3389
protocol=tcp in-interface=WAN2 dst-port=8000
it won't be fixed by MikroTik, it's in Kernelrouting table flush every 10min