Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to forward an existing port for an application which can only listen on one port. The problem is the program and the firewall is on the same computer (Windows Server 2008 R2).

For instance, my app listens on port 65000. Users can access it from example.com:65000. But I want to add the possibility for users to access it from example.com:64000. The server would act like a NAT, but on the same machine, changing request packets' destination port from 64000 to 65000 and the response packets' originating port from 64000 to 65000.

As far as I could do, I only succeded in the first phase, with destination port. But the server responds either on wrong address (depending on the params I set, if I kept the source address or rewriting to 127.0.0.1) or wrong originating port. It was with NetworkActif Autapf, but I think I can do it with the Windows Firewall...

Is there any way to do it ? (On Windows Server 2008 R2)

Thanks in advance.

share|improve this question

1 Answer 1

I would just use a proxy like rinetd. Basically, just have an application listen on port 64,000 and when it receives an incoming connection, make a local connection to port 65,000 and proxy all the data. This won't work if your application needs to see the remote IP address and port for some reason.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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