Ask HTG: How Can I Connect to A Local Internet-Facing Server without Sending Traffic Out to the Internet and Back?
If you’ve configured a server on your home network (like a media streaming server) so you can access your files away from home, you may have noticed a curious conundrum: when you want to use the server at home your traffic gets routed out to your ISPs servers and then back to your house because your network hardware doesn’t recognize that the server isn’t really out there on the Internet, it’s right at home. Let’s take a look at how a fellow reader can fix this slow and bandwidth-wasting operation and keep things tight and speedy.
Dear How-To Geek,
I have a pretty specific problem that I’m hoping there is a pretty specific answer to. I set up a streaming media server on my home network so I could access my media while away from home. I have an application on my phone that allows me to specify the address of the server. So far so good, right? When I’m away, I just start the app up and connect to the server (which is the IP address of my home internet connection).
Now here’s what my problem (and hopeful) solution comes in. When I’m at home and I use the same application, the traffic goes out to the Internet (or at least out to my ISPs servers I suppose) then comes back to my house to connect to the external IP address. I don’t mind a little lag when I’m away from home because the content has to navigate the internet to get to me, but it seems pretty silly to have my phone-to-server requests go out to the internet and back when the source of the traffic is ten feet away from me and connected to my local network.
Obviously I could use another program to connect to the stuff when I’m at my house, but I’d really like to streamline my apps and user experience. There’s no way to specify two servers in the application. Is there anyway to have the network intelligently direct the traffic to the local IP instead of the big old trip it goes on now?
Local Network Puzzled
The good news is that there is most definitely a simple solution to your problem. The bad news is that not all routers have this simple solution available. The technical term for the feature you’re searching for is a “NAT loopback”. NAT stands for Network Address Translation; this mechanism in your router is responsible for mapping traffic to distinct IP address so that, for example, every person in your household on their individual tablets, computers, and phones, can all be watching YouTube simultaneously without the video streams getting mixed up and delivered to the wrong device.
Under normal conditions (e.g. when “NAT loopback” is not available) we have a scenario exactly like the one you described in your email. There is a resource on the local network, say a music server, and that music server is accessed via a forward facing IP address, say 255.255.1.1. That server also has a local address within the network, say 192.168.1.100. Without the loopback function anytime a person on the local network accesses that server by the forward facing address 255.255.1.1 the traffic goes through the gateway on the router, out to the Internet (typically only to the ISP’s nearest node, however) and is then routed back to the home network, through the router again, to the server, and whatever content the user wants (music, movies, etc.) is sent via the reverse route. This is a very inefficient way of doing things and it introduces a huge amount of traffic movement outside that local network that’s entirely unnecessary.
To think of the above networking scenario in real terms, it’s equivalent to a department in a highrise office building on tenth floor opting to send a letter to a department on the sixth floor via the postal service (where it will leave the building and require multiple parties to sort and move).
When a router has loopback functionality it will intelligently intercept that transmission and reroute it; essentially saying “Oh hey I’m 255.255.1.1, no need to send this information outside the network, the service the user is requesting is right here at home.” The traffic never leaves the home network and instead efficiently sling-shotted through the router’s NAT system right back to the local machine where the transmission occurs almost instantaneously and at the speed the local network supports.
Using our office analogy again, the loopback function is like using interoffice mail (where it will not leave the office building and will require only a single party to sort and move).
So where does that leave you, the user in search of loopback functionality? The first stop will be to search for your router’s model number and the term “NAT loopback” to determine if your router supports it (you could also pour over the configuration menus of the router, but searching it typically faster). We’d also recommend searching for your router model number and third-party firmware solutions like Tomato and DD-WRT firmware to determine if any third-party solutions introduce loopback even when the native firmware didn’t support it.
Finally you may find it useful to reference this list maintained by the OpenSimulator Project (loopback functionality is critical for their needs). It’s the closest thing to a large sort-of-up-to-date list of routers with loopback functionality you’re going to find.
If you’re in the market for a new router the safest bet is to shop carefully and review the documentation for any model you’re considering.