This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Block sites accessed by it's IP address

How would one go about blocking URLs that contain an IP?

Example:

hxxp://www.ok-website.com = good
hxxp://64.50.50.123 = blocked (unless added to exceptions)

I have tried using the "Block Uncatagorized" option but, that does not work in this case and is really quite unwieldy in general.

Gateway: ASG320
Firmware: 8.301

Thanks in advance.


This thread was automatically locked due to age.
  • Hi

    would you like to block all web pages by ip or just a specific one?
  • Hi r2k,

    I would like to block all web pages accessed by an IP, unless that IP is in the exception list.
  • I believe I have figured it out.

    In Web Security->Web Filtering->URL Filtering->Additional URLs/sites to block  add the following RegEx:

    ^http?://(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

    This excludes 0-255 for each of the 4 numbers of a IP address.

    Then in Web Security->Web Filtering->URL Filtering->Always allow these URLs/sites add the IP addresses that are allowed.

    In testing, this appears to work as advertised.
  • Hi,
    The first question mark seems out of place.
    If you're doing SSL proxying, you should use
    ^https?://
    otherwise
    ^http://
    should work.

    Also, your regex seems overly complicated;
    ^https?://\d+\.\d+\.\d+\.\d+/
    should suffice with no false positives.

    Barry
  • Thanks BarryG.

    I'm not a RegEx-pert yet - LOL.  I wanted to make sure I was only matching numbers that would be valid in a IP address. Probably being a little overly enthusiastic.

    Your solution is much nicer and seems to be working perfectly.  Thanks again.