简体   繁体   中英

How to create a private VM on azure with internet access

I want to provision a VM which has no public ip so it can only be connected from other VM who have public ip. Now i can create a VM without public ip but then it does not have a internet access.

Now is there a way on Azure like on AWS where i can provision a NAT gateway or NAT instance on public subnet and let the private instances have internet connection

I also tried using NAT Gateway on Azure but it doesn't work unless i assign public ip to VM which is not what i want

I have two subnets lets say public_subnet & private_subnet , now i can ssh to my private vm from a jump but the thing is when i login to my private vm i cant install any package or even not able to ping or curl to any website. Both subnets were created using terraform so the configuration of subnets are all same there is no change is subnet configuration

Azure VMs have internet access by default, you dont have to do anything for them to have outbound access. It just works. Even without the public IP

There's two possibilities:

First one, under the same Vnet, you provision you VM without a public ip adress and then access it usingAzure Bastion . You can find more details here .

Second one, is to provision two or more VMs in the same subnet one with public IP and the other without a public IP. and then access the one with private IP from the one with public IP.

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