防止ARP超时
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