[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPv4 specific issue with USB tethering between my Debian laptop and my phone



On Wed, 15 Dec 2021, Vincent Lefevre wrote:

On 2021-12-15 06:09:12 +0000, Tim Woodall wrote:
On Tue, 14 Dec 2021, Dan Ritter wrote:

Vincent Lefevre wrote:
Hi,

When I use USB tethering between my Debian/unstable laptop and my
Samsung Galaxy Note10+ phone (Android 11), everything is OK with
IPv6 connections (e.g. "wget -6"), but IPv4 connections freeze
(e.g. "wget -4" or "ssh -4"). I can notice this in particular when
testing with the same remote server. For instance, with "wget -4",
a few dozens of KB are downloaded, then the connection is completely
frozen.

I don't have any issue with the mobile hotspot (thus wifi between the
laptop and the phone) or with a Cosmo under Android 9 (instead of the
Samsung Galaxy Note10+), but in both cases, this is much slower, and
I sometimes get wifi disconnections.

On my Debian laptop, I'm using NetworkManager (nmcli).

Have you investigated the MTU? This sounds like a mismatch
between what your laptop and phone are using.

Diagnosis (besides looking at connection details on both sides):
ping with increasingly large packet sizes. If it works at small
IPv4 packet sizes and then stops, that's the problem.

Indeed, this works up to
 ping -4 -s 1472 joooj.vinc17.net
 ping -6 -s 1452 joooj.vinc17.net

Yes, probably - --clamp-mss-to-ptmu in iptables might be what is needed.

Thanks, but taking the rules from

 https://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.cookbook.mtu-mss.html

I've tried

 iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

and

 iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1024

I think you possibly want -A OUTPUT rules too. And also ip6tables rules.

When I look at where I've configured this in the past I've also done it
on the mangle chain:

iptables -t mangle -A FORWARD -p tcp -o $NET_IF --tcp-flags SYN,RST SYN
-j TCPMSS --clamp-mss-to-pmtu

ip6tables -t mangle -A FORWARD -p tcp -o $NETv6_IF --tcp-flags SYN,RST
SYN -j TCPMSS --clamp-mss-to-pmtu

etc. (you may or may not want to bother writing explicit rules for each
interface)

If you're going via a firewall then you (usually) only need -A FORWARD
But if you're trying to configure it on your laptop itself you probably
need -A OUTPUT (and possibly -A INPUT).

and none of them have any effect. Or did I need something else?

Any other suggestion?




Reply to: