英文:
IP address range used by Firebase cloud functions when making call to an external server?
问题
我的Firebase云函数会调用外部服务器A。
服务器A只允许白名单中的IP地址发出请求。因此,我必须将Firebase云函数的IP地址(范围)提供给服务器A的管理员,以便他可以将其添加到受信任IP地址列表中。
静态IP地址似乎是可能的(https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip),但目前,我只想添加Cloud Functions可能使用的整个IP地址范围。
那么,Firebase云函数在调用外部服务器时使用的完整IP地址范围是什么?
英文:
My Firebase cloud functions make calls to an external server A.
This server A only allows requests when the incoming IP-address is whitelisted. So I have to give the (range of) IP address of the Firebase cloud functions to the admin of server A such that he can add it to his list of trusted IP-addresses.
A static IP-address seems to be possible (https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip) but for the time being, I would like to just add the entire range of IP addresses that Cloud Functions may use.
So what is the entire IP address range used by Firebase cloud functions when making call to an external server?
答案1
得分: 1
无论您使用自动NAT IP地址分配
还是手动NAT IP地址分配
,您都不会看到NAT IP的整个IP范围。当您选择手动NAT IP地址分配时,您应该能够看到NAT IP,因为您会保留和分配它们,但看不到它们来自的整个IP范围。
当Firebase云函数调用外部服务器时,它的内部IP地址将被Cloud Router进行NAT转换,因此您会看到Cloud Router的外部IP地址作为源IP,而不是函数的内部IP。
英文:
Whether you are using Automatic NAT IP address allocation
or Manual NAT IP address assignment
, you will not be seeing the entire IP range of the NAT IP(s). You should be able to see the NAT IPs when you go for Manual NAT IP address assignment as you reserve and assign them, but never the entire IP range where they came from.
When the Firebase cloud functions makes a call to the external server, its internal IP address which would have an IP range will be NAT-ted by the Cloud Router, thus you see the Cloud Router's external IP address as the source IP and not the function's internal IP.
答案2
得分: 0
所有可能由Google云函数使用的IP地址可以在此处找到:https://www.gstatic.com/ipranges/cloud.json(如在此处引用:https://support.google.com/a/answer/10026322?hl=en)
英文:
I guess all possible IP addresses used by Google cloud functions can be found here: https://www.gstatic.com/ipranges/cloud.json
(as referenced from here: https://support.google.com/a/answer/10026322?hl=en)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论