Weird SSH problem, connects to different IP than specified

Asked by Just some naab

Hi all!

I'm having weird problem on one of my Ubuntu servers. When I try to connect with SSH from one server to another, it connects to a different IP. This would make more sense to me if I was connecting with hostnames, but not with IP addresses.

So basically running command from ubuntu server:

ssh 210.0.0.10

...connects to 210.0.0.20! This makes absolutely no sense to me and I have no idea how to troubleshoot this! Any ideas what's happening in here???

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Just some naab
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What response do you get if you ping that address?

Revision history for this message
Just some naab (naab) said :
#2

If I ping x.x.x.46 IP I get response from that same IP. However if I ping x.x.x.22 IP I don't get response.
When I SSH (and login) to .46 IP and check server IP config with ifconfig, I see that the IP is .22.

This makes no sense to me.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

If you can't ping the server, then there seems to be something wrong with your address scheme.
Check your DHCP settings (if used), /etc/hosts files, etc.

Revision history for this message
Just some naab (naab) said :
#4

sudo ip addr flush ens160 && sudo systemctl restart networking

This command when ran on connecting server solved problem!