How to allow access to Gmail, IP space keeps changing
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: 220.127.116.11/16, 18.104.22.168/16 .
This week, however, it looks like Google added more IP ranges for Gmail, and I had to hardcode them again: 22.214.171.124/17, 126.96.36.199/19 .
Is there any way to be able to adapt to future changes with services like this?
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.