Blocking all websites except some for specific user

Hi all,

I’m new to the RouterOS system and I’m interested if there’s a way to
Block all websites except one or two for specific users (in my case there is one users).
How can I achieve that?

Thanks in advance.

Add list that you need to allow web traffic. For example:

/ip firewall address-list add list=web_allow address=192.168.0.10
/ip firewall address-list add list=web_allow address=192.168.0.15

Use this address-list and create filter rule.

/ip firewall filter add chain=forward action=drop src-address-list!=web_allow protocol=tcp dst-port=80,443

It will drop packets that use destination port TCP80,TCP443 and will drop sourced not from list “web_allow”.

Thank you for your answer.

But I want to block All websites except some (google.com and facebook.com for example) all others will be blocked for one user.
Is it possible to do?

this is exactly what the above suggestion does



/ip firewall filter
#add rule that jumps to NeedToBlock chain, if traffic from 192.168.0.10 and uses TCP80
add action=jump chain=forward disabled=no dst-port=80 jump-target=NeedToBlock protocol=tcp src-address=192.168.0.10
#Block if facebook.com and google.com
add action=reject chain=NeedToBlock content=facebook.com disabled=no protocol=tcp reject-with=tcp-reset
add action=reject chain=NeedToBlock content=google.com disabled=no protocol=tcp reject-with=tcp-reset

But remember if you use content filter, it will not work on TCP443, which uses HTTPS encrypted traffic between web server and client PC. You need to do something on DNS traffic, if you need to block HTTPS pages. Hope it helps you.