How to ping an Azure VM - Disable ICMP

Опубликовано: 22 Октябрь 2024
на канале: Tech Knowledge - Tushar's Vlog
3,384
19

TechKnowledge - Tushar's Vlog Channel Link
   / @techknowledge-tusharsvlog  

How to ping an Azure VM?
How to allow ICMP protocol on Azure VM
Allow ping from Azure Portal


Allow ping from PowerShell command

$RGname="Test"
$protocol="ICMP"
$rulename="Allow-ICMP"
$nsgname="Testvm1-nsg"

Get the NSG resource
$nsg = Get-AzNetworkSecurityGroup -Name $nsgname -ResourceGroupName $RGname

Add the inbound security rule.
$nsg | Add-AzNetworkSecurityRuleConfig -Name $rulename -Description "Allow App Protocol" -Access Allow `
-Protocol $protocol -Direction Inbound -Priority 3891 -SourceAddressPrefix "*" -SourcePortRange * `
-DestinationAddressPrefix * -DestinationPortRange *
Update the NSG.
$nsg | Set-AzNetworkSecurityGroup