Network connection: the local SSH connection using the IP address of the private network does not work

I tried to ssh connect to the local machine as

ssh me @ host -p 2222 

You will be asked for a password to log in

However, if I try with

                $ ssh me@192.168.31.127 -p 2222
ssh: connect to host 192.168.31.127 port 2222: there is no route to the host


the ip address:

$ ssh me@192.168.31.127 -p 2222
ssh: connect to host 192.168.31.127 port 2222: there is no route to the host

the localhost 127.0.0.1 jobs

$ ssh me@127.0.0.1 -p 2222
The authenticity of the host & # 39;[127.0.0.1]: 2222 ([127.0.0.1]: 2222) & # 39; can not be established.
The fingerprint of the ECDSA key is SHA256: rWQnXUO8mSlXRgNN4Jp1HMNqIO6K7WBO3EAihzvc3Es.
Are you sure you want to continue connecting (yes / no)? yes
Warning: Permanently added & # 39;[127.0.0.1]: 2222 & # 39; (ECDSA) to the list of known hosts.
********************************************** * ************************
NOTICE TO USERS

What is the problem?