Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 114303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:50:21+00:00 2026-05-11T02:50:21+00:00

I’m trying to send a WOL package on all interfaces in order to wake

  • 0

I’m trying to send a WOL package on all interfaces in order to wake up the gateway(which is the DHCP server, so the machine won’t have an IP yet).

And it seems that I can only bind sockets to IP and port pairs…

So the question is: How can a create a socket(or something else) that is bound to a NIC that has no IP? (Any languge is ok. c# is prefered)

@ctacke: I know that WOL is done by MAC address… My problem is that windows only sends UDP broadcasts on the NIC what Windows considers to be the primary NIC (which is not even the NIC with the default route on my Vista machine). And I can not seems to find a way to bind a socket to an interface which has no IP address. (like DHCP clients do this)

@Arnout: Why not? The clients know the MAC address of the gateway. I just want a send a WOL packet like a DHCP client does initially…(DHCP discover packets claim to come from 0.0.0.0) I don’t mind if I have to construct the whole packet byte by byte…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:50:22+00:00Added an answer on May 11, 2026 at 2:50 am

    It seems that I have found a solution. One can use winpcap to inject packets to any interface. And there is good wrapper for .net: http://www.tamirgal.com/home/dev.aspx?Item=SharpPcap

    (I would have prefered a solution which requires no extra libraries to be installed…)

    UPDATE: Here is what I came up for sending a WOL packet on all interfaces:

    //You need SharpPcap for this to work  private void WakeFunction(string MAC_ADDRESS) {     /* Retrieve the device list */     Tamir.IPLib.PcapDeviceList devices = Tamir.IPLib.SharpPcap.GetAllDevices();      /*If no device exists, print error */     if (devices.Count < 1)     {         Console.WriteLine('No device found on this machine');         return;     }      foreach (NetworkDevice device in devices)     {         //Open the device         device.PcapOpen();          //A magic packet is a broadcast frame containing anywhere within its payload: 6 bytes of ones         //(resulting in hexadecimal FF FF FF FF FF FF), followed by sixteen repetitions           byte[] bytes = new byte[120];         int counter = 0;         for (int y = 0; y < 6; y++)             bytes[counter++] = 0xFF;         //now repeat 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;             }         }          byte[] etherheader = new byte[54];//If you say so...         var myPacket = new Tamir.IPLib.Packets.UDPPacket(EthernetFields_Fields.ETH_HEADER_LEN, etherheader);          //Ethernet         myPacket.DestinationHwAddress = 'FFFFFFFFFFFFF';//it's buggy if you don't have lots of 'F's... (I don't really understand it...)         try { myPacket.SourceHwAddress = device.MacAddress; }         catch { myPacket.SourceHwAddress = '0ABCDEF'; }//whatever         myPacket.EthernetProtocol = EthernetProtocols_Fields.IP;          //IP         myPacket.DestinationAddress = '255.255.255.255';         try { myPacket.SourceAddress = device.IpAddress; }         catch { myPacket.SourceAddress = '0.0.0.0'; }         myPacket.IPProtocol = IPProtocols_Fields.UDP;         myPacket.TimeToLive = 50;         myPacket.Id = 100;         myPacket.Version = 4;         myPacket.IPTotalLength = bytes.Length - EthernetFields_Fields.ETH_HEADER_LEN;           //Set the correct IP length         myPacket.IPHeaderLength = IPFields_Fields.IP_HEADER_LEN;          //UDP         myPacket.SourcePort = 9;                         myPacket.DestinationPort = 9;                    myPacket.UDPLength = UDPFields_Fields.UDP_HEADER_LEN;           myPacket.UDPData = bytes;         myPacket.ComputeIPChecksum();         myPacket.ComputeUDPChecksum();          try         {             //Send the packet out the network device             device.PcapSendPacket(myPacket);         }         catch (Exception e)         {             Console.WriteLine(e.Message);         }          device.PcapClose();     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.