How Your Home Network Is Organized: LAN, WAN and Gateway
Understand what sits inside your network, what sits outside it, and how your router carries traffic between them.
Key takeaways
- The LAN is everything behind your router, and the WAN is the connection from your router toward your provider.
- Devices on the LAN talk to each other directly and send everything else to the default gateway.
- Your router assigns private addresses inside and usually shares one outside address using NAT.
- A home gateway box often combines modem, router, switch and wireless access point in one case.
Your home network has an inside and an outside. The inside is the local area network, or LAN: your phones, computers, TVs and gadgets, whether they connect by cable or Wi-Fi. The outside is the wide area network, or WAN, which in this setting means your provider's network and the internet beyond it. The gateway is the device that sits between them, and in most homes that is your router.
Once you can picture those three pieces, a lot of confusing settings start to make sense. You can tell where a problem is, why your devices have different addresses from the one websites see, and what a port forward actually changes.
The boxes and their jobs
The equipment in your hallway may be one box or several, but the jobs are the same.
A modem or optical network terminal (ONT) converts the signal on your provider's cable, phone line or fiber into Ethernet. See modem versus router.
A router connects two networks and decides where packets go. It also usually runs address assignment and a firewall.
A switch connects wired devices within the same network. The row of numbered LAN ports on a router is a small built-in switch.
A wireless access point turns wired network access into Wi-Fi. Your router's antennas are a built-in access point.
Providers often supply a single unit, called a gateway, that does all four. If you add your own router behind it, you end up with two routers unless you change a setting, a situation covered in bridge mode and double NAT.
What makes something local
Devices belong to the same LAN when they can reach each other directly, without passing through a router. On a home network that usually means they share one subnet, a block of addresses such as 192.168.1.0/24. The /24 says that the first 24 bits identify the network, so addresses from 192.168.1.1 to 192.168.1.254 are available for devices, and 192.168.1.255 is the broadcast address.
Your device uses its subnet mask to decide whether a destination is local. If it is, the device finds the target's hardware address using ARP and sends the data straight there. If it is not, the device hands the data to the gateway. You can experiment with these boundaries in the CIDR calculator.
Wired and wireless devices on a typical router are in the same LAN. A laptop on Wi-Fi can print to a printer plugged into a LAN port because the router bridges the two.
The default gateway
The default gateway is the address a device uses for anything outside its own subnet. It is normally the router's LAN address, often something like 192.168.1.1 or 192.168.0.1, though any private address is possible. Default gateway explained goes further.
You can find yours easily. On Windows:
ipconfig On Linux:
ip route On macOS:
route -n get default Look for the line labeled default gateway, default via or gateway. Typing that address into a browser normally opens the router's admin page. If a device has no gateway, or the wrong one, it can reach local devices but nothing on the internet.
How addresses are handed out
Most devices get their settings automatically through DHCP. When a device joins, the router tells it four main things: its IP address, the subnet mask, the default gateway and which DNS servers to use. DNS is the system that turns names like example.com into addresses.
The addresses inside come from private ranges set aside by RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routed on the public internet, so millions of homes can reuse them. See public versus private addresses.
IPv6 works a little differently. If your provider supports it, each device typically receives one or more addresses that are globally unique, plus a link-local address starting with fe80 that works only on the local segment. The router's firewall, not address translation, is what keeps outsiders from reaching those devices uninvited.
Crossing to the outside
On the WAN side, your router holds an address given by your provider. It may be a public address, or a private or shared one if your provider uses a larger layer of translation, described in carrier-grade NAT.
With IPv4, network address translation lets all your devices share that single outside address. When your laptop opens a web page, the router rewrites the source address and port, records the pairing in a table, and sends the packet on. Replies arrive at the router's address, and the table tells it which internal device should receive them.
A connection that starts from outside has no entry in the table, so by default the router does not know where to send it. A port forward is a rule you add so that traffic arriving on a chosen port goes to a chosen internal device. It also exposes that device to the internet, which is why port forwarding deserves care.
Where the firewall sits
Your router usually includes a firewall that blocks unsolicited inbound traffic while allowing replies to connections your devices started. It watches the boundary between WAN and LAN.
It does not police traffic between devices inside the LAN. A compromised gadget can usually talk to your laptop directly. That is why guest networks and separate segments exist: they create more than one inside, with rules between them. Computers also have their own firewalls, which add a layer within the LAN. Firewalls explained covers the types.
Names for things inside
Remembering addresses is tiresome, so local networks offer shortcuts. Many routers let you open a device by a hostname. Multicast DNS lets devices announce names ending in .local without any central server, which is how many printers and media devices appear automatically.
These discovery methods generally stay within one subnet. If you move your printer to a guest or separate network, your phone may stop finding it even though both are in the same house.
Troubleshooting by layer
The inside and outside picture gives you a quick test sequence:
- Does your device have an address in the router's range? If it starts with
169.254, it failed to get one. - Can you ping the default gateway? If not, the problem is in your LAN or Wi-Fi.
- Can you ping a public address? If not, look at the router's WAN side, the modem or the provider.
- Can you reach a site by name? If addresses work but names do not, look at DNS.
Your router's status page shows the WAN address, gateway and DNS servers it received. If that page shows no WAN address, restarting the modem and router or calling the provider is the next step.
Adding more equipment without adding networks
Most expansions should keep everything in one LAN. A switch adds wired ports and needs no configuration in its basic form. A second wireless access point, wired back to the router, extends coverage while the router keeps handing out addresses. A mesh system in access point or bridge mode does the same.
A second router is different. Plug its WAN port into your LAN and it creates a separate network behind the first, with its own address range and translation. Devices on the outer network cannot start connections to devices on the inner one without extra rules, and printing or casting between them often fails. That separation can be useful if you intend it and confusing if you do not.
Ask one question before adding any box: should its devices be able to find the rest of my devices? If yes, it should act as a switch or access point. If no, a guest network, a separate virtual network or a deliberately separate router is the tool. Network switches explained covers the simplest kind of expansion.
Services that live inside
Some things your household uses may never need to cross the gateway: a printer, a network storage box, a media server or a hub that controls lights locally. Their traffic stays on the LAN at LAN speeds, regardless of your internet plan, and some of them keep working when the provider is down.
Others only look local. Many gadgets send commands to a maker's server and back, even when your phone is in the same room. If an internet outage leaves your lights unresponsive, that is why.
Drawing your own map
Spend a few minutes writing down your setup. List the modem or ONT, the router and its LAN address, the DHCP pool range, any extra switches or access points, and devices with reservations. Note where each box physically lives and which cable goes where.
A simple sketch makes later changes much safer. It also helps whoever has to fix the network when you are away. If you plan to add a switch, an access point or a separate network for gadgets, start from the sketch and mark where the new boundary will be.
Common questions
Is Wi-Fi a separate network from my wired devices?
Usually not. The main Wi-Fi network and the LAN ports share one subnet. A guest network is normally separated on purpose.
Is the WAN port different from a LAN port?
Yes. It connects toward the modem and is treated as untrusted. Plugging your modem into a LAN port by mistake typically leaves the network without proper internet access, and may let devices bypass the router.
Do I need to change my subnet?
Most people do not. Changing it helps when a VPN to work uses the same range, or when you are merging equipment that expects a particular address.