Actually I have a router which have a pool of public ip addresses, and we have linux servers where port 22 is open and fixed public ip address is directly configured on the servers.
My requirement is that I wanted to connect to the server from the outside using port 10222 which will then forward it to port 22. And I’ll close port 22 on mikrotik and open 10222 instead.
Yes i agree, but the requirement is like this and i have to follow it. In fact, i’m not an expert in security but it was always a debate if servers should be NAT or assigned public ip address directly on DMZ environments.
By the way, there is no internal IP address configured on the server. Will it work like this or can i put the public ip address again like below.
Sorry, then I misunderstood your requirement. You only want to “translate” the port…correct?
Then I think you have to add a source nat rule together with masquerade. But no clue if there can be some sort of port translation.
But with this configuration, port 22 should be open on the ip address, which makes no difference. I think the best option will be to change the SSH port on the server and try some scripts to block attacks.