How to allow access to Gmail, IP space keeps changing

  • 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 and  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:, .

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

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

  • Have a look at this info from Google
    You can use dig 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.