I've 2 virtual systems, say 10.116.10.xxx and 10.116.11.xxx. I've the next code to transmit a miracle packet:

using System;
using System.Net;
using System.Net.Sockets;
using System.Globalization;

public class MagicPackets:UdpClient    
{
    public MagicPackets() : base()
    {
    }

    public void SetClientToBrodcastMode()    
    {
      if(this.Active)
       this.Client.SetSocketOption(SocketOptionLevel.Socket,
                                 SocketOptionName.Broadcast,0);
    }
}

public class Run
{
     public static void Main(string[] args)
     {
        Run.WakeFunction(args[0]);
     }

     private static void WakeFunction(string MAC_ADDRESS)   
     {
          MagicPackets client=new MagicPackets();
          client.Connect(new 
             IPAddress(0xffffffff),
             0x2fff);
          client.SetClientToBrodcastMode();
          int counter=0;
          byte[] bytes=new byte[1024];
         //first 6 bytes should be 0xFF
         for(int y=0;y<6;y++)
            bytes[counter++]=0xFF;
         //now repeate MAC 16 times
         for(int y=0;y<16;y++)
         {
             int i=0;
             for(int z=0;z<6;z++)
             {
                  bytes[counter++]= 
                      byte.Parse(MAC_ADDRESS.Substring(i,2),
                      NumberStyles.HexNumber);
                  i+=2;
             }
         }

         int reterned_value=client.Send(bytes,1024);
     }
}

The code works fine when run it from the computer on a single virtual network because the computer I wish to wake, but does not work when the computer is alternatively virtual network. Any ideas why and just how to repair?

Thanks, Gaz

Miracle packets are layer two packets and thus don't mix router (layer three) limitations.

How you can fix? Place the transmitter and also the receiver within the same broadcast domain. Within this situation, on a single virtual network.