From bded49d6fdf2f169adbc2d5efec74aeaf0c4d7a6 Mon Sep 17 00:00:00 2001 From: Antigravity Agent Date: Sat, 3 Oct 2026 01:02:25 -0400 Subject: [PATCH] NetVM: topology shows CDP relay status --- bin/netvm-topology.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/netvm-topology.sh b/bin/netvm-topology.sh index 3e32200..6c9b2eb 100755 --- a/bin/netvm-topology.sh +++ b/bin/netvm-topology.sh @@ -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:-?}" done 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 - echo "$ns PREROUTING:" - ip netns exec "$ns" iptables -t nat -L PREROUTING -n -v --line-numbers 2>/dev/null | grep -E "REDIRECT|Chain" || echo " (empty)" - echo "$ns route_localnet: $(ip netns exec "$ns" sysctl -n net.ipv4.conf.all.route_localnet 2>/dev/null || echo ?)" + netvm_names "${ns#warp-}" + if [ -f "/run/netvm-${NODE}-cdp-relay.pid" ] && kill -0 "$(cat "/run/netvm-${NODE}-cdp-relay.pid")" 2>/dev/null; then + echo "$NODE: relay up ($PEER_IP:$CDP_PORT -> 127.0.0.1:$CDP_PORT)" + else + echo "$NODE: relay DOWN" + fi done