Skip to content

A lightweight self-healing and heartbeat monitoring tool for unstable IPv6 prefix environments.

License

Notifications You must be signed in to change notification settings

ruomox/guard4ServerIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPv6 Connection Guard (IPv6 连通性守护)

🌍 中文 | English

专治运营商光猫 IPv6 前缀变更导致的“僵尸 IP”与路由黑洞问题。

⚡️ 原理

  1. Local (本地):监听 UDP 心跳。若超时未收到心跳,调用 ndisc6/rdisc6 主动向光猫注入 RS/NA 包,强制刷新光猫的 NDP 表和路由表,实现秒级自愈。
  2. Remote (远端):持续发送 UDP 心跳。若连续断联(默认 5 分钟),调用外部命令发送报警邮件。

🛠 部署指南

1. 本地端 (被监控端)

依赖sudo apt install ndisc6 (Debian/Ubuntu) 或 dnf install ndisc6 (CentOS)

  1. 修改 guard4Local.py 配置区域:
    • INTERFACE: 网卡名称 (如 eno2)
    • GATEWAY_LL_IP: 光猫链路地址 (通常 fe80::1)
  2. 配置 Systemd 保活 (见 systemd/guard4ServerIP.service)。
  3. 防火墙放行 UDP 55555

2. 远端 (监控端)

  1. 修改 guard4Server.py 配置区域:
    • TARGET_DOMAIN: 你的 DDNS 域名
    • MAIL_COMMAND: 自定义发送命令 (支持 {TO}, {SUBJECT}, {BODY} 占位符)
    • TEMPLATE_PATH: HTML 模版路径
  2. 配置 Systemd 保活 (见 systemd/guard4ServerIP.service)。

⚠️ 注意

  • 本地脚本必须以 root 权限运行 (需要操作底层网络栈)。
  • 脚本纯 Python 3 编写,无第三方 pip 依赖。

📖 协议

MPL-2.0

About

A lightweight self-healing and heartbeat monitoring tool for unstable IPv6 prefix environments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published