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

Blocked country, how to allow incoming from specific address?

Hello,

I was getting regular port sniffing attempts from certain USA ip locations (colocrossing for example). So I changed my firewall rules to block all incoming from USA in the countries setting.

I have run into one problem that I cannot figure out (and I'm still trying to wrap my brain around the UTM as a whole, so please bare with me).

I use a service call (free) that gathers live data from my aquarium controller. One of the main features (that I use), is that it "polls" my controller once every 15 minutes, and sends me a text/email if it loses connectivity.  This has saved my butt quite a few times now.

It's a simple php script that queries my controller (think ping, but with http).
The odd part is that if I load the URL that it tests against in a browser (from outside my home network) it loads perfectly fine (it asks for credentials as expected).  However, the website that tests this link fails.

This ONLY happens after I enable country blocking.

I have an aquarium controller that sits on port 80 (192.168.0.100). I've got a DynDNS address (it's actually no-ip.com address) that points to this controller.

I've created the following definitions:

(actual IPs are private and up to the owner of ***X.net to give out).

n1.***x.net  - Host > 74.x.x.1   

n2.***x.net - Host > 74.x.x.2

***xx.net - Network Group > n1.***xx.com & n2.***xx.com

for public example, lets say its called :

firewall.somefqdn.com

I've tried the following:

Country Blocking Exception:

Skip blocking from > USA
for traffic coming from these sources > ***xx.com
using these services > http

I've then tried doing a DNAT :

Traffic from >> ***xx.net
Using Service >> http
Going to >> firewall.somefqdn.com

Change destination to >> 192.168.0.100
Automatic firewall rule enabled

no go...


I've also tried an SNAT (only because I don't really understand how the UTM does it's address translation) :

Traffic from >> ***xx.net
Using Service >> http
Going to >> firewall.somefqdn.com

Change source to >> External (WAN)

Automatic firewall rule enabled

no go.

I'm kinda stumped.


This thread was automatically locked due to age.
  • Name : 74.X.X.0/24
    Type : Network
    IPv4 : 74.X.X.0
    Netmask : /24
    Yep, that looks correct.

    Googling around, one thing that may be playing into this by FQDN is that ***X.com appears to be an available domain.  They use ***X.NET.  Not certain why it isn't working by IP, but I only have the information provided and can't see what you're seeing.
  • Yep, that looks correct.

    Googling around, one thing that may be playing into this by FQDN is that ***X.com appears to be an available domain.  They use ***X.NET


    Yeah, that was a typo on my part. I realized this after posting, and went and double checked my settings, it's .NET everywhere (and the actual site is .net)
  • I just tried a quick test. Disabled the TO and changed the network to ANY on 
    the FROM exception, and no go. 

    I then flipped that around:

    Disabled the FROM, and change the network to ANY on the TO exception (re-enabled it), and again it starts working.

    So, it's definitely the TO exception thats the problem.

    Seems my other rules to allow traffic IN is working, it's just not responding out.


  • Seems my other rules to allow traffic IN is working, it's just not responding out.


    To clarify this further, here's what I've had in place for a few months now that has allows the service to work as expected :

    NAT :

    Full NAT (this is to allow me to use the external FQDN that everybody else connects with, makes my mobile apps easier to use/configure):
    Traffic From: Internal (network)
    Using Service: HTTP
    Going to : External (WAN)

    Action:
    Change Destination: Aquarium Controller
    Change Source to : Internal (Address)
    auto firewall rule

    ================

    DNAT:
    Traffic from: ANY
    Using Service: HTTP
    Going to: External (WAN)
    Change Destination: Aquarium Controller
    Change Service to: HTTP
    Automatic firewall rules


    Web Filtering is enabled:
    Allowed networks: Internal (Network), Transparent Mode
  • Let's try a little non-intuitive experiment.  Let's try To as your internal server (192.168.0.100).  You should still need your NAT rules for this to work to forward traffic from their servers to your controller.
  • Let's try a little non-intuitive experiment.  Let's try To as your internal server (192.168.0.100).  You should still need your NAT rules for this to work to forward traffic from their servers to your controller.


    Yes, that works

    And your referring to the DNAT rule posted below?
  • DNAT:
    Traffic from: ANY
    Using Service: HTTP
    Going to: External (WAN)
    Change Destination: Aquarium Controller
    Change Service to: HTTP
    Automatic firewall rules

    This should still be necessary if ***X is initiating connections to your controller.

    So with that last granular exception, using TO set to your controller, are we good?  Does this lock it down enough (not ANY) and things are working?
  • DNAT:
    Traffic from: ANY
    Using Service: HTTP
    Going to: External (WAN)
    Change Destination: Aquarium Controller
    Change Service to: HTTP
    Automatic firewall rules

    This should still be necessary if ***X is initiating connections to your controller.

    So with that last granular exception, using TO set to your controller, are we good?  Does this lock it down enough (not ANY) and things are working?


    Yup, this seems to be good. Now I can stop getting 100+ emails of port scan attempts from the US.


    Seriously, If you were in Canada Scott, I'd buy you a beer!

    Your help was tremendous.
  • Would have been quicker, but you seemed to wanted to remain obfuscated, so I didn't ask for the usual information (large chunks of copy/pasted log data and screenshots of your setup).  Made for more guess work.  [:)]

    I'd buy you a beer
    I'd rather poutine and a coke.  It's the thought that counts.  lol

    Keep blocking us Yanks....except the NSA...they're everywhere.  mwahahaha

    If anything else comes up, just start a new thread and we'll be here to help.
  • Would have been quicker, but you seemed to wanted to remain obfuscated, so I didn't ask for the usual information (large chunks of copy/pasted log data and screenshots of your setup).  Made for more guess work.  [:)]

    I'd rather poutine and a coke.  It's the thought that counts.  lol

    Keep blocking us Yanks....except the NSA...they're everywhere.  mwahahaha

    If anything else comes up, just start a new thread and we'll be here to help.


    yeah, since I don't own the IPs, I didn't want to possibly risk his network.

    Was just trying to be cautious. Turns out It was pointless once I typed the two n1 / n2 addresses. LOL.

    Poutine and a row of coke it is! [:D]