Sophos: XG Geo-Blocking

Quinntin Comer General IT, Networking/Network Security Leave a Comment

I noticed that this is a topic that doesn’t nearly come up as much as it does with some of the other vendors, particularly SonicWALL, and I am betting that it is probably due to the following reasons: 1) Folks not using GeoBlocking because its “one more thing to break”, or 2) They are unsure of how to do it with XG Firewalls.

Here we go!


Geo/Country Blocking in the Sophos XG is not as intuitive up front as some other manufacturers. However, once you see the way it is done it will seem completely intuitive.

The purpose for GeoBlocking is to stop traffic from countries that are known for attacks, botnets, c&cs, etc. Also, if you aren’t expecting traffic from those countries — why leave the screen door open for them?


  1. Login to your XG firewall as an administrator (https://X.X.X.X:4444)
  2. Navigate to System > Hosts and Services
  3. Navigate to Country group (tab) > Add (button)
  4. Enter in the following information in the next screen:
    1. Name: Give it a descriptive name, I use the following: WAN-ADDRGrp-Blocked Countries. This tells us its WAN hosts, an Address Group, and what the purpose is.
    2. Description: A description that is meaningful to you.
    3. Select country: Press “Select all” and then uncheck United States. You can do this easier by selecting all first and then searching in the window for United States.
    4. Press “Apply 248 selected items“.
    5. Press “Save
  5. Go to Protect > Firewall. Click “Add firewall rule
  6. Select “User/Network rule
  7. Create a rule with the following information, or substitute with your preferred naming.
    1. Rule name: WAN-LAN-CountryBlocking. This tells us it is WAN to LAN and what it is for.
    2. Rule group: Traffic to Internal Zone
    3. Action: Drop (reject sends notice back to the originator)
    4. Source zones: Any
    5. Source Networks and devices: WAN-ADDGrp-Blocked Countries
    6. During Schedule: All the time
    7. Destination zones:Any
    8. Destination networks: Any
    9. Services: Any
    10. Make sure “Match known users” is NOT checked.
    11. Check “Log firewall traffic
    12. Press “Save

Voila! You have Country/GeoBlocking Configured. To troubleshoot, you can now view this under the Log viewer > Firewall.

Leave a Reply

Your email address will not be published. Required fields are marked *