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.

Assuming port forwarding is done on router, can the router forward if the data is coming from local machine, rather than remote.

For example: Sender targets ip like:88.251.xxx.xxx, port 8999. Receiver listens to that port. Router, forwards 8999 to receiver.

They are all on local network.

Should it run well?

share|improve this question

migrated from stackoverflow.com Apr 5 '10 at 10:51

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

Assuming a simple soho setup, then you dont need to touch anything on the router, the two boxes should talk to each other directly.

share|improve this answer
1  
+1, however if the OP has some software that communicates with the public IP on his router (hardcoded for some reason), then we need to know what type of router he has. –  Bryan Apr 5 '10 at 12:14
    
@Iraklis Hairpinning is most commonly needed when your web server is behind your NAT gateway, and your domain name www.exmple.com points at the public IP address of your NAT gateway (with port 80 forwarding). If you tell an internal machine's web browser to go to the web server at http://10.0.0.200 and accidentally leave the trailing / off the URL, your web server will redirect you to http://www.example.com/. Now your browser will look up www.example.com and find your NAT gateway's public IP, and try to connect to that. Without hairpinning, that will fail. –  Spiff Apr 6 '10 at 1:21
add comment

Yes, it's common and it should run well. The term most commonly used for this is "hairpin NAT". It's when the NAT gateway in a sense performs outbound-NAT on the packet, and then turns it right back around and performs inbound-NAT on the same packet.

Early NAT implementations didn't always perform hairpinning, but it's a pretty common feature on modern NAT implementations. NAT gateway validation test suites like QACafe's CDRouter have built-in test cases for hairpinning.

share|improve this answer
add comment

You should note there will be a performance hit from hairpinning traffic. The size of the hit depends on the specific NAT device, traffic load, router CPU, etc.

If the nodes are located internally, you're better off having them talk directly to each other. When possible, I recommend using DNS or host-file magic to direct internal clients to the internal IP address and external clients to the public IP.

share|improve this answer
add comment

Your Answer

 
discard

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