Accessing ssh servers behind NAT

Create a "config" file in your "~/.ssh" directory with the below contents:

Host server1
  HostKeyAlias server1
  CheckHostIP no
  Port 221

Host server2
  HostKeyAlias server2
  CheckHostIP no
  Port 222

The key is to set CheckHostIP to "no" and use "HostKeyAlias" to specify an alias that should be used instead of the real host name when looking up or saving the host key in the host key database files.

The Port line avoids having to specify the port when connectig.

Connect to corresponding host via:

$ ssh {user}@server1
$ ssh {user}@server2