Skip to content

Instantly share code, notes, and snippets.

@arnathan2k
Created April 20, 2024 11:19
Show Gist options
  • Save arnathan2k/de4809d93a043eb0c5924337764b1b43 to your computer and use it in GitHub Desktop.
Save arnathan2k/de4809d93a043eb0c5924337764b1b43 to your computer and use it in GitHub Desktop.
User I have vnet1 peered with vnet2 and vnet 2 peered with vnet3. I deployed bastion service in vnet1 can I used Bastion to connect to VNET3?
n Azure, when using Azure Bastion to connect to virtual machines across peered networks, the Bastion service allows for RDP and SSH access only within the same Azure region and does not directly support transitive connectivity across multiple VNets by default. This means that even if VNet1 is peered with VNet2, and VNet2 is peered with VNet3, Azure Bastion deployed in VNet1 does not automatically provide access to VMs in VNet3, unless VNet1 is directly peered with VNet3.
Key Points:
Direct Peering: Azure Bastion requires direct network peering between the VNet where Bastion is deployed and the VNet containing the VMs you want to access.
Non-transitive Nature: VNet peering in Azure is non-transitive, meaning that if VNet1 is peered with VNet2 and VNet2 is peered with VNet3, VNet1 does not have a direct peering relationship with VNet3.
Your Scenario:
Bastion in VNet1: Deployed in VNet1.
Peering Configuration: VNet1 is peered with VNet2, and VNet2 is peered with VNet3.
Solution Options:
Direct Peering: To use Azure Bastion in VNet1 to access VMs in VNet3, you would need to establish direct peering between VNet1 and VNet3.
Deploy Additional Bastion Hosts: Alternatively, you could deploy another Bastion host in VNet3 if there are many VMs there and frequent access is required, justifying the cost.
Best Practice:
For simplicity and to leverage Azure Bastion effectively, it's often practical to ensure direct peering between the VNet hosting the Bastion service and any VNets hosting VMs you need to access securely. This setup avoids complexity and ensures that security and connectivity requirements are straightforwardly met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment