问题原文
原帖链接 · Sandra · CC BY-SA 4.0
In a firewall do I have to write the IP addresses I need access to. Many sites have a load balancer in front, so I would like to find the IP for it.
If I use google.com as an example
$ nslookup google.com
Server: 172.24.1.131
Address: 172.24.1.131#53
Non-authoritative answer:
Name: google.com
Address: 216.58.207.206
Name: google.com
Address: 2a00:1450:400f:80b::200e
Question
Is 216.58.207.206 the IP of the google.com load balancer or it just the IP of one of the hosts behind the load balancer?
If it is host a work host, how do I find the IP of the load balancer?
已采纳解答
原帖链接 · Tero Kilkanen · CC BY-SA 4.0
For this specific point of time when you made the DNS query, yes, 216.58.207.206 is the IP address where your broser will connect when you go to google.com. It doesn't matter if it is a load balancer or real web server, it is still the address you need to allow.
However, in general, allowing only specific IP addresses doesn't work with the general internet.
- Web sites often use CDN servers for static assets. The IP addresses for CDN servers will change over time
- Web sites use multiple discrete servers for serving web page resources. For example, connecting to
cnn.commakes web server fetch resources from 30+ domains. - Some sites are deployed in environments where their IP address changes on every deployment
In order to make a working allow list in the firewall, you would need to write software that constantly monitors all the resources needed by allowed web sites. The software then would add update the IP addresses in firewall configuration.
In practice, allowing modern web sites by IP addresses is not possible.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
