slow connection on vlan

Good morning

i created a guest/mobile phones vlan network which is connected to a dedicated 20mbps wan, the guest network is maskeraded as “invitados” and has a 192.168.51.0/24 dhcp. for some reason the connection is as slow as dialup and i can’t find the reason.

here is my settings


# software id = **ELIDED**
# sep/02/2023 09:31:16 by RouterOS 6.48.6
#
# model = RB3011UiAS
# serial number = **ELIDED**
/interface bridge
add admin-mac=**ELIDED** auto-mac=no comment=defconf name=BRIDGE_LAN
/interface ethernet
set [ find default-name=ether1 ] name=01_WAN_MPLS
set [ find default-name=ether2 ] name=02_SWITCH
set [ find default-name=ether3 ] name=03_UPS
set [ find default-name=ether10 ] name=10_WAN_RED_UNO
set [ find default-name=ether6 ] disabled=yes
set [ find default-name=ether7 ] disabled=yes
set [ find default-name=ether8 ] disabled=yes
set [ find default-name=ether9 ] disabled=yes
set [ find default-name=sfp1 ] disabled=yes
/interface vlan
add comment="Red para invitados y celulares" interface=BRIDGE_LAN name=\
    vlan666 vlan-id=666
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool1 ranges=192.168.51.2-192.168.51.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=vlan666 name=dhcp1
add address-pool=dhcp_pool2 interface=BRIDGE_LAN name=dhcp2
/ppp profile
set *FFFFFFFE only-one=yes use-compression=yes use-mpls=no
/tool traffic-generator port
add interface=10_WAN_RED_UNO name=port1
/user group
set read policy="local,read,test,winbox,password,sniff,sensitive,api,romon,tik\
    app,!telnet,!ssh,!ftp,!reboot,!write,!policy,!web,!dude"
/interface bridge port
add bridge=BRIDGE_LAN comment=defconf interface=02_SWITCH
add bridge=BRIDGE_LAN comment=defconf interface=03_UPS
add bridge=BRIDGE_LAN comment=defconf interface=ether4
add bridge=BRIDGE_LAN comment=defconf interface=ether5
add bridge=BRIDGE_LAN comment=defconf interface=ether6
add bridge=BRIDGE_LAN comment=defconf interface=ether7
add bridge=BRIDGE_LAN comment=defconf interface=ether8
add bridge=BRIDGE_LAN comment=defconf interface=ether9
add bridge=BRIDGE_LAN comment=defconf interface=sfp1
add bridge=BRIDGE_LAN interface=01_WAN_MPLS
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set enabled=yes use-ipsec=yes
/interface list member
add comment=defconf interface=BRIDGE_LAN list=LAN
add disabled=yes interface=10_WAN_RED_UNO list=WAN
add interface=01_WAN_MPLS list=WAN
/ip address
add address=192.168.5.11/24 comment=defconf interface=BRIDGE_LAN network=\
    192.168.5.0
add address=192.168.51.1/24 comment="red invitados" interface=vlan666 \
    network=192.168.51.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add add-default-route=no disabled=no interface=10_WAN_RED_UNO
/ip dhcp-server network
add address=192.168.5.0/24 gateway=192.168.5.3
add address=192.168.51.0/24 dns-server=8.8.8.8 gateway=192.168.51.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
    "defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
    invalid
add action=accept chain=input comment="Acceso Web Mikrotik solo a Red LAN" \
    dst-port=80 protocol=tcp src-address=192.168.5.0/24
add action=drop chain=input dst-port=80 protocol=tcp
add action=drop chain=input comment="Drop SSH" dst-port=22 in-interface-list=\
    WAN protocol=udp
add action=accept chain=input comment="VPN L2TP+IPSEC" dst-port=1701,500,4500 \
    protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
    "defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
    ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
    ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
    connection-state=established,related
add action=accept chain=forward dst-address=192.168.1.0/24
add action=accept chain=forward dst-address=192.168.2.0/24
add action=accept chain=forward dst-address=192.168.3.0/24
add action=accept chain=forward dst-address=192.168.4.0/24
add action=accept chain=forward dst-address=192.168.5.0/24
add action=accept chain=forward dst-address=192.168.101.0/24
add action=accept chain=forward dst-address=192.168.200.0/24
add action=accept chain=forward dst-address=192.168.205.0/24
add action=accept chain=forward dst-address=192.168.90.0/24
add action=accept chain=forward disabled=yes dst-address=192.168.51.0/24 \
    routing-mark=invitados
add action=drop chain=forward comment="defconf: drop invalid" \
    connection-state=invalid disabled=yes
add action=drop chain=forward comment=\
    "defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
    connection-state=new disabled=yes in-interface-list=WAN
/ip firewall mangle
add action=mark-routing chain=prerouting comment=vlan666 in-interface=vlan666 \
    new-routing-mark=invitados passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
    ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment="vlan666 por wan10" out-interface=\
    BRIDGE_LAN routing-mark=invitados
add action=masquerade chain=srcnat disabled=yes out-interface=10_WAN_RED_UNO \
    routing-mark=invitados src-address=192.168.51.0/24
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set sip disabled=yes
set pptp disabled=yes
set dccp disabled=yes
/ip route
add distance=1 gateway=192.168.99.1 routing-mark=invitados
add disabled=yes distance=1 gateway=192.168.5.3 routing-mark=invitados
add distance=1 gateway=192.168.5.3
add distance=1 dst-address=192.168.1.0/24 gateway=192.168.5.3
add distance=1 dst-address=192.168.2.0/24 gateway=192.168.5.3
add distance=1 dst-address=192.168.3.0/24 gateway=192.168.5.3
add distance=1 dst-address=192.168.4.0/24 gateway=192.168.5.3
add distance=1 dst-address=192.168.90.4/32 gateway=192.168.5.3
add distance=1 dst-address=192.168.205.0/24 gateway=192.168.5.3
/ip upnp
set enabled=yes
/system clock
set time-zone-name=America/Argentina/Catamarca
/system identity
set name=RouterOS
/system logging
add disabled=yes topics=l2tp
add disabled=yes topics=ipsec,!packet
add topics=script
add topics=event
/system ntp client
set enabled=yes primary-ntp=200.160.7.186 secondary-ntp=185.184.223.224
/tool bandwidth-server
set authenticate=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

the main connection is inside a mpls which has it’s own security. i tried disabling some firewall settings trying to figure out the reason

Mangle and fast-track are exclusive. To test that this is indeed the problem, disable the fast-track rule and test again (make sure that new connection between client and server has to establish, simply disabling fasttrack rule doesn’t un-fasttrack existing connections).
If this is prooves to be the problem, you can alter the fasttrack rule so that it won’t act on packets which need mangling. Alternatively you can add a rule which accepts mangled traffic and push it above existing fasttrack rule.

disabling the fasttrack rule fixed the problem. how do i bypass the rule for mangled connections?

First of all its not clear why you need mangling in the first place?
Why do you think you need it?
What are you trying to accomplish??

One way to keep using fastrack is to add mark=no-mark to the fastrack rule!
However you only mark routing which seems sufficient for your needs, but
adding a connection mark wont hurt in order to use the fast track rule for all other traffic.
Assuming you need mangling in the first place!!

i needed to redirect the guest network to a different WAN from the main network and i followed a tutorial (T_T). before i had the main WAN installed i had both networks leaving from the same wan (the main network inside a l2tp vpn), now the main network is inside a mpls fiber and the prior WAN is only used for guests. the main objetive was to use the guest WAN as a backup connection for the main network if the mpls failed, activating the l2tp vpn and redirecting the “main” traffic thru the vpn while the “guest” traffic was untouched, i end discarting the whole thing so it may need some rule cleaning

First of all, I agree with @anav: why is mangle (to set routing mark) necessary in the first place? From my limited expertise, the only place where it does seem to mean something, is the static route.


Either (abuse) mangle to also mark the connections as per suggestion by @anav, or you could add these two rules before the fast-track rule (and after the two ipsec-related rules):

add action=accept chain=forward comment="bypass fast-track of mangled traffic" connection-state=established,related in-interface=vlan666