NetVM: topology shows CDP relay status

This commit is contained in:
Antigravity Agent
2026-10-03 01:02:25 -04:00
parent dba2375ee1
commit bded49d6fd
+7 -4
View File
@@ -12,9 +12,12 @@ for ns in $(ip netns list 2>/dev/null | awk '{print $1}' | grep '^warp-'); do
printf 'node=%s netns=%s ifaces=%s/%s handshake=%s egress=%s\n' "$NODE" "$ns" "$WG" "$VETH" "$hs" "${egress:-?}" printf 'node=%s netns=%s ifaces=%s/%s handshake=%s egress=%s\n' "$NODE" "$ns" "$WG" "$VETH" "$hs" "${egress:-?}"
done done
iptables -t nat -L POSTROUTING -n 2>/dev/null | grep '10.201\.' || echo "(no netvm NAT rules on host)" iptables -t nat -L POSTROUTING -n 2>/dev/null | grep '10.201\.' || echo "(no netvm NAT rules on host)"
echo "--- CDP bridges (per netns PREROUTING) ---" echo "--- CDP relays ---"
for ns in $(ip netns list 2>/dev/null | awk '{print $1}' | grep '^warp-'); do for ns in $(ip netns list 2>/dev/null | awk '{print $1}' | grep '^warp-'); do
echo "$ns PREROUTING:" netvm_names "${ns#warp-}"
ip netns exec "$ns" iptables -t nat -L PREROUTING -n -v --line-numbers 2>/dev/null | grep -E "REDIRECT|Chain" || echo " (empty)" if [ -f "/run/netvm-${NODE}-cdp-relay.pid" ] && kill -0 "$(cat "/run/netvm-${NODE}-cdp-relay.pid")" 2>/dev/null; then
echo "$ns route_localnet: $(ip netns exec "$ns" sysctl -n net.ipv4.conf.all.route_localnet 2>/dev/null || echo ?)" echo "$NODE: relay up ($PEER_IP:$CDP_PORT -> 127.0.0.1:$CDP_PORT)"
else
echo "$NODE: relay DOWN"
fi
done done