Backup, sftp : need help to force ipv4

NethServer Version: 7.9.2009
Module: backup

Hello all,

I want to backup my NS on a NAS of a friend, with sftp.
But this NAS is only accessible by ipv4.
Do you know how to force ipv4 in the backup module?

The sftp command have the option to do that (sftp -4 myuser@domain.com), but using cockpit I don’t know how to do it.

Thanks for your help…

Did you try the backup? Nethserver don’t support IPv6, so I think it always uses IPv4.

I can’t, because the SFTP connectivity validation fails.

Via ssh on the NS I have tested:
sftp -4 myuser@domain.com → it works, I can connect
sftp -6 myuser@domain.com → don’t work, it don’t ask me the password, connection timed out

And if I don’t force IPv4:
sftp myuser@domain.com → it take about 2 minutes before to ask me the password and then I can connect
So i think by default it’s IPv6, no?

Did you try to verify how is the resolution of host “hostname.domain.com” from your NethServer installation?
Consider also to verify the traceroute from your NethServer to the NAS. Maybe CentOS 7 and NAS are both IPv6 capable and they are using that IP protocol version for “talking”.

From my NethServer:
nslookup returns IPv4 and IPv6
traceroute and traceroute6 works

Please to note that from my PC, directly connected to a modem, I have the same results:
I can’t connect sftp with IPv6, it only works with IPv4

IMVHO this why sftp tries to use IPv6 instead of IPv4…

Anyway… nslookup tells me that you verified from your windows client… Am i wrong?

Yes ok. But is there a method to force IPv4?

I use Linux Mint, why?

yes there is, and you find it. But currently IDK if you can pass the parameter you need to SFTP. Unless somehow IPv6 answers cannot reach NS.

AFAIK nslookup is considered deprecated since decades on linux, preferring dig. nslookup moreover is still available on Windows (7, 8/8.1, 10 and 11) so… i get it wrong…
Anyway, maybe is the same from your Mint client PC and from Nethserver, but via ssh on NS you can be sure to have the proper result by NethServer perspective.