Port forwarding doesn't work at home and works when out, NAT return is the fault—no need to change the rules

First, let's lay out the strange phenomenon: no matter how you stay at home, nothing works; when you step outside, you actually come alive
.You've probably seen this scene. Once DDNS is set up, port forwarding is added. The rules are clear: external port 18080 points to internal network 192.168.31.10 at 5244, which is the network drive port of my Feiniu NAS. When you're at the office, your phone cuts traffic, you can tap the domain name and add the port, and you're in instantly—the speed is top-notch. At night, I would lie on the sofa at home, connect to my home WiFi, and type the same domain again—spin around, and finally type 'This website cannot be accessed.'
The first reaction was definitely that the configuration was broken. Go back to the backend and check < a href="https://www.shunot.com/en/lybk/797.html"> port forwarding rules, you didn't get it wrong; Restarting the router still doesn't connect; I'm even starting to wonder if it only works if I go to the DMZ. Helped Da Liu the same time as the optical modem DMZ. He was testing the NAS remote desktop at home but couldn't get through no matter what, almost scrapping everything he installed that day and starting over. Finally, he switched to his phone data to test — green and connected fine, but that night it hit over 5 megabytes per second.
Remember this signature: Outside, no rules, no rules. If you hit it, there's a 90% chance it's NAT backflow.
How the bag walked: After leaving the house, the way back was blocked by a shortcut
.Just lay out the bag step by step and you'll understand. My actual specs are as follows: my phone connects to WiFi and gets 192.168.31.50, the router's LAN port is 192.168.31.1, the WAN port has a public IP (which recently drifted from 117.136 to 111.72), and the NAS is stuck at 192.168.31.10.
The first step in using your phone at home is to resolve the domain name to the public IP 111.72. This step is fine—DNS gives you the real address, and DDNS is responsible for tracking it up. Then the phone sent a TCP handshake packet to "111.72:18080". Note: Although the NAS sits on the bookshelf three meters away, the packet's destination address lists a public IP address, not the local subnet. The phone can only hand it over to the gateway router to send it out the door.
When the router receives it, it sees: Isn't this my WAN port address? Checking the forwarding page, 18080 maps to 31.10:5244, so the destination address is rewritten to 192.168.31.10—this step is called DNAT, which is the main task of port forwarding, and it's done well. The packet was sent into the inner net, and the NAS received it steadily.
The pit comes from the return journey. When returning the NAS packet, I glanced at the source: 192.168.31.50, internal contact, direct delivery from the internal network. This packet doesn't even go through the router; it goes through the second layer of the swap chip and is directly tossed back to the phone. When I opened the phone bag, I was stunned: I was clearly waiting for a reply from 111.72:18080, but you gave me 192.168.31.10:5244, no trace found, lost it. Handshakes never end—the account for three handshakes was calculated in the TCP article—the connection was just hanging in circles.
In short: the outgoing packet has its address changed by the router, but the returning packet has no one to re-update the address. The outbound trip was switched, but the return trip was taken as a shortcut, and both ends couldn't be reconciled.
Whether the router performs backflow determines three outcomes
. Thesolution is not mysterious: while the router performs DNAT, it also performs a source address translation to change the phone's 31.50 to the router's own 31.1. This way, the NAS packet can only obediently return to the router, which restores both ends of the address before handing it over to the phone. This extra NAT operation is called NAT backflow.
The problem is, whether you do it depends entirely on the firmware's attitude, and most home backend apps don't even give you a switch labeled 'Reflow'. The results fall into three categories:
| Handling | the reasons | behindthe manifestation |
|---|---|---|
| At home, pressing a public IP directly to the | firmware silently performs backstreaming. You don't notice its existence | and don't bother with it, secretly enjoying |
| home, it never connects, and the firmware instantly passes | through without backstreaming. Packet Return Gets Intercepted by a Shortcut | , ThisPaper's Trick Bypass |
| Double Stack Interference: Sometimes domain names are resolved as IPv6 addresses, but the service only listens to IPv4 | . First,turn off the device, try IPv6 before drawing a conclusion |
Here's a ten-second detection method: you don't need to dig up any data to know if your device has done return: when you're at home, your phone is connected to WiFi, and the browser just taps the public IP plus port on the WAN port—be careful not to dig into the IP or domain name. First, remove the DNS resolution step to avoid searching the wrong direction. If it works, it means the firmware has quietly backed you back; If it doesn't work, switch to traffic and knock again, and traffic control is confirmed. My AX3000T test showed the level that didn't work, so I developed the habit of directly tapping 31.10 at home.
Specifically: ASUS factory firmware usually includes backflow by default, and Merlin firmware even provides an explicit NAT Loopback option in the Firewall tab; In OpenWrt's port forwarding rules, reflection is enabled by default, so users who want to flash their phones are less likely to fall into this trap. But the original manufacturer firmware is a mixed bag. I've searched all the backends for Tenda Mercury and the like, but there's no such term— Tenda's port mapping article says "Home WiFi testing public IP not working is just an illusion," and that's exactly what it is.
If you want to stay home, it works too. Here are three ways to rank by convenience
.The most convenient is that when you're at home, don't use public internet. When your phone is connected to your home WiFi, just enter the internal network address 192.168.31.10:5244 and you're done—you don't even need to leave the door. Finding the two sets of addresses hard to remember, I changed a line for my frequently used computerhosts, and set the DDNS domain directly to 31.10. I typed the domain as usual, but it was a shortcut to the internal network. It's inconvenient to change hosts on phones, so this trick mainly serves the computer and NAS itself.
The second is the upgraded version, called internal DNS partitioning: the DNS sent by the router resolves your DDNS domain into an internal IP within the internal network. Once set, all devices in the family take effect, making it cleaner than switching hosts in one place. Support for home firmware varies greatly; using dnsmasq on OpenWrt is the smoothest.
The third option is the direct hard solution: letting the router turn on its own backflow. Merlin clicked in the Firewall's NAT Loopback; OpenWrt confirms that reflection is not disabled in the forwarding rules; If the factory firmware backend doesn't even have this option, don't go for it—it won't do it for you, so you can just go around it. The first two methods are already faster.
As a reminder, this trap is the worst for monitoring apps and home assistants that require automatic switching between internal and external networks: sometimes they use public network addresses to force connections within the internal network, but when they can't connect, they refuse to downgrade and just stay stuck there. If you encounter apps that spin around at home and go out normally, prioritize checking for returns.
Don't Mix Several Diseases into One Pot
Underlyingthe symptom of "not detecting at home" are several other diseases, and reflux is just one of them. Before you start, first triage:
| Symptom details | : Where should theroot | cause go |
|---|---|---|
| Outside is clear, but home doesn't work | ,NAT return didn't | do this article |
| Neither inside nor outside | , no public IP, WAN port starting with 100.64, white setup | public IP self-check |
| Other ports are connected, but 80 and 443 don't work | .Carrier Feng Jiakuan Web port, switch to a high-level | port as above |
| double-layer NAT overlay or IP drift, so first disassemble the layer | double NAT | |
| The port is open but the service error occurs | due to firewall or account issues | NAS connection troubleshooting |
switch to traffic verification at the end. If he had been buried at home all afternoon modifying the rules, it would have been useless. So the test discipline is simple: verify port forwarding, and when people go out—turn off WiFi and use data on your phone, which is the only reliable testing method. ASUS's official FAQ also says this when forwarding ports, asking people to test it with an external device. Just because the house is open doesn't mean the outside is open; If the outside is open but the home is not, the first thing is to return home.
Wrap up:
Straighten the order.While you're outside, first test your traffic to decide your fate; If not, check the public IP address; starting with 100.64, you'll be sentenced to death; Once it works, test it at home. If it doesn't work, it's a return loop. Use internal network IPs or hosts to bypass it. Don't expect the factory firmware to flip the return switch in the background; OpenWrt and Merlin users can conveniently confirm the options. I really want a set of internal and external addresses to be done once and for all, and then apply DNS partitioning on the internal network.
The reader who asked me, 'Why can't I leave the house?' now has the answer: it's not that you can't leave the house, but that the way out and back was taken by someone who took a shortcut, so neither end matches up. Router work may seem simple, but the address ledger is remembered better than anyone.
