简体   繁体   English

带有 azure vnet 的 Internet 网关

[英]Internet gateway with azure vnet

I would like to create an internet gateway in an azure vnet but I don't know what is the better way of do it.我想在 azure vnet 中创建一个 Internet 网关,但我不知道什么是更好的方法。 I mean when I create a new vm, by default, all the internet requests go throught his own ip address.我的意思是当我创建一个新的虚拟机时,默认情况下,所有的互联网请求都通过他自己的 IP 地址。 And I would like that those requests go throught the same ip addrees.我希望这些请求通过相同的 IP 地址。

One possibility is to create a linux vm with NAT that works as a internet gateway.一种可能性是创建一个带有 NAT 的 linux vm 作为互联网网关。 And then, I could set all the new vms with that vm as the gateway.然后,我可以使用该虚拟机作为网关设置所有新虚拟机。 But I wonder if there is a better solution.但我想知道是否有更好的解决方案。

For example, I've read the following article and it seems that I need: https://azure.microsoft.com/en-gb/documentation/articles/virtual-network-create-udr-classic-ps/例如,我阅读了以下文章,似乎我需要: https : //azure.microsoft.com/en-gb/documentation/articles/virtual-network-create-udr-classic-ps/

Any ideas?有任何想法吗?

Thanks!谢谢!

Your thought process makes sense.你的思考过程是有道理的。 You could indeed spin up a VM to act as a gateway, then spin up some VMs in the same vnet and route requests from the gateway to the other VMs.您确实可以启动一个 VM 作为网关,然后启动同一 vnet 中的一些 VM,并将请求从网关路由到其他 VM。 However, with this approach, you will need to manage all of the VMs in the system (the gateway and all VMs behind it).但是,使用这种方法,您将需要管理系统中的所有 VM(网关及其背后的所有 VM)。

A simpler solution that sounds like what you want can be found in the form of a VM Scale Set, which is currently in public preview.一个听起来像您想要的更简单的解决方案可以以 VM 规模集的形式找到,该解决方案目前处于公共预览阶段。 An example can be found here: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-nat .可以在此处找到示例: https : //github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-nat

If you click the 'deploy to azure' button in the above example, you will get a set of linux VMs behind a load balancer using NAT rules starting at 50,000.如果单击上面示例中的“部署到 azure”按钮,您将在负载均衡器后面获得一组使用 NAT 规则的 linux 虚拟机,从 50,000 开始。 So, you could ssh into the 0th VM by doing: ssh -p 50000 {username}@{public-ip-address}.因此,您可以通过 ssh -p 50000 {username}@{public-ip-address} ssh 进入第 0 个虚拟机。

If you're looking for windows VMs, you can use the following link and RDP into {public-ip}:50000 https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-nat如果您正在寻找 Windows 虚拟机,您可以使用以下链接和 RDP 进入 {public-ip}:50000 https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows -nat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM