From 6984ec4df0da50519681d6b76caa961b05da95c8 Mon Sep 17 00:00:00 2001 From: Antigravity Agent Date: Sat, 3 Oct 2026 00:55:39 -0400 Subject: [PATCH] =?UTF-8?q?NetVM:=20CDP=20bridge=20=E2=80=94=20REDIRECT=20?= =?UTF-8?q?veth=20IP:CDP=5FPORT=20to=20loopback=20in=20netns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/netvm-node-up.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/netvm-node-up.sh b/bin/netvm-node-up.sh index b53f69a..5ddb7bd 100755 --- a/bin/netvm-node-up.sh +++ b/bin/netvm-node-up.sh @@ -55,6 +55,14 @@ nsexec ip link set "$WG" up nsexec ip route replace default dev "$WG" nsexec ip -6 route replace default dev "$WG" 2>/dev/null || true +# CDP bridge: chromium binds DevTools to loopback only; redirect the veth +# IP:CDP_PORT there so the host (and SSH-forwarded operators) can reach it. +# (netns iptables is namespaced; rules vanish with the netns on down.) +nsexec sysctl -qw net.ipv4.conf.all.route_localnet=1 +nsexec sysctl -qw "net.ipv4.conf.${VPEER}.route_localnet=1" +nsexec iptables -t nat -C PREROUTING -d "$PEER_IP" -p tcp --dport "$CDP_PORT" -j REDIRECT --to-port "$CDP_PORT" 2>/dev/null || \ +nsexec iptables -t nat -A PREROUTING -d "$PEER_IP" -p tcp --dport "$CDP_PORT" -j REDIRECT --to-port "$CDP_PORT" + # wait for handshake (first one can take ~10s) HS="" for i in $(seq 1 10); do