We have a Windows Server 2012 virtual machine (Web01) hosted in Windows Azure.

This server has yet to be decommissioned so for now we're allowing access from this machine to our database server (DB01) on another network.

Our database server uses replication but unfortunately returns the "local" IP address of the replica server (

I need to configure Web01 so that requests to are actually routed to the Azure Service IP Address XXX.XXX.XXX.XXX.

  • What you actually want to do looks to me like a DNAT. It will be easy with Linux/Iptables, but I have no idea on Windows. On Linux I'll add a rule in the NAT table at the Postrouting chain to change the target IP address for the Desired IP address. – Matías Apr 17 '15 at 16:20
  • 1
    Your setup is confusing me, I don't get the relation between the Web01 access to the DB01 and the replication, how are access and replication related? – Noor Khaldi Apr 18 '15 at 18:16
  • 1
    Another thing, the Web01 is on Azure, where is the DB01 server? local network or also on Azure? how are both servers connected? – Noor Khaldi Apr 18 '15 at 18:17

Pretty sure you're not going to be able to redirect an IP address in the way you've described, particularly since you don't have control of the Azure networking equipment. I would look into changing the application configuration to use the Azure Service IP Address. If it's an ASP web application, this would hopefully be as easy as changing the relevant connection string in the application's web.config file, as long as the developer didn't hard code the database connection or store it in some other file.

  • Per the other answer below, that would work only if the DB server you have in Azure also has an address of However, since you put xxx.xxx.xxx.xxx for the Azure address I interpreted that it is not. – Tony Hinkle Apr 17 '15 at 15:04

A static route would solve this,


route add <destination> mask <subnetmask> <gateway> metric <costmetric> if <interface>

For example:

route add mask metric 2

Taken From


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.