I used to run a service on port 25570 I'm now changing it to run on port 25565 but I still want people who try to access it on the old port to have access to the service. So I'd like to forward port 25570 to 25565 on the same machine.
I know there's a lot of questions that talk about forwarding to a different machine but I was wondering if the method is different when using the same machine?
This assumes you're not routing traffic for an entire network through this box and that if you were there's no expectation that traffic destined for other hosts will be on that port
It is worth noting the the accepted answer only applies for other network hosts connecting to the machine running iptables. It does not redirect the port for clients running on the iptables machine trying to connect to port 25570 (for example).
These entries will forward the port for connections coming from the network or from the local host running the services.