Redirect remote ip request

I have a compiled program (win32) that tries to connect to an ip address (for updates, etc). However, that ip has now changed, and I still want the online connectivity.

I researched how this program connects to the ip, and it tries to connect directly to an ip, not a hostname so editing hosts file is not possible.

Is there any software or hardware solution to "redirect" the remote ip to another ip address? I tried googling it, and I get ICMP redirects and IP tunnelling, both of which are not feasible for my problem.

I would need something similar to ip tunneling, except I "catch" the ip address and then "tunnel" it to another before it reaches outside my LAN or my NIC. That's my guess, but I can't find any suitable software.

Are there packet sniffers or some other hardware solution to redirect a remote ip request via TCP to another remote IP.
teken894Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Voltz-dkCommented:
dnat (destination nat) will rewrite the destination in the packet.  Most routers & hardware firewalls can do this.  I don't see why it shouldn't be possible to do with software as well, although I don't know any.  So I guess this isn't of much help, but gives you a term to search for..
Voltz-dkCommented:
Oh, it's also sometimes refered to as bidirectional nat.  (And when I say most routers & firewall can do it, I must admit I've never seen any in the very cheap end that could.  But then I haven't seen many of those).
sachin_raoraneCommented:
You are directly accessing the IP, How how will the application come to know that IP dont exists...and then even it come to know how it will come to know now where to redirect... You need to modify your application or either use host name or put condition in the application This is from application point.

Alternately you can make arrengment at your Network level or if u have router u can capture the request of particular IP and redirect it to some other ip

The Following link explains the same http://www.cisco.com/univercd/cc/td/doc/product/wireless/airo1100/accsspts/techref/ipredir.pdf

Check this Application
www.georedirect.com

Cheers & Happy New Year
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

teken894Author Commented:
i don't have any fancy networking equipment in home, and so don;t have functionality in my $30 router....that's why im looking for a software application..


I can't change my application as its already compiled (and I lost source code :X)
teken894Author Commented:
i looked at geodirect

the problem is that the ip is redirected after reaching a host...i want to redirect the packet because the host (IP) is unreachable and want to redirect it to the current ip...

I need something like ip tunneling, except the "tunneling" should be done before actually reaching the host by means of capturing the packet..

If i can't find any software, looks like I have to write my own :D
teken894Author Commented:
is there any proxy server (widows/unix) that changes the dnat? Or is there any software that can change the dnat if i use a windows/unix machine as a gateway...just my intuition..
Tim_UtschigCommented:
If you can use a Linux machine as your gateway, that'd make it easy...

   iptables -t nat -I PREROUTING -s 1.2.3.4 -j DNAT --to-destination 5.6.7.8

The above redirects all IP packets destined for 1.2.3.4 to 5.6.7.8.
Tim_UtschigCommented:
Whoops my bad that should be -d not -s:

   iptables -t nat -I PREROUTING -d 1.2.3.4 -j DNAT --to-destination 5.6.7.8
Tim_UtschigCommented:
If you go the route of writing your own program, you can write a custom wsock32.dll (or whichever your application uses) which wraps all Winsock calls, and changes the destination address for connect() calls to a certain IP address.

I wrote something like that a long time ago (all it did was log the Winsock calls).  It's not too difficult.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.