Skip to content

Missing IPv6-support #81

Closed
Closed

Description

@skibbi

Mosh does not seem to support IPv6. When specifying a hostname with both IPv4 and IPv6, an IPv4-connection is used. Specifying an IPv6-address results in:

/usr/bin/mosh: Could not resolve hostname 2a01:238:42a0:a200:e709:8d1c:581d:6e5a
ssh_exchange_identification: Connection closed by remote host
/usr/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).

Activity

  1. keithw commented on Mar 26, 2012

    @keithw
    Member

    Yes, the mosh protocol is IPv4 for now. I'm happy to add IPv6 support if I can test it; we need to make sure that (1) IPv4-to-IPv6-to-IPv4 roaming works correctly, and (2) mosh behaves sensibly in common situations.

    For example, if you're at your office talking to the mosh-server over IPv6, and then you roam to a cellular connection that only passes IPv4, that needs to work correctly. Which means we probably need to pass both addresses to mosh-client on startup, which is a little tricky -- since right now we only get one address (the one we connect the SSH connection to).

    Looking up and passing both addresses is (in theory) fine, but what happens if the server is multihomed and the same A record advertises 4 IPv4 addresses, and an AAAA record advertises 4 IPv6 addresses? We can't just pick one of each at random because we don't know they're the same server!

  2. stapelberg commented on Mar 27, 2012

    @stapelberg

    I have machines which are accessible via IPv4 only, IPv6 only, and which are dual-homed. I frequently roam between IPv6 and non-IPv6-networks. I started implementing a bit of IPv6 support already, but it’s not working completely. I will look into it in more detail soon.

  3. stapelberg commented on Apr 3, 2012

    @stapelberg

    I pushed a branch with preliminary IPv6 support here:
    https://github.com/mstap/mosh/commit/e06321f0056e9d943d2ebcc3f9c33effe897d9c4
    As the commit message mentions, this doesn’t address all the points yet.

  4. schinckel commented on Apr 10, 2012

    @schinckel

    When I try to use the indicated fork, I get the error:

    Can't locate Net/INET6Glue.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /usr/local/bin/mosh line 25.
    BEGIN failed--compilation aborted at /usr/local/bin/mosh line 25.
    
  5. blblack commented on Apr 12, 2012

    @blblack
    Contributor

    Looking up and passing both addresses is (in theory) fine, but what happens if the server is multihomed and the same A record advertises 4 IPv4 addresses, and an AAAA record advertises 4 IPv6 addresses? We can't just pick one of each at random because we don't know they're the same server!

    IMHO, that's just an even further corner case problem. I'd argue it's mostly irrelevant in the real world. Far more important just to get IPv6 support working sanely at all. Let someone else file an issue about their 4xIPv4 + 4xIPv6 destination hostname later :).

    For the most part, if you're opening a shell to a remote host, it's a specific host. For example, I might have a hostname in my DNS called "lb" which maps to 12x IPv4 and 6x IPv6 addresses for a pool of front-end loadbalancers for HTTP. But when I'm logging in over ssh or mosh for diagnostic troubleshooting I don't use that hostname. I use one of the several hostnames that map directly to the underlying, specific machines.

    Just be pragmatic: support basic v6+v4 like all software should these days, and ignore the v4:v6 mapping problem on reconnect for now, and I bet nobody ever complains. If they do, it might be better to solve this problem by probing anyways (the client can probe the list of possible/reachable IPs and check to see if the correct port responds with the correct response to a challenge, with the challenge and answer pre-shared back when the link was last active).

  6. keithw commented on Apr 13, 2012

    @keithw
    Member

    Unfortunately we do have users who use round-robin DNS entries and I don't really want to break mosh for them.

  7. jgater commented on Apr 16, 2012

    @jgater

    Looking up and passing both addresses is (in theory) fine, but what happens if the server is multihomed and the same A record advertises 4 IPv4 addresses, and an AAAA record advertises 4 IPv6 addresses? We can't just pick one of each at random because we don't know they're the same server!

    While being able to roam from ipv4 to ipv6 and back again would be useful, I'm wondering if that might be gilding the lily initially.

    In my own case, I have a bunch of linux servers behind a firewall; our public IPv4 address space is very limited, so rather than assign each server a specific port for SSH (and having to note which server has which) I give them AAAA records on the public DNS, and access them directly via IPv6. Then to get in, I can just ssh directly to their dns name (obviously the IPv6 firewall only allows ssh traffic, and I use key-auth for ssh). Most don't even have A records. In the event IPv6 isn't available when roaming, I can either fire up my own IPv6 tunnel to a broker, or as last resort go via IPv4 vpn and get in via internal DNS records over IPv4. In either case, transparent reconnect when roaming probably isn't going to work anyway, as the tunnel has to be up first. I wouldn't be surprised if IPv4 address limitations isn't a standard reason for using IPv6 for SSH in the first place.

    I'm thinking a relatively simple implementation for a first step would be to add a flag for IPv6 connections; if given, then mosh only attempts to connect via AAAA record, and ignores A/CNAME records. In the event IPv6 isn't available after roaming to a new connection, or resuming from sleep etc, then the connection is abandoned, though if it is then resume as per normal. You wouldn't need to break or alter IPv4 connectivity for round-robin users, but will still allow people wanting to use IPv6 to take advantage of the local-buffer, auto-resume, unicode support etc in mosh if they're prepared to use IPv6 exclusively for that connection.

    Once IPv6 becomes more common - as IPv4 exhaustion begins to bite - then it may be worth returning and looking at live roaming from IPv6 to IPv4 (and back) but I think basic IPv6 support would be very useful currently even absent that capability.

  8. blblack commented on Apr 16, 2012

    @blblack
    Contributor

    Yeah I'm not sure what the perfect solution is on the RR thing, but as the situation stands today: I wanted to try mosh, and the host I wanted to try it with is in a basic, normal mixed-family setup, and mosh failed to work. It didn't even fail gracefully - the client process had to be killed from another terminal window because it wouldn't accept input from me (e.g. Ctrl-C, Ctrl-^...).

    My local laptop and the remote host both have working, separate, singular IPv4 and IPv6 addresses, and both addresses are in DNS (as A + AAAA recs for a single name). This works fine with every piece of software I use (most everything preferentially connects over v6, and some older software sometimes uses v4 for various reasons, but one way or another they connect fine), except for mosh.

  9. keithw commented on Apr 16, 2012

    @keithw
    Member

    It sounds like you hit a different bug unrelated to IPv6. (Are you by any chance on a Mac?) mosh 1.2 (probably out this week) will have a fix for this bug, and you're welcome to try the current git master which also has it.

  10. blblack commented on Apr 16, 2012

    @blblack
    Contributor

    Yes, client side is mac, server side is Linux, in the case cited above. I'll try the current master.

  11. blblack commented on Apr 16, 2012

    @blblack
    Contributor

    Yes, switched to master on both sides and everything's fine. I guess my problem wasn't IPv6 after all :)

  12. barak commented on Apr 17, 2012

    @barak

    I would agree with the above "don't let the perfect be the enemy of the good" suggestions. I currently use ssh+screen to connect to an IPv6-only host. (It has a NAT IPv4 address which is irrelevant here.) So I don't care about switching between IPv4 and IPv6. I suspect most users who want IPv6 are in the same boat. So I would urge: get mosh working with IPv6, and worry about roaming IPv6-to-IPv4 later.

    I would further note that this "host might change address" issue is, in principle, not an IPv6 issue. A host can change its IPv4 address too...

  13. kmcallister commented on Apr 17, 2012

    @kmcallister
    Contributor

    A host can change its IPv4 address too...

    Yeah. An important instance of this is #210. Solutions to that problem may also apply to IPv6 and vice versa.

  14. mithro commented on May 7, 2012

    @mithro

    Any update on this? I'd love to use mosh but most of the machines I want to use it on are IPv6 only.

  15. 62 remaining items

  16. added a commit that references this issue on Mar 11, 2015
  17. dtaht commented on Jun 16, 2015

    @dtaht

    will mosh multipath be merged?

  18. cgull commented on Jun 16, 2015

    @cgull
    Member

    Not for mosh-1.2.5, which is just a rollup of bugfixes and cleanup PRs that were in the queue-- no more new features. I haven't even looked at https://github.com/boutier/mosh yet, though I'm definitely interested.

  19. nomadium commented on Jun 20, 2015

    @nomadium

    @cgull is there an ETA for mosh-1.2.5?

  20. cgull commented on Jun 20, 2015

    @cgull
    Member

    I should have the two remaining issues wrapped up this weekend-- OS X build and Debian bash completion. Release will come soon after that, depending on how much bake time it gets and if we find anything else.

  21. nomadium commented on Jun 21, 2015

    @nomadium

    Good to know, thanks for taking care of the release.

  22. kurtkraut commented on Apr 21, 2016

    @kurtkraut

    With the mosh -6 parameter I'm able to connect to my server using IPv6 but without mentioning this parameter, mosh (version 1.2.5 tested) will always prefer to connect using IPv4 instead of IPv6 if a AAAA DNS entry is available for the FQDN.

    I strongly suggest as browsers, OpenSSH and other client/daemon softwares behave, AAAA is prefered over A addresses.

  23. Mikaela commented on Apr 21, 2016

    @Mikaela

    I strongly suggest as browsers, OpenSSH and other client/daemon softwares behave, AAAA is prefered over A addresses.

    They follow RFC 6555 aka Happy Eyeballs which everything should support nowadays.

  24. graingert commented on Apr 21, 2016

    @graingert

    @Mikaela but mosh doesn't need to support Happy Eyeballs, it can make multiple connections simultaneously

  25. dtaht commented on Apr 21, 2016

    @dtaht

    I really would like to see mosh multipath merged. It's even happier than happy eyeballs.

  26. pavlix commented on Feb 6, 2017

    @pavlix

    I hope you don't mind that I created an issue just for the roaming, see #855 . This is an old issue for lack of IPv6 support. I have tried using mosh 1.2.6 on IPv6 with success and therefore I believe this issue should just be closed.

  27. achernya commented on Jan 19, 2023

    @achernya
    Collaborator

    We've since merged IPv6 support, and discussion on this issue has diverged. It's no longer clear to me what's being requested. Please file new issues for any missing functionality if you don't see an open one in the issue tracker already.

  28. dtaht commented on Jan 19, 2023

    @dtaht

    Thank you for so long ago making ipv6 just work. I use it all the time!

  29. removed this from the mosh-future milestone on Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions