Answer the question
In order to leave comments, you need to log in
How to change the IP for an application that needs this particular IP?
In general, the task is this, there is a RHEL 6.4 Server system with a pair of network interfaces combined into one through bonding-a. This system has an IP address: 10.7.7.1. Further, an application is running on this system that needs a connection to the MySQL server 10.7.7.2 on port 3306. And in fact MySQL is running on 10.7.7.3. The connection parameters are hardcoded into the application, so they cannot be changed. I heard that you can do address translation through iptables . How to make it so that when an application accesses 10.7.7.2:3306 iptables intercepts it and sends a request to 10.7.7.3:3306, and receives a response back and feeds it to the application?
Answer the question
In order to leave comments, you need to log in
Try iptables -t nat -A OUTPUT -d 10.7.7.2 --dport 3306 -j DNAT --to-destination 10.7.7.3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question