Community discussions

MikroTik App
 
csalcedo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Fri Jan 22, 2016 8:09 pm
Location: Santiago Chile

Slow throughput when using dynamic address list

Wed Aug 24, 2016 7:23 pm

Hi guys,
I have RB2011UiAS installed at a customer and he requested blocking of facebook and youtube. What I did was use the new feature of dynamic address list to create a couple of rules that do the blocking. From what I see the unit is not showing any high CPU etc.

This feature is new in 6.36. When you go to address list in firewall and add an address you can put the domain instead of the IP address and it will resolve it for you and refresh based on its TTL.
The command is:
/ip firewall address-list
add address=www.facebook.com list=facebook
add address=youtube.com list=Youtube
add address=facebook.com list=facebook

This works great as it will get all the ip´s for that domain that are registered on your internet facing dns servers (youtube comes up with 12 address for me..).
The firewall block rule is:
add action=drop chain=forward comment=Block-Youtube dst-address-list=Youtube log-prefix="" src-address-list=Hotspot
add action=drop chain=forward comment=Block-Facebook dst-address-list=facebook log-prefix="" src-address-list=Hotspot

This works fine and does block the access to the sites.
The problem is that the users the are subject to the rule ( src-address-list=Hotspot ip range x.x.x.5-x.x.x.120) navigate very slowly. while the users not subjetc to the rules (x.x.x.130-200) navigate very fast.

Any help or insights would be apreciated. Below is the full config:

# aug/24/2016 11:47:26 by RouterOS 6.36
#
/interface bridge
add admin-mac=E4:8D:8C:05:46:79 auto-mac=no comment=LAN name=bridge
/interface ethernet
set [ find default-name=ether1 ] advertise=10M-half,10M-full,100M-half,100M-full auto-negotiation=no comment=WAN
set [ find default-name=ether2 ] name=ether2-master
set [ find default-name=ether3 ] master-port=ether2-master
set [ find default-name=ether4 ] master-port=ether2-master
set [ find default-name=ether5 ] master-port=ether2-master
set [ find default-name=ether6 ] name=ether6-master
set [ find default-name=ether7 ] master-port=ether6-master
set [ find default-name=ether8 ] master-port=ether6-master
set [ find default-name=ether9 ] master-port=ether6-master
set [ find default-name=ether10 ] master-port=ether6-master

/ip neighbor discovery
set ether1 comment=WAN discover=no
set bridge comment=LAN

/ip hotspot profile
add hotspot-address=10.80.240.1 html-directory=Hotspot name=hsprof1

/ip hotspot user profile
set [ find default=yes ] shared-users=100

/ip pool
add name=dhcp ranges=10.80.248.5-10.80.248.120

/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge lease-time=1h name=dhcp1

/ip hotspot
add address-pool=dhcp disabled=no interface=bridge name=hotspot1 profile=hsprof1

/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf interface=ether6-master
add bridge=bridge comment=defconf interface=sfp1

/ip address
add address=10.80.248.1/24 comment="hotspot network" interface=ether2-master network=10.80.248.0
add address=x.x.x.x/29 interface=ether1 network=x.x.x.x

/ip dhcp-server lease
add address=10.80.248.50 client-id=1:b0:c0:90:61:3:8f mac-address=B0:C0:90:61:03:8F server=dhcp1
add address=10.80.248.51 client-id=1:b0:c0:90:69:15:5b mac-address=B0:C0:90:69:15:5B server=dhcp1
add address=10.80.248.132 client-id=1:54:35:30:20:e5:67 mac-address=54:35:30:20:E5:67 server=dhcp1

/ip dhcp-server network
add address=10.80.248.0/24 comment="hotspot network" gateway=10.80.248.1

/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4

/ip dns static
add address=10.80.248.1 name=router

/ip firewall address-list
add address=10.80.248.0/25 list=Hotspot
add address=www.facebook.com list=facebook
add address=youtube.com list=Youtube
add address=facebook.com list=facebook

/ip firewall filter
add action=accept chain=input dst-port=8291 log-prefix="" protocol=tcp
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=input comment="defconf: drop all from WAN" in-interface=ether1
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=ether1
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=drop chain=forward comment=Block-Youtube dst-address-list=Youtube log-prefix="" src-address-list=Hotspot
add action=drop chain=forward comment=Block-Facebook dst-address-list=facebook log-prefix="" src-address-list=Hotspot

/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1
add action=masquerade chain=srcnat comment="masquerade hotspot network" log-prefix="" src-address=10.80.248.0/24

/ip hotspot user
add name=invitado password=invitado

/ip route
add distance=1 gateway=x.x.x.x

/system routerboard settings
set protected-routerboot=disabled

/tool bandwidth-server
set authenticate=no

/tool graphing interface
add interface=ether1

/tool graphing resource
add

/tool mac-server
set [ find default=yes ] disabled=yes
add interface=bridge

/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=bridge
 
Unic
newbie
Posts: 48
Joined: Thu Jun 11, 2015 3:51 pm

Re: Slow throughput when using dynamic address list

Fri Aug 26, 2016 12:42 am

Hi,

Change your action from "drop" to "reject", as otherwise the browser will wait for the timeout.

Who is online

Users browsing this forum: Bing [Bot] and 208 guests