Last active
January 6, 2021 22:46
-
-
Save dmauser/b77634565e9131507c8d967c1385ee0e to your computer and use it in GitHub Desktop.
Dumps Azure Gateway BGP info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ExpressRoute or VPN Virtual Network Gateway (VNG) BGP info. | |
$RG="<Replace>" # Add Resource Group ExpressRoute or VPN Virtual Network Gateway | |
$VNGName = "<Replace>" # Add ExpressRoute or VPN Gateway Name | |
$Peerinfo = Get-AzVirtualNetworkGatewayBGPPeerStatus -ResourceGroupName $RG -VirtualNetworkGatewayName $VNGName | |
#Shows Peer Connections State, Routes Received, BGP Messages send and received | |
$Peerinfo | Format-Table | |
#Shows all routes learned by Virtual Network Gateway | |
Get-AzVirtualNetworkGatewayLearnedRoute -ResourceGroupName $RG -VirtualNetworkGatewayName $VNGName | Format-Table | |
#Shows all routes advertised by Virtual Network Gateway | |
foreach ($Peer in $Peerinfo.Neighbor) { | |
Write-Host "Advertised VNET routes to BGP Peer" $Peer -ForegroundColor Yellow | |
Get-AzVirtualNetworkGatewayAdvertisedRoute -ResourceGroupName $RG -VirtualNetworkGatewayName $VNGName -peer $Peer | Format-Table | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment