A
A
Anton Shvets2016-08-09 12:01:09
SSH
Anton Shvets, 2016-08-09 12:01:09

How to redirect ssh connection based on hostname?

let's say there are dns entries
10.10.10.10 server.name
10.10.10.10 ssh1.server.name
10.10.10.10 ssh2.server.name
i.e. we have one entry point from the external network, this is server.name.
machines ssh1 and ssh2 are on the local network.
i want
ssh server.name
to hit the input server server.name.
ssh ssh1.server.name
I get respectively on the necessary machine ssh1.server.name.
Port 22 is everywhere, otherwise they didn’t understand me here.
Is it possible to implement this without iptables settings?
And if it’s impossible without it, then what will the firewall rules be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Nikolaev, 2016-08-09
@nightvich

You have mixed everything you can....
You need to use port forwarding, this is the only correct option.
10.10.10.10:2222 will be redirected to ssh1.server.name:22
and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question