#PSTip How to prevent a VM from becoming a Router

Note: This tip requires PowerShell 3.0 or above.

Similarly to the Hyper-V security feature discussed here, Hyper-V can also protect the environment from VMs pretending to act as Routers.

Router Guard allows you to specify whether the router advertisement and redirection messages from unauthorized VMs should be dropped. A malicious VM can send router advertisement messages or respond to another VM’s router solicitation messages to claim itself as the router.

Set the RouterGuard parameter to “On” to drop router messages sent from a VM. Set it to “Off” to allow the messages.

Set-VMNetworkAdapter -VMName VM1 -Name Public -RouterGuard On

About the author: Shay Levy

Shay Levy is a Co-founder and editor of the PowerShell Magazine. He is a multiple-year recipient of the Microsoft MVP award, and a Microsoft Certified Trainer (MCT). Shay often covers PowerShell related topics on his blog and you can also follow him on Twitter at @ShayLevy

Related Posts