Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
35
rated 0 times [  35] [ 0]  / answers: 1 / hits: 42434  / 1 Year ago, sun, january 29, 2023, 10:32:06

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?


More From » iptables

 Answers
3
iptables -t nat -A PREROUTING -p tcp --dport 25570 -j REDIRECT --to-port 25565


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


[#40344] Tuesday, January 31, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
pipeag

Total Points: 489
Total Questions: 107
Total Answers: 115

Location: Iraq
Member since Fri, Jun 5, 2020
4 Years ago
;