I have since a week my hEX router and I want to use it without a Fritz.box (AVM) in between my local network. I like one feature very much on my Fritz.box. That is filtering of IP addresses that are going directly to the internet without requesting a resolve of the DNS. So all a program, page or script is directly going to 159.148.147.196 and not first ask the DNS what the IP address is.
My impression how it can function. Two lists, the first is the list of allowed IP addresses to be called directly and the second the list of gathered IP addresses that are being blocked.
Triggering the capture of an IP address (159.148.147.196) to the blocked list is when a new connection is made. The request is checked if there is a host (http://www.mikrotik.com) is present and if that is the case the IP address will not put on the blocked list. If I type in my browser http://159.148.147.196 then it will trigger the collection of the IP to the blocked list.
Now 159.148.147.196 is on the list it will be blocked forever until I move it to the allowed list. This allowed list will be now also will be checked each time by the trigger capture filter is finding a new connect with only a IP address present. If the used IP address is on the allowed list it can proceed and if not it will be added to the blocked list if it not already present.
In short for each new connection on HTTP (not https) requests:
IF no host present AND ip address NOT on the allowed list
THEN add to blocked list (if not already present) and terminate request
ELSE allowed through
On the fritz.box a web page is show that the IP address was not allowed through to the internet and that the address is on the blocked list.
I hope this is also interesting for others that can assist me in putting the rules in the firewall together if possible.
Update, I tried web-proxy and that worked but not to my satisfaction. So I implemented firewall rules and Layer 7 filtering and I could filter one specific ip-address that I also put in the Layer 7 filter.
So I made a regex to catch all direct calls however it did not work. The regex is:
([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})
It is a mystery why a know IP address is filtered by 159.148.147.196 but then not by the filter above?