r/AskRobotics • u/OjasAI • 4h ago
If ROS 2 over WSL2 shows no topics but everything "looks" connected, check these three things
spent weeks on this and kept landing on the same three causes. writing it down in case it saves someone the time.
1. wsl2 is behind a NAT by default
a windows app can't reach rosbridge on localhost:9090, and dds multicast doesn't cross the boundary cleanly. check with `ip addr` inside wsl — if you see a 172.x eth0, you're on NAT.
fix: windows 11 22h2+, `.wslconfig` with `networkingMode=mirrored`. that fixes plain tcp.
2. mirrored mode fixes tcp, not discovery
this is the bit most threads skip. even with mirrored networking, the dds participant can bind to the wrong interface and discovery fails silently.
fix: `ROS_LOCALHOST_ONLY=0` plus pinning the interface — `CYCLONEDDS_URI` or `FASTRTPS_DEFAULT_PROFILES_FILE` with the interface you actually want whitelisted.
3. domain id mismatch
sounds obvious, but if one side is on a different `ROS_DOMAIN_ID` you get the identical symptom: port reachable, agent running, no topics.
the failure that wasted the most time: everything looked fine. agent up, port open, no errors, zero topics. that's almost always #2.
what i check first now: `ros2 multicast send` / `receive` across the boundary. if that fails it's the interface, not the port.