Azure Bastion VM showing different public IP than expected

Gokul R Dev 326 Reputation points
2023-07-20T05:03:00.61+00:00

Question: I have set up an Azure Bastion with a static public IP. A VM in the same VNet has no public IP assigned but the RDP port is open. However, when I browse "what is my public IP" in the browser, I receive a different IP than the Bastion IP. Why is this happening and how did this different public IP get associated with it?

Azure Bastion
Azure Bastion
An Azure service that provides private and fully managed Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines.
247 questions
{count} votes

Accepted answer
  1. Sedat SALMAN 13,265 Reputation points
    2023-07-20T07:02:58.4266667+00:00

    Azure Bastion Service enables you to securely and seamlessly RDP & SSH to the VMs in your virtual network. Azure Bastion enables connections without exposing a public IP on the VM. Connections are made directly from the Azure portal, without the need for an extra client/agent or piece of software.

    Reference Link: https://video2.skills-academy.com/en-us/azure/virtual-network/ip-services/configure-public-ip-bastion

    So Bastion IP is not your internet connection IP. Bastion IP is just your SNAT IP to hide the IP of your resources.

    SNAT allows multiple private IP addresses to share a public IP address for outbound communication. The specific public IP address used for SNAT can be different from the public IP address of the Bastion service. This is why you're seeing a different public IP address when you check from the VM.

    If you want to control the outbound IP address of your VM, you can use Azure NAT Gateway or assign a public IP address to the VM's network interface. However, assigning a public IP address to the VM would expose it to the internet, which might not be desirable from a security perspective.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful