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