VMware Cloud Community
asif-khalil
Contributor
Contributor

VM can ping the default gateway

I have assigned a project to check that VM can ping the default gateway using PowerShell CLI. How do I ping the default gateway of VM?

0 Kudos
2 Replies
LucD
Leadership
Leadership

I guess you need to do that from within the Guest OS of the VM.
If the VM has VMware Tools installed you can use the Invoke-VMScript cmdlet.

If you want to do that from a PowerShell script, you can use the Test-Connection cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Paul3000
Contributor
Contributor

To run en masse against Linux (RHEL or similar, at least), something like 'ping -c 4 `route -n | grep UG | cut -d '' '' -f10`' as a ScriptText would work.

0 Kudos