简体   繁体   中英

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. I mean when I create a new vm, by default, all the internet requests go throught his own ip address. And I would like that those requests go throught the same ip addrees.

One possibility is to create a linux vm with NAT that works as a internet gateway. 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/

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. However, with this approach, you will need to manage all of the VMs in the system (the gateway and all VMs behind it).

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. An example can be found here: 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. So, you could ssh into the 0th VM by doing: ssh -p 50000 {username}@{public-ip-address}.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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