Skip to content

openwrt dropbear ssh timeout #193

Closed
Closed

Description

@yuhongwei380

last time,we use dropbear
2020.81-3 version,we can ssh to my remote openwrt across ipsec-vpn; but this time ,i upgrade my openwrt, and fine the dropbear version is update to 2022.82 ;we can't ssh to my remote openwrt ;but between remote sever and remote openwrt , it can work ;so i think maybe IPQos influences this ?

Activity

  1. mkj commented on Nov 1, 2022

    @mkj
    Owner

    I haven't had any reports of this, though it's possible. As far as I know AF21 (used by dropbear) is fairly normal though.
    Can you send logs of the ssh client getting stuck?

    You should be able to disable the qos if you run on the openwrt device:
    nft add rule inet filter output ip dscp set cs0

    A packet capture with wireshark/tcpdump might have some clues too.

  2. yuhongwei380 commented on Nov 1, 2022

    @yuhongwei380
    Author

    image
    like this ; when i want to ssh my remote openwrt(dropbear 22.82) over ipsec-vpn; it is hanged and noticed time out ; i try to switch my old version (20.81-3) ,it is work well , i can ssh my remote openwrt over ipsec-vpn ;
    Looking forward to your reply,Thank you!

  3. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    i am sure it is AF21 influenced this ssh problem samed as openssh 8.0 ; In OpenSSH version 8.1+ a DSCP value of AF21 is appended by default. This seems to break communication in some environments.
    so how can i revise the default dscp setting on openwrt ;
    image
    it does not work ,may this command is wrong?

  4. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    image
    i find it AF21 in the dropbear 2022.82 release-note

  5. mkj commented on Nov 2, 2022

    @mkj
    Owner

    OK yep, seems likely AF21 is the cause if OpenSSH 8.1 shows the same thing.
    Do you know which ipsec vpn software/hardware is being used? It might be worth seeing if it can be fixed there, given newer OpenSSH will have trouble too.

    AF21 is hardcoded for Dropbear, you can disable it by commenting out (or setting to 0 instead)

    val = 0x48; /* IPTOS_DSCP_AF21 */

    I'll make it a setting for localoptions.h in future.

    I'm not sure why that nft line didn't work, I tested the commandline here on my laptop. Is your openwrt system using iptables or nft? If it's iptables it will need a different command.

  6. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    my openwrt may used iptables ; i can find iptables;

  7. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    my ipsec-vpn is on the firewall device ; two huawei USG device ; i did not setting any qos in the ipsec-vpn

  8. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    yeap, i try to find any problem or setting in my firewall device ; but in remote ubuntu ; ssh version is 8.0; but it works well . So i am so confused ; last time we met this problem is in my remote centos8 linux server ; we add IPQos=thoughout in sshd_config .

  9. mkj commented on Nov 2, 2022

    @mkj
    Owner

    Debian (which Ubuntu follows) patched their OpenSSH to use the old IPQoS=cs1 setting , see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923879#17

    Perhaps it's a bug in the Huawei USG device, a few other things like vmware were also incorrectly handling DSCP.

    For iptables this might work?
    iptables -t mangle -A OUTPUT -j DSCP --set-dscp 0

  10. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    image

  11. mkj commented on Nov 2, 2022

    @mkj
    Owner
  12. ynezz commented on Nov 2, 2022

    @ynezz
    Contributor

    I'll make it a setting for localoptions.h in future.

    FYI for openwrt/openwrt#10405 I've created following workaround.

  13. mkj commented on Nov 2, 2022

    @mkj
    Owner

    FYI for openwrt/openwrt#10405 I've created following workaround.

    Thanks @ynezz , I hadn't seen those problems - I'd assumed OpenSSH had already shaken out any wonky network equipment!

  14. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    so i suggest next dropbear version should be the default ?

  15. ynezz commented on Nov 2, 2022

    @ynezz
    Contributor

    so i suggest next dropbear version should be the default ?

    Well, this is not an issue in dropbear, its just exposing broken QoS support on your device, so IMO you've following options:

    • disable the QoS in dropbear by using above suggested workarounds
    • fix QoS support on your target/device
  16. mkj commented on Nov 2, 2022

    @mkj
    Owner
  17. ynezz commented on Nov 2, 2022

    @ynezz
    Contributor

    I'll add the runtime option to let it be disabled in problematic networks/devices.

    Its your call :) I've not prepared PR for this simply because we've decided, that dropbear is critical element in the network infra, so any such bloat might has negative influence on its security.

    In the case of mt76 it looks like it was an unrelated driver bug that happened to trigger with AF21?

    Correct.

  18. mkj commented on Nov 2, 2022

    @mkj
    Owner

    Its your call :) I've not prepared PR for this simply because we've decided, that dropbear is critical element in the network infra, so any such bloat might has negative influence on its security.

    Yeah, normally I'd be reluctant to add workarounds for broken things, but the history of TOS/DSCP flag handling is messy and there are probably a few other broken network devices that are harder to change. It shouldn't add too much size.

  19. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    I think I'll leave the default as AF21, that is the proper way so cake shaper etc can prioritise interactive SSH sessions when traffic is heavy. I'll add the runtime option to let it be disabled in problematic networks/devices. In the case of mt76 it looks like it was an unrelated driver bug that happened to trigger with AF21? openwrt/mt76@5ec78e1

    so ,thats mean , you can provide a option to setting default when we met those ipqos problem?

  20. mkj commented on Nov 2, 2022

    @mkj
    Owner

    Yes, I'll add a flag that can be added to dropbear and dbclient.

  21. yuhongwei380 commented on Nov 2, 2022

    @yuhongwei380
    Author

    Thank you very much!Looking forward the next version of dropbear~ Now we can use the old version

  22. added a commit that references this issue on Nov 10, 2022
    86ac841
  23. added a commit that references this issue on May 11, 2026
  24. added a commit that references this issue on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions