I am in search of a solution to my problem and i would like to ask some questions before.
I would like to block access from my lan to a list of websites (around 1000) which i have in an excel file.
I know there are some ways to block websites like Layer 7 or Web proxy etc.
So my main question is if i can use a mikrotik device and how efficient will it be and which way you think would be better.
The other question is if i can somehow easily import the list i have to an excel file into the mikrotik device. Or do i need to make a script.
I don’t want the solution, i just want directions.
L7 will kill your router, and is very inefficient. You can also block by IP address, that would be much easier and faster, if most of those websites have known list of fairly static IP addresses.
Add this to block them all.
/ip firewall filter
add action=reject chain=forward comment=“Block Web Sites”
dst-address-list=blocked_web reject-with=icmp-network-unreachable
That is indeed very simple, but unfortunately it will not work correctly!
One IP address can handle multiple websites, so when you block this way you will block other sites as well.
Sites without SSL you can block in other ways already. And also, there aren’t many sites without SSL.
Can you name an example of a popular site that has SSL certificate issued for a different domain? I don’t think that is even possible.
Hi!!! I believe that it can work by configuring your Mikrotik and your network to work with OpenDNS, in that site you can block anything, and really need to do extra things in the Mikrotik, as for example, denying any proxy communication, denying any VPN port, denying UltraSurf and doing a dst-nat to force any DNS request sent to a different server and redirect it to the OpenDNS server
I have in mind OpenDNS but i would like first to try a more “mikrotik” solution.
The list does not contain very common websites like facebook google etc so most of them have only 1 ip.
I will try that and see if it suits me.
Btw
I tested it and it does not match any traffic. I tried some diffs of the command provided but couldn’t find sth working.
Read this: https://httpd.apache.org/docs/2.4/vhosts/examples.html
It should explain you a bit what virtual host for WWW is.
IMHO all hosting companies share one IP for many sites. There is no enough IP4 addresses to host each possible WWW site with it’s own address.
I think you need to apply those matchers in the mangle chain, to set a mark on the connection, and then use a filter in the forward chain to block packets for those marked connections.
This is because such matches operate on “peeking into a session” and by the time they identified the traffic, it has already passed through.
You cannot drop the actual TLS exchange, but you can drop the further traffic when you have marked the connection.