-1

I have to test the behavior of a SharePoint migration tool installed on my Azure VM when Internet connection is lost. I access to this VM by RDP. How can I cut off Internet connection of my VM and restore it later ?

Thanks in advance.

JoH
  • 514
  • 1
  • 6
  • 16

2 Answers2

0

Create a deny internet outgoing rule on the network security group and attach it to the VM network adapter.

https://blogs.msdn.microsoft.com/igorpag/2016/05/14/azure-network-security-groups-nsg-best-practices-and-lessons-learned/

You may have to create allow rules for Azure storage for outbound traffic for VM agent to work.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
0

I second the suggestions posted by 4c74356b41, you could also disable the Network Adapter and then reset the Network adapter to restore the connection. If you wish to take this approach checkout these steps:

For VMs deployed in Resource group model

  1. Go to the Azure portal.
  2. Select the affected Virtual Machine.
  3. Select Network Interfaces.
  4. Select the Network Interface associated with your machine
  5. Select IP configurations.
  6. Select the IP.
  7. If the Private IP assignment is not Static, change it to Static.
  8. Change the IP address to another IP address that is available in the Subnet.
  9. The virtual machine will restart to initialize the new NIC to the system.
  10. Try to RDP to your machine. If successful, you can change the Private IP address back to the original if you would like. Otherwise, you can keep it.

Delete the unavailable NICs After you can remote desktop to the machine, you must delete the old NICs to avoid the potential problem:

  1. Open Device Manager.
  2. Select View > Show hidden devices.
  3. Select Network Adapters.
  4. Check for the adapters named as "Microsoft Hyper-V Network Adapter".
  5. You might see an unavailable adapter that is grayed out. Right-click the adapter and then select Uninstall.

Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/reset-network-interface

AjayKumar
  • 2,812
  • 1
  • 9
  • 28