Mosh Internal Port is not a guess—it’s a precise handshake between client and server. When you run mosh user@host, it first uses SSH on port 22 to authenticate. Then it switches to UDP, opening an internal port between 6000 and 6100 by default. This internal port is where your real interactive session lives. If the port is blocked, filtered, or misrouted, your connection fails instantly. SSH may succeed, but Mosh won’t transmit a single byte after the switch.
Experienced engineers know Mosh is built to survive drops, roaming networks, and IP changes. That resilience depends entirely on UDP packets flowing through the internal port without being mangled by firewalls or NAT. In clustered systems, the Mosh internal port range must be whitelisted across all nodes. Neglecting this detail breaks deployment automation, CI pipelines, or live ops shells.
You can set the port explicitly with --port=<number> or a range with --port=YYYY:ZZZZ. Administrators often tighten the default window to reduce exposure, but going too narrow risks collisions between parallel sessions. The range should be open in both directions, client to server and server to client. Always verify by running mosh --verbose and checking which internal port is negotiated in the log.