Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to allow access to Gmail, IP space keeps changing

    Scheduled Pinned Locked Moved Firewalling
    2 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      ttblum
      last edited by

      Hello,

      I'm doing egress filtering on my LAN, so I have it set up so that the LAN can access access certain e-mail servers.  I'm running version 2.1.3 on an Alix on this network.

      I added a rule to allow e-mail ports (aliased to 25, 110, 993, 465, 587, 443) to Gmail servers (aliased to imap.gmail.com and smtp.gmail.com).  However, the firewall was still blocking IMAP access from the LAN to Gmail, even though they were using the pfsense router to resolve DNS.

      I got the traffic flowing through OK by hardcoding Gmail's IP space into the alias: 74.125.0.0/16, 173.194.0.0/16 .

      This week, however, it looks like Google added more IP ranges for Gmail, and I had to hardcode them again: 209.85.128.0/17, 64.233.160.0/19 .

      Is there any way to be able to adapt to future changes with services like this?

      1 Reply Last reply Reply Quote 0
      • awebsterA
        awebster
        last edited by

        Have a look at this info from Google https://support.google.com/a/answer/60764?hl=en
        You can use dig _netblocks.google.com to determine what address IPv4 blocks are in there, and put them into your filter.
        Just put them into an IP alias so you don't need to keep touching the rules.

        There is no automatic method to do this, but I've found that it hasn't changed much over time.

        64.18.0.0/20
        64.233.160.0/19
        66.102.0.0/20
        66.249.80.0/20
        72.14.192.0/18
        74.125.0.0/16
        108.177.8.0/21
        173.194.0.0/16
        207.126.144.0/20
        209.85.128.0/17
        216.58.192.0/19
        216.239.32.0/19

        –A.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.