1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Iptables help

Discussion in 'Asuswrt-Merlin' started by macster2075, Sep 20, 2019.

  1. macster2075

    macster2075 Regular Contributor

    Joined:
    Jan 21, 2019
    Messages:
    144
    Hi..
    Is there an iptable or script I can use to block a specific device (IP) from accessing a specific website?
     
  2. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,424
    Location:
    UK
    That's what the Network Services Filter is designed to do.
     
  3. macster2075

    macster2075 Regular Contributor

    Joined:
    Jan 21, 2019
    Messages:
    144
    I saw that.. but there is a section there that says... "https can not be blocked".

    So, I cannot block lets say youtube.com or facebook.com using this service... according to what it says there.
    I thought iptables would be a better way.. no?
     
  4. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,424
    Location:
    UK
    Probably badly translated from Chinese. For the example shown (blocking http on port 80) it should say "https will not be blocked" as that uses port 443. But the URL and Keyword filters do suffer from this restriction.

    Behind the GUI this does the same thing and translates it into iptables rules. The problem is that with both Network Services Filter and iptables you have to enter an IP address not a URL. And sites like youtube have multiple IP addresses that change over time. I think one of the forum members wrote a script that generates the "current list" of IP addresses for the desired sites and automatically blocks them.
     
  5. macster2075

    macster2075 Regular Contributor

    Joined:
    Jan 21, 2019
    Messages:
    144
    I have the script for google safesearch and it works great for all google domains..... I guess I would need one for all youtube domains.