Answer the question
In order to leave comments, you need to log in
How to redirect traffic to an already busy port?
Good afternoon!
There are 2 centos vps servers, you need to migrate jira from one server to another.
On server number 1 (let's say with ip 1.1.1.1) jira is currently running on port 8080.
On server number 2 (let's say with ip 2.2.2.2) a similar jira is installed and running on port 8081.
!But on server #2, port 8080 is already used by the tomket and cannot be changed!
Question:
During the change of DNS and migration of other servers, it is necessary to redirect incoming traffic from 1.1.1.1:8080 to 2.2.2.2:8081. It is also necessary that port 8080 remains in the browser.
Guys, tell me where to quickly dig out information, examples, there is simply no time to disassemble huge manuals.
ps: I got acquainted with unix systems quite recently, and netfilter is generally a dark forest. So please don't offend
Answer the question
In order to leave comments, you need to log in
In general, I solved the problem, who cares:
On the old server:
-------------------------------------- -------------------------------------------------- ------------
*nat
-A PREROUTING -d 1.1.1.1 -p tcp --dport 8080 -j DNAT --to-destination 2.2.2.2:8080
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
*filter
-A INPUT -p tcp --dport 8080 -j ACCEPT
COMMIT
-------------------------------- -------------------------------------------------- ------------------
On the new server:
---------------------------- -------------------------------------------------- ----------------------
*nat
-A PREROUTING -p tcp -d 2.2.2.2 --dport 8080 -j REDIRECT --to-port 8081
COMMIT
*filter
-A INPUT -p tcp --dport 8081 -j ACCEPT
COMMIT
--------------------------------- -------------------------------------------------- ------------------
Everything was easy and simple.
so that port 8080 remains in the browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question