iac_modules/vpn-overlay/vxlan/README.md
Haitao Pan ff5741f8df feat(vxlan): enhance setup_sit_vxlan.sh, add overlay_diag.sh and README
- Changed parameter order: <dev_if> <local_ip> <remote_ip> <br0_ip> [cidr_suffix] [vxlan_id]
- Automatically apply CIDR suffix (/16 by default)
- Auto-trigger ARP learning with ping from veth
- Fixed SNAT to use dynamic interface instead of hardcoded eth0
- Added overlay_diag.sh to verify interface, FDB, VXLAN traffic and NAT status
- Added README.md with usage instructions and examples
2025-04-05 11:46:19 +08:00

51 lines
1.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# VXLAN Overlay 工具集
本目录包含构建与诊断二层 VXLAN Overlay 网络的实用脚本,适用于云主机场景(如 AWS EC2支持安全模式保留 eth0 仅用于管理面)。
---
## 🛠️ 脚本列表
| 脚本名称 | 说明 |
|----------|------|
| `setup_sit_vxlan.sh` | 安全模式部署 VXLAN Overlay 网络,仅桥接 `vxlan + veth` |
| `overlay_diag.sh` | 自动诊断 VXLAN 接口、桥接状态、FDB 转发表、Overlay 连通性 |
---
## 🚀 使用方法
### 1⃣ 初始化 Overlay 网络
- dev_interface出口物理网卡如 ens5
- local_ip本机内网 IPVXLAN 使用)
- remote_ip对端节点的内网 IP
- br0_ip本地 Overlay 地址(如 10.255.0.2
- cidr_suffix可选默认为 16设置为 /16 子网)
- vxlan_id可选默认 100
示例: bash setup_sit_vxlan.sh ens5 54.65.102.93 18.179.15.13 10.255.0.2 16 100
### 2⃣ 诊断 Overlay 网络连通性
示例:
bash overlay_diag.sh <local_overlay_ip> <remote_overlay_ip>
bash overlay_diag.sh 10.255.0.2 10.255.0.3
诊断内容:
- 接口是否存在、是否为 UP 状态;
- br0 IP 是否为非 /32 掩码;
- bridge fdb 是否学习到对端 MAC
- ping 测试 Overlay 层连通性;
- NATMASQUERADE规则是否存在
- VXLAN 报文抓包命令提示UDP port 4789
### 📦 典型应用场景
- 构建多节点跨主机的 L2 Overlay 隧道;
- 支持 VXLAN over 公网 IP内部互通 10.255.0.0/16
- 云主机或虚拟机跨可用区桥接;
- 上层可用于 gretap、bridge、L2 BGP、广播集群等。