> ## Content Index
> Fetch the complete content index at: https://note.xdq.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# 防止ARP超时
- URL: https://note.xdq.me/fang-zhi-arpchao-shi/
- Published: 2026-09-04T04:20:02.000Z
- Updated: 2026-09-04T04:20:02.000Z
- Author: xud6
- Tags: linux, #Import 2026-10-03 02:45

```
nano /etc/systemd/system/keep-arp.service

```

```
[Unit]
Description=Send periodic gratuitous ARP to prevent MAC aging (auto-IP)
After=network.target

[Service]
Type=simple
ExecStart=/bin/bash -c 'while true; do \
  IP=$(ip -4 addr show ens192 | grep -oP "(?<=inet\\s)\\d+(\\.\\d+){3}" | head -1); \
  if [ -n "$IP" ]; then arping -U -c 1 -I ens192 "$IP"; fi; \
  sleep 1; \
done'
Restart=always

[Install]
WantedBy=multi-user.target

```