ES
Normalmente
cuando desplegamos máquinas virtuales en Azure y no tenemos comunicación,
optamos como primer medio de validación utilizar el Ping (ICMP). En Azure
por defecto el Ping está bloqueado por el firewall del VM.
Para habilitarlo debemos ir al Firewall y permitirlo, podemos usar el siguiente script.
#IPv4
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
#IPv6
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow
Me gustaría
aclarar que este script funciona para cualquier equipo Windows este en Azure o
on premise.
Get-AzNetworkSecurityGroup -Name "Nombre_del_NSG" | Add-AzNetworkSecurityRuleConfig -Name ICMP-Ping -Description "Allow Ping" -Access Allow -Protocol ICMP -Direction Inbound -Priority 100 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange * | Set-AzNetworkSecurityGroup
EN
Normally when we deploy virtual machines in Azure and we do not have communication, we opt to use Ping (ICMP) as the first means of validation. In Azure by default Ping is blocked by the VM's firewall.
To enable it we must go to the Firewall and allow it or we can use the following script.
#IPv4
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow
#IPv6
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow
I would like to clarify that this script works for any Windows computer in Azure or on premise.
In addition to the scripts mentioned above, if we want to enable it to work outside of Azure through an NSG we can use the following script:
Get-AzNetworkSecurityGroup -Name "Nombre_del_NSG" | Add-AzNetworkSecurityRuleConfig -Name ICMP-Ping -Description "Allow Ping" -Access Allow -Protocol ICMP -Direction Inbound -Priority 100 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange * | Set-AzNetworkSecurityGroup