| 场景 | 多出口环境选路与源地址核对 |
|---|---|
| 组合 | ip route get + ping -I + curl --interface |
查看选路与源
查看选路与源
ip route get 8.8.8.8
ip route get 8.8.8.8 from 10.0.0.5 # 指定源地址后的选路
ip rule show # 策略路由(多线路常见)指定出口实测
指定出口实测
ping -I eth1 -c2 8.8.8.8
curl -sS --interface eth1 -o /dev/null -w '%{http_code}\n' https://ifconfig.me
curl -sS -4 https://ifconfig.me; curl -sS -6 https://ifconfig.me # 看实际出口 IP辅助 IP 或双出口时 rp_filter(反向路径过滤)可能误杀非对称流量:sysctl net.ipv4.conf.all.rp_filter 核对(0/1/2)。