Once I turned on the modem mode on my iPhone and connected to it with a laptop via WiFi, then I tried to connect to an SSH server via IPv4 address and got an error, although websites could be opened via IPv4 and IPv6.
It was possible to connect to SSH via IPv4 address from the iPhone itself, but not from devices via modem mode.
To solve the problem, I changed the access point settings for the Kyivstar mobile operator, namely, I opened Settings – Cellular Communications – Cellular Data Network and specified:
CELLULAR DATA APN: KS
and
MODEM MODE APN: KS
After this, devices connected via modem mode were able to make connections via IPv4.
By default it was set to: internet
See also my article:
Setting up SIP Trunk in Asterisk from Kyivstar