title: Iptables to forward remote port to local port for local access
body: <p>I have an application in an application in Docker container. I have the DB in another Docker container. The DB container has an exposed port of 49155. The application requires that the database be exposed on port 3306 and I can't change that thanks to IonCube obfuscation. So, I can point my application to the database container just fine, but the application can't find the DB (wrong port).</p>
  
  <p>My initial solution was to us IPTables to forward local requests on port 3306 to the remote container on port 49155 using:</p>
  
  <pre><code>iptables -t nat -A PREROUTING -p tcp --src 127.0.0.1 --dport 3306 -j REDIRECT --destination 192.168.200.212 --to-ports 49155
  </code></pre>
  
  <p>Still not working. Any thoughts?</p>