What's new

How to Create Custom Page for Blocked Users?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

nolimits76

Occasional Visitor
Awhile back I implemented some control measures to help better maintain my home network. One of things I would like to improve is implementing a "custom page" for blocked users. It doesn't need to be fancy.

Something like the example below would be fine. I just don't like how it defaults to a blurred out version of the router GUI page with the message it currently displays.

All help appreciated.


pagecannotbedisplayed.png
 
One of things I would like to improve is implementing a "custom page" for blocked users. It doesn't need to be fancy.

I do that very thing using iptables and optware/nginx. These are the rules I use redirect by ip or mac:
Code:
    for ip in $iplist
    do
        iptables -t nat -I PREROUTING 3 -p tcp -s $ip -j DNAT --to-destination 10.0.2.1:8000
        iptables -I FORWARD 2 -s $ip -j DROP
    done
    for mac in $maclist
    do
        iptables -t nat -I PREROUTING 3 -p tcp -m mac --mac-source $mac -j DNAT --to-destination 10.0.2.1:8000
        iptables -I FORWARD 2 -m mac --mac-source $mac -j DROP
    done

This is the only important change to nginx.conf:
Code:
    server {
        listen            8000;

        location / {
            root    /opt/etc/nginx/www;
            index    index.html index.htm;
        }
    }

This is a link to a very simple blocking page:
Blocking Page
 
FYI, I originally used a different method. I modified the "blurry page" with a short message.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top