Azure PowerShell Commands for Listing Network Configuration
While working on Azure, PowerShell can be your friend when you need some information quickly, live and that is not visible in Azure Portal. Following are few of the commands that can be helpful for a network administrator working on Azure.
List all virtual network subnets by using PowerShell
Get-AzureRmVirtualNetwork -Name <My-vnet-name> -ResourceGroupName <vnet-resource-group-name> | Get-AzureRmVirtualNetworkSubnetConfig | Format-Table
List detailed route table of an ExpressRoute circuit. This command output will include prefixes learnt/advertised with Next hop, Local Preference, Weight and AS Path list.
Get-AzureRmExpressRouteCircuitRouteTable -ResourceGroupName: <express-route-resource-group-name> -ExpressRouteCircuitName: <express-route-circuit-name> -PeeringType: AzurePrivatePeering -DevicePath: Primary | Format-Table
List summary of BGP neighbor information for a particular routing context. This information is useful to determine for how long a routing context has been established and the number of route prefixes advertised by the peering router.
Get-AzExpressRouteCircuitRouteTableSummary -ResourceGroupName: <express-route-resource-group-name> -ExpressRouteCircuitName: <express-route-circuit-name> -PeeringType: AzurePrivatePeering -DevicePath: Primary | Format-Table
List traffic statistics for an ExpressRoute circuit. The statistics include the number of bytes sent and received over both the primary and secondary routes.
Get-AzExpressRouteCircuitStat -ResourceGroupName: <express-route-resource-group-name> -ExpressRouteCircuitName: <express-route-circuit-name> -PeeringType: AzurePrivatePeering | Format-Table
Lists an Azure virtual network gateway's BGP peers. Output of the command shows Local Address, Neighbor Address, Remote ASN, State, Connected Duration, Routes Received and message sent or received.
Get-AzVirtualNetworkGatewayBGPPeerStatus -VirtualNetworkGatewayName <virutal-gateway-name> -ResourceGroupName <vng-resource-group-name> | Format-Table
Lists routes being advertised by an Azure virtual network gateway. Output of the command shows Local Address, Advertised prefixes, Next Hop, Origin, ASPath and Weight
Get-AzVirtualNetworkGatewayAdvertisedRoute -VirtualNetworkGatewayName <virutal-gateway-name> -ResourceGroupName <vng-resource-group-name> -Peer <bgp-remote-peer-ip-address> | Format-Table
Lists routes learned by an Azure virtual network gateway. Output of the command shows Local Address, Learnt prefixes, Next hop, Peer from which the prefix is received, Route Origin, ASPath and Weight.
Get-AzVirtualNetworkGatewayLearnedRoute -VirtualNetworkGatewayName <virutal-gateway-name> -ResourceGroupName <vng-resource-group-name> | Sort-Object -Property Network | Format-Table
Comments
Post a Comment