You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
allow client-side port or port range to be specified #365
It would be useful if mosh allowed the client port, or port range, to be specified. The envisaged scenario is something like:
set up firewall to pass through UDP port 60001
mosh -p 60001 -P 60001 server.example.com.
or with port ranges:
set up firewall to pass through UDP ports 6[01]000
mosh -p 60000:61000 -P 60000:61000
Mosh currently uses a system-assigned port number for mosh-client. It is therefore not possible to tunnel mosh through stateless firewalls, unless they are set up to allow essentially all UDP through.
(This scenario is common for DNS. For instance, a BIND name server can be configured to always use source port 53 when acting as a client, allowing a port 53-only UDP pass-through on the firewall.)
The code for server-side port ranges is already in place, via try_bind(), although this is not currently exposed to the user. What seems to be required is a modification to the client's Connect() to call try_bind() with a port or port range, if specified.
Actually, this is not a duplicate of #296; that's about specifying a server side port range, this is about specifying a client side port or port range.
Activity
yaniv-aknin commentedon Mar 20, 2013
+1
JustRamires commentedon Mar 25, 2013
I've tried to modify source code(https://github.com/JustRamires/mosh/commit/3d0381938573c0f7ced3a201e916c3946fc1300c). But when I try to start mosh-client I get the "MOSH_KEY environment variable not found" error. And I can't change mosh because I don't know Perl(The script doesn't pass the port range to mosh-client).
How can I test my changes?
sinkers commentedon May 27, 2013
+1 Mosh looked cool but without a way to get through a firewall it makes it pretty much unusable in a corporate environment
andersk commentedon Jul 8, 2013
Duplicate of #296 (now closed).
cgull commentedon May 31, 2016
Actually, this is not a duplicate of #296; that's about specifying a server side port range, this is about specifying a client side port or port range.
eminence commentedon Aug 3, 2017
#530 is one solution (though it doesn't expose a command line parameter like this issue suggests)
achernya commentedon Jan 20, 2023
Adding a
--client-bind=would be a reasonable spelling.