summaryrefslogtreecommitdiffstats
path: root/roles/ethtool/README.md
blob: 69f987ee13ab98b73ad15561c5b52934b18a6a8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# ethtool Role

Installs ethtool and configures Wake-on-LAN (WoL) via a systemd service.

## Variables

```yaml
ethtool_wol_interface: "eth0"      # Network interface to enable WoL on
ethtool_lid_ac_action: "suspend"   # HandleLidSwitchExternalPower (ignore/suspend/hibernate/lock/poweroff)
```

## Usage

```yaml
- role: "ethtool"
  vars:
    ethtool_wol_interface: "enp0s25"
```

## Enabling Wake-on-LAN

Three steps required:

### 1. BIOS Configuration (manual)

**ThinkPad:**
1. Reboot → press `Enter` then `F1` at Lenovo splash
2. **Config** → **Network** → **Wake On LAN** → `AC Only` or `AC and Battery`
3. `F10` to save

**Other systems:** look in BIOS under **Power** → **APM** or **Advanced Power Management** → **Wake on LAN**.
Also disable **ErP/EuP Ready** to keep NIC powered during sleep.

### 2. Ansible (this role)

Enables WoL on the NIC via ethtool on every boot. Add to your play with the correct interface:

```yaml
ethtool_wol_interface: "enp0s25"
```

### 3. Lid behavior (laptops)

Role configures `HandleLidSwitchExternalPower` via `ethtool_lid_ac_action` (default: `suspend`). Set to `ignore` for WoL use case — lid close on AC won't re-suspend after wake. No effect on desktops.

### 4. Suspend the host

WoL is most reliable from suspend (S3). Shutdown (S5) requires BIOS "WoL from S5" support.

```bash
systemctl suspend
```

## Sending the Magic Packet

From another host or FritzBox UI (**Home Network → Network → device → Wake on LAN**).

## Verify WoL is enabled

```bash
ethtool enp0s25 | grep Wake
# Wake-on: g   ← means WoL is active
# Wake-on: d   ← means WoL is disabled
```