gpt4 book ai didi

azure - 如何在 AZURE 中从 Internet 访问私有(private) VM IIS?

转载 作者:行者123 更新时间:2023-12-02 23:35:48 24 4
gpt4 key购买 nike

请下图:subnetimage

我有以下东西:3 个子网内的 3 个虚拟机均位于 Vnet1 中。VM1 已启用 IIS,并且通过子网 B 进行私有(private)访问。

有什么方法可以允许从 VM2 到 VM1 的流量吗?我已尝试多次但没有成功。

我遵循了下面的 MS Docs,但它只允许在网络内部(私有(private)),它不适用于互联网。 https://learn.microsoft.com/en-us/azure/virtual-network/tutorial-create-route-table-portal

我有此场景的自定义模板,您只需应用它即可创建所有配置。

您可以通过以下链接访问:

https://www87.zippyshare.com/v/bEcvSVnC/file.html

我是新来的,请帮助我解决这个问题。

更新:VM1 已分配公共(public) IP,我需要来自 VM2 的 vm1 公共(public) IP 的所有流量。

请查看下图以获取更多信息。 enter image description here

最佳答案

• 我建议您请attach one more NIC (Network Interface Card)子网 A 中的 VM1在该 NIC 中启用 IP 转发,同时在子网 B 中的 VM2 中启用相同的设置。自 VM2 is exposed to the internet and has a public IP address but VM1 doesn’t, thus when you configure the NSG (Network Security Group) of both the NICs, ensure that you are creating inbound as well as outbound rules for ensuring traffic flow smoothly over port 80 and 443 through both the NICs. This will ensure that internet traffic over the designated ports is only forwarded from the VM2 to the VM1 and vice versa .

• 另外,如果您愿意,您可以将附加 NIC 连接到 VM1 并将其关联到某个其他子网,即子网 C 或任何其他子网。这将确保只能为相关子网配置有效的子网级别 NSG,即添加了 VM1 的附加 NIC 的子网和 VM2 的子网。有关更多信息,请参阅以下有关将其他 NIC 连接到虚拟机的文档链接:-

https://learn.microsoft.com/en-us/azure/virtual-machines/windows/multiple-nics

https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface-vm#view-network-interfaces-for-a-vm

供引用的快照:-

VM NIC addition

IP forwarding

更新:- Yes, you can surely browse the IIS page by accessing the public IP address of the VM1 in local system through chrome browser. But you will need to open the ports 80 and 443 for inbound traffic access on the VM1's NSG. Also, if you want the VM1 to have a publicly accessible DNS name/label, then you will have to configure the desired DNS name in the VM1 settings 。如需进行上述配置,请引用以下链接:- https://social.msdn.microsoft.com/Forums/expression/en-US/98da3ab5-3909-4048-b935-95d5f7667ab5/accessing-azure-virtual-machine-iis-website-publicly?forum=WAVirtualMachinesforWindows#:~:text=1-%20Click%20on%20the%20VM,Click%20on%20Save .

关于azure - 如何在 AZURE 中从 Internet 访问私有(private) VM IIS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72263801/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com