What does a gateway mean? Manually entering an IP always fails to access the internet; 90% of the time it's because the gateway field is incorrect

last month, I installed my discontinued ThinkPad at home and used it as a NAS. When I was installing the system and going to the network configuration stage, four boxes popped up on the screen: IP address, subnet mask, gateway, and DNS. I thought about fixing the IP, just assigning it a house number. The IP was set to 192.168.31.66, the mask was copied to 255.255.255.0, the DNS was 223.5.5.5, and the gateway field—I figured the NAS wouldn't go out, so I left it blank.
crashed that very night. Accessing NAS shared folders on the computer works fine, Jellyfin plays videos as usual, but QBittorrent's tracker is fully red, Docker keeps spinning the mirror, and Feiniu's remote feature on the mobile app is completely gray. With the same machine and the same network cable, you can do all the work inside the house, but you can't do any work outside.
it took me half an hour to realize the problem was in the blank section. This article completely breaks down the word "gateway." Manual IP entry is rare, but when it is your turn, 90% of the time it's stuck on it.
be clear first: the gateway is the only main gate of your building
all the devices in the home connected to the router, they actually live in the same building. The router's network segment is 192.168.31.0, mask is 255.255.255.0, meaning the first three segments (192.168.31) address count as the same building—the computer is 192.168.31.88, the NAS is 192.168.31.66, and the router itself is 192.168.31.1. Everyone is a building friend.
Visiting people in
building doesn't require going through the main door. The computer searched for the NAS to copy files, and the person in the building shouted 'Are you there?' and the other party responded, then connected online. I mentioned this in DHCP when I was talking about the issue. But the website you want to visit and the tracker server you want to connect to have addresses like this: 104.18.x.x, 223.5.5.5. The first three segments don't match your home at all, which is called a different network segment, essentially a package from another location.
How to deliver parcels from other regions? Handed over to the main gate. The gateway is this door—by default, when the device sees the destination isn't yours, it passes everything to the gateway, which (usually the router) turns out. The "default gateway" in "default" refers to this rule: if there is no more specific guidance information, always use this door.
so the gateway value is almost always the internal network address of the upper-level device. For the home dialed by the router, the gateway is the router's LAN port IP; For households dialed by the optical modem, the gateway is the optical modem's IP. You can check my previous article about who is dialing up and who should enter the gateway. You can check out my previous article about optical modem and router sharing the same IP. The methods for determining this are all there.
IP, mask, gateway, DNS—each box manages a specific matter
manual IP matching interface, no matter what it looks like, flipping it over and over always has these four panels. Many people fill in the wrong blanks not because they don't know how to fill them out, but because they simply don't know how to fill them out, so they go by one one and say:
| box | what it matters | typical symptoms of filling in incorrectly |
| IP address | your own house number | clashing with others, Intermittent |
| subnet masks | delineate which are considered from the same building | if the mask is incorrectly filled in, those from the same building are treated as out-of-town packages and sent out |
| gateway | the main entrance | the internal network is fully connected, but the external network is completely disconnected |
| DNS | the phone | can ping IPs, but the website cannot be accessed |
pay attention to the differences between the last two lines—this is the easiest pair to mix up. DNS issues look like: WeChat can send and receive (direct IP connection), but browser links can't open (domain names are not translated). I have written a detailed article on DNS configuration troubleshooting . The problem with the gateway was: even pure IPs like 223.5.5.5 couldn't ping, because the package couldn't leave the door at all.
That night, I was saved by this difference. I clearly entered DNS 223.5.5.5, why can't the webpage open? Because the DNS server itself is also 'out of town,' the query request must be sent out first. The door was gone, and the number check phone couldn't be dialed; no one could tell what was wrong.
internal network and outer network disconnection, how was this accounted for
back to the crash scene. After leaving the gateway blank, why are SMB and Jellyfin all working normally? Because computers and NAS are in the same building, the 'inside building shouts' path is basically unnecessary, and you don't even need the main door. After calculating the mask, the first three segments of 192.168.31.88 and 192.168.31.66 are the same, so directly ARP calls to establish the connection, which goes very smoothly.
qBittorrent needs to connect to the tracker, Docker needs to connect to the image repository, and all the destinations are addresses from other regions. The system saw the destination wasn't in the main building and went to find the main gate—the gateway was empty, meaning the courier was standing inside the building holding a package, not knowing which door to open. Packages can only be stacked continuously, showing the tracker in red, mirror spinning, and remote functions all gray. It's not that the internet is slow, it's that they haven't gone out at all.
screening only takes three steps, and I eventually made it a habit. Step one: ping devices in the same building, for example, ping 192.168.31.1. If it works, it means both the network cable and IP are fine; Step two: ping the external IP address, for example, ping 223.5.5.5. If it doesn't work, it's basically the gateway's problem; The third step is to check DNS. By the way, the normal latency for ping gateways should be around 1ms. If it's at least a few tens of milliseconds, the router's CPU is overwhelmed. Another issue is the router CPU calculated.
add 192.168.31.1 to the gateway, save, and after ten seconds, the QB tracker turns green one by one, and the Docker mirror starts pulling rapidly. It's just a simple matter for a frame.
your own gateway is available, you can check all three places
people who have never filled it out most often ask: How much should I fill in? Don't memorize parameters, just copy ready-made ones.
the easiest hassle on a computer. On Windows, press Win+R, press cmd and press Enter, enter ipconfig /all, then go to the 'Default Gateway' line. Whatever is written will go. My home uses 192.168.31.1, and my friend's optical modem dials 192.168.2.1. The Telecom Tianyi gateway basically looks like this. By the way, you can also see that DHCP servers and DNS often share the same address—routers play multiple roles in this system: issuing numbers, acting as gateways, checking numbers, all handled by them.
search faster on your phone. For Android WiFi details, there's a 'Gateway'; On Apple, go to Settings - WiFi - tap the exclamation mark, and the section is called "Router," meaning the same thing. Whoever's phone at home is connected to the internet, copying someone's is definitely right.
The third path is the LAN port setup in the router's backend, with the gateway being the LAN port IP itself. Previously, I wrote about the difference between WAN ports and LAN ports and mentioned in that article. LAN port IP is the address benchmark for the entire internal network; changing it is equivalent to moving the entire building. I'll discuss this further below.
when do you need to manually fill in the gateway
really not useful for daily life. When DHCP automatically issues numbers, the gateway sends them down together, and the device is automatically set up. If you want to see what it sends, you can refer to the article on DHCP principles . There are only a few situations that require manual intervention, and I've basically tried them all:
First, equipment cannot be obtained and self-rescue. If the IP starts with 169.254, it means DHCP is not working at all. At this point, manually set a same-network IP segment, mask three 255 masks, and enter the router address at the gateway to enter the backend to check the issue. This solution was detailed in the about 192.168.1.1 not being opened.
second, bridge the backend of the optical modem for the rear intake. If you switch to the optical modem for bridge, it no longer sends numbers. When you plug in the computer, you get the address from the router, which is different from the optical modem. To access the optical modem backend, you have to manually set your computer into the optical modem's network segment: IP 192.168.2.100, mask 255.255.255.0, gateway 192.168.2.1. I've memorized this trick step by step in the of the optical modem after bridging and can't access it.
third, fixing IP for devices like NAS and printers. There are actually two paths here: the easier way is to perform DHCP static binding in the router's backend, and the device will automatically retrieve it as usual. the article on static IP binding describes this path; The only way to toil is to manually fill in four boxes in the equipment system like I do. The advantage of manual filling is that you don't rely on a router—switching routers keeps the NAS address unchanged; The price was today's pitfall—missing even one of the four frames was unacceptable. The same applies to printers and monitoring heads. You can check which address the device recognizes in the router device list MAC address to identify the device.
another advanced method is bypass routing: point the gateway of a specific device to another machine, allowing traffic to be redirected to ads. That is a straightforward way to change the main door orientation, which is easy for beginners. Check the side route guide you'll understand, so beginners don't need to touch it yet.
Fill in three gateway rules plus two common questions
rules are just three sentences. First, always fill in the internal IP of the upper-level device. For dialing, fill in the optical modem; for router dialing, fill in the router. If you're unsure, copy the device currently online. Second, the gateway must be the same as your own—if the IP is 192.168.31.66, then the gateway must be 192.168.31.x. You need to enter 192.168.1.1, and the system will immediately declare the door unreachable, so it may not even ask you to save. Third, if you're unsure about the DNS, enter 223.5.5.5 or the same as the gateway, don't leave it blank.
answered two questions casually. One is the 0.0.0.0 you often see in the routing table—it means 'all else', the true identity of the default router. The address pointed to by the first line of 0.0.0.0 on route print computer is your default gateway. At a glance, you can tell they're the same thing.
Another issue is why devices 192.168.0.x and 192.168.1.x cannot directly access each other. Mask 255.255.255.0 are on different floors, with a router in between; direct connection between two switches is not allowed. My cousin's family made this mistake before: the main Mercury router had zero network segment, and the Tenda subsidiary below didn't change the segment. Each device had its own number and couldn't find each other. In the end, they moved the secondary router into the same network segment following the approach from the article about changing the LAN port IP, and only then did it settle down.
comes down to one thing: when manually entering an IP, the gateway field is filled in with the "address number of the upper-level device," which manages outbound traffic. If the internal network is open or the outer network is disconnected, check it first; You can ping the IP but can't open the webpage, then check the DNS. With all four frames in place, the fixed IP devices like NAS, printers, and surveillance cameras can truly be settled.
| symptoms | first identify who | typical amendments |
| internal network disconnection and outer network disconnection | gateway | fill in the IP address of the upper-level device's internal network IP |
| ping If you can't open the webpage | DNS | change to 223.5.5.5 or 119.29.29.29 |
| IP intermittent | swap or static | |
| binding take 169. 254 address | DHCP | manually set IP for the same subnet to be pushed into the backend |
