Chatreey N100 T8 Plus WOL 세팅



바이오스 설정:

Bios Boot탭의
Network Stack [Enable]
State After G3 [S0 State]



OS 설정:

우분투에서 필요한 패키지 설치
apt install net-tools ethtool wakeonlan

ifconfig명령어로 연결된 인터페이스명 조회 후
sudo ethtool -s [인터페이스] wol g

설정 확인
sudo ethtool [인터페이스명]

서비스 작성
vim /etc/systemd/system/wol.service

[Unit]
Description=Configure Wake-up on LAN
[Service]
Type=oneshot
ExecStart=/sbin/ethtool -s [인터페이스] wol g
[Install]
WantedBy=basic.target

ststemctl Daemon에 등록:
systemctl daemon-reload
systemctl enable /etc/systemd/system/wol.service
systemctl start /etc/systemd/system/wol.service

/etc/sudoers 설정:
user ALL=(ALL:ALL) NOPASSWD: /sbin/shutdown, /usr/sbin/shutdown



HA 설정:
**원격 계정의 /etc/sudoers에 유저계정을 넣고 ssh원격 종료시 sudo명령어 없이 실행(ubnutu 22.04). Raspberry Pi OS 6.1처럼 보통은 sudo 명령을 넣어야 에러없이 실행됨.

shell_command.yaml:
turn_off_moon: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/id_rsa user@192.168.1.15 shutdown -h now

switch.yaml:
- platform: wake_on_lan
  mac: "00-00-00-00-00-00"
  name: "Moon"
  host: "192.168.1.15"
  turn_off:
    service: shell_command.turn_off_moon