0

I need to exchange information with one webserver through soap.

I have a computer with dynamic IP, but webserver allow only static ip (whitelisted). Also, I have a centos server with static ip.

How can I set up middle server to redirect SOAP messages from it to destination server?

Alex Antonov
  • 151
  • 1
  • 6

1 Answers1

0

Using iptables on Centos server:

iptables -t nat -A PREROUTING -p tcp -s (computer with dynamic IP's IP) --dport 80 -j DNAT --to (webserver's IP):80
mvillar
  • 392
  • 2
  • 14
  • But then this rule would have to be updated every time the IP address changed. Wouldn't an HTTP proxy make more sense? – Andrew Schulman Jun 07 '14 at 10:50
  • @AndrewSchulman If there's not other services listening on port 80, you can skip the -s flag, else haproxy is a better option, redirecting something like 8080 to soap's server 80 (deleted prior comment because i was late to 5 minutes deadline to edits.) – mvillar Jun 07 '14 at 11:08
  • @mvillar here is origin source `http://80.246.252.210:4444/test_test82_03/ws/orders?wsdl`. I used this command `iptables -t nat -A PREROUTING -p tcp --dport 4444 -j DNAT --to 80.246.252.210:4444` but with no success. Maybe, I need to add something? – Alex Antonov Jun 07 '14 at 13:21
  • On your main computer you are trying http://centos-server-ip:4444/test_test82_03/ws/orders?wsd, right? – mvillar Jun 07 '14 at 14:31
  • In CentOS server,with tcpdump you can test if packets are moving as expected: `tcpdump -i eth0 port 4444 -n` If your iface is not eth0, edit that. You should see incoming packets from your main computer and outgoing packets to 80.246.252.210 and viceversa – mvillar Jun 07 '14 at 14:32