10/06/2011

Ubuntu : Wake On LAN


การตั้งค่าให้ Ubuntu รองรับการสั่งเปิดเครื่องผ่าน LAN (Wake On LAN) ทำได้ ดังนี้
1.ตั้งค่าใน BIOS ซึ่งแล้วแต่รุ่น ประมาณว่า "Wake up on PCI event", "Wake up on LAN" 
2.ติดตั้งโปรแกรม ethtool (apt-get ethtool)
3.สั่งงาน sudo ethtool -s <NIC> wol g 
เช่น sudo ethtool -s eth0 wol g 
4.ปิดเครื่องแล้วลองสั่งงานด้วยโปรแกรมดู เช่น
4.1 ใน Ubuntu ใช้โปรแกรม gWakeOnLan
4.2 ใน Android ใช้โปรแกรม WoL WakeOnLan
4.3 ใน Windows ใช้ WOL จาก http://www.depicus.com/

บางเครื่องจะต้องสั่งงานใหม่ทุกครั้ง ป้องกันได้โดย
1. run คำสั่งทุกครั้งตอน LAN ทำงาน โดยใส่ไว้ใน /etc/network/interfaces เช่น
  1. auto eth0
  2. iface eth0 inet static
  3.         address 10.0.0.1
  4.         netmask 255.255.255.0
  5.         gateway 10.0.0.138
  6.         up ethtool -s eth0 wol g

หรือ
2. สั่งให้ run ทุกครั้งใน update-rc.d
2.1 สร้างไฟล์ /etc/init.d/wakeonlan
เนื้อหา
  1. ethtool -s eth0 wol g
  2. exit

2.2 chmod a+x /etc/init.d/wakeonlan
2.3 update-rc.d wakeonlan defaults

อ้างอิง : https://help.ubuntu.com/community/WakeOnLan

No comments:

Post a Comment