Freenas Wake On Lan ?

Soldato
Joined
20 Oct 2006
Posts
2,595
Location
London
Please can someone explain how to setup this feature.

My bios supports it, but i am confused how it is configured on freenas etc

and does a special command have to be sent on windows CMD, when all is configured.

Any insight would be appreciated.
 
hi

emmm you don't have to do anything in freenas. If you Bios supports it, so must your Ethernet card.

You need your Ethernet cards mac address (unique 12 hexadecimal address of your Ethernet card), which you can find using ifconfig or when you setup your freenas (see interface through CLI gui or web GUI)

The you need something like this:

Code:
#!/usr/bin/python
import struct, socket

def WakeOnLan(ethernet_address):

  # Construct a six-byte hardware address

  addr_byte = ethernet_address.split(':')
  hw_addr = struct.pack('BBBBBB', int(addr_byte[0], 16),
    int(addr_byte[1], 16),
    int(addr_byte[2], 16),
    int(addr_byte[3], 16),
    int(addr_byte[4], 16),
    int(addr_byte[5], 16))

  # Build the Wake-On-LAN "Magic Packet"...

  msg = '\xff' * 6 + hw_addr * 16

  # ...and send it to the broadcast address using UDP

  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
  s.sendto(msg, ('<broadcast>', 9))
  s.close()

# Example use #Put your mac code here within the string literal
WakeOnLan('00:1e:7e:a4:4f:4e')

You need to substitute your mac code in above right at the bottom, nothing else. If you have more than one, just call the function WakeOnLan() again with the other machines mac address. Then just make sure the script is executable, chmod u+x, then your all set.

Hope this helps
 
Back
Top Bottom