Azure – Cannot SSH into Azure VM Using Public IP

azure

We have a Site-to-Site from our On-premise to the Azure Cloud. I added a public IP to a VM. I am able to SSH into the VM using the private IP. I want to access the public IP over the VPN & internet. I dont know what I am missing here. Please can someone help ? If I add a rule to allow Any to Any, I can access the Public IP from my network but dont want to configure it like that.

Thank you in Advance

Best Answer

Unless you use Azure ExpressRoute, you can only access an Azure Public IPs over the Internet, your traffic will not traverse the VPN to reach the Public IP, it will leave your location as per any other Internet bound traffic.

As you have successfully reached the VM via the VPN, we can assume that SSH and your access itself is working fine.

Therefore you should review the Network Security Group attached either to the NIC itself or attached to the Subnet in which the VM resides to ensure it allows TCP/22 (SSH) with a source IP set to be your external IP address of your location (use something like: http://whatismyip.akamai.com/ to find out) and the destination either set to the private IP address of the VM (not the public IP) or an Application Security Group of which the VM is a member.

Related Topic