What Is a Router?
Learn what a router does, how it forwards IP packets between LANs and WANs, and how routers use NAT, DHCP, firewalls, and Wi-Fi.
A router is a network device, or software function, that connects separate IP networks and forwards data packets between them. In a typical home, the router connects the local area network (LAN) to the internet service provider's wide area network (WAN).
Routers decide where packets should go by inspecting destination IP addresses and consulting routing information. A consumer router often combines several other functions, including a network address translator, DHCP server, firewall, Ethernet switch, and wireless access point.
What a Router Does
Network data is divided into units called packets. A packet includes addressing information, such as a source IP address and a destination IP address. When a router receives a packet, it generally performs four steps:
- Receive: The packet arrives through a LAN, WAN, or another router interface.
- Inspect: The router reads the destination IP address.
- Select a route: It compares the destination with entries in its routing table.
- Forward: It sends the packet through the selected interface toward the destination.
A routing table is a list of known network destinations and the interfaces or paths used to reach them. If several routes match, the router normally prefers the most specific matching route. If no specific route is available, it can use a default route, which means “send this traffic toward the general upstream connection.”
The next device along a path is the next hop. A gateway is a device that provides a path from one network to another. In everyday home-network language, “the gateway” usually means the router that provides a path out of the LAN.
Hop count is the number of routers a packet crosses. It is a basic way to describe distance through a routed network, although real routing decisions can also consider bandwidth, delay, reliability, and administrative rules.
LAN, WAN, and the Default Gateway
A home router normally has at least two network sides:
- LAN side: The local network containing computers, phones, printers, consoles, and smart devices.
- WAN side: The upstream network leading to the ISP or another outside network.
The router typically has one IP address on the LAN and another on the WAN. For example, its LAN address might be 192.168.1.1, while its WAN address is supplied by the ISP or upstream device.
Client devices use the router's LAN address as their default gateway. When a laptop needs to reach an address outside its own subnet, it sends the packet to that gateway. A subnet is a defined range of IP addresses that belongs to the same local network segment.
Traffic between two devices in the same subnet usually stays on the local network. Ethernet switching or Wi-Fi forwarding can deliver that traffic without using the router's inter-network forwarding function. Traffic destined for another subnet, such as an internet server, is sent to the default gateway.
Example: Opening a Website
- A laptop looks up the website name through DNS, a service that translates domain names into IP addresses.
- The laptop compares the destination IP address with its own subnet.
- Because the website is outside the local subnet, the laptop sends the packet to its default gateway.
- The router examines the destination and selects its WAN interface and default route.
- NAT commonly changes the packet's private source address to the home's public IPv4 address.
- The packet travels through the ISP and the internet to the destination.
- When the reply returns, the router uses its NAT state to associate the response with the laptop and forwards it to the correct LAN address.
By contrast, if two computers are sharing a file while both are on the same home subnet, their traffic normally travels through the local switch or Wi-Fi network rather than being routed out to the internet.
Router Interfaces and Common Services
| Item | Purpose | Typical example | Common configuration concern |
|---|---|---|---|
| LAN port or interface | Connects local wired devices and the local IP network | Ethernet ports for a desktop or printer | LAN subnet and DHCP range |
| WAN or Internet interface | Connects to the ISP or upstream network | Ethernet cable from a modem or ONT | DHCP, PPPoE, or static IP settings |
| Routing table | Maps destinations to forwarding paths | Local route plus a default route | Overlapping or missing routes |
| DHCP | Automatically provides local IP settings | Address, subnet mask, DNS, and gateway | Address-pool exhaustion or conflicting servers |
| NAT | Translates private and public IPv4 addresses | Several home devices sharing one public address | Port forwarding and double NAT |
| Firewall | Permits or blocks traffic using rules and connection state | Blocking unsolicited inbound WAN traffic | Unsafe exceptions or remote administration |
| SSID | The visible name of a Wi-Fi network | Home-Network | Weak security or confusing duplicate names |
DHCP automatically gives a client an IP address, subnet information, DNS server, and default gateway. Without valid DHCP settings, a device may connect to Wi-Fi but fail to communicate normally.
NAT, or Network Address Translation, commonly lets multiple devices using private IPv4 addresses share one public IPv4 address. NAT is useful for address conservation and usually prevents unsolicited inbound connections by default, but it is not a complete security strategy.
A router's firewall applies rules to traffic entering or leaving an interface. Consumer firewalls commonly allow established return traffic while blocking unexpected inbound traffic from the WAN.
What Is Inside a Home Router?
Many consumer products are integrated gateways rather than routers alone. One box may contain:
- A router that forwards traffic between the LAN and WAN.
- An Ethernet switch that connects local wired devices.
- A wireless access point that lets Wi-Fi clients join the LAN.
- A DHCP server that assigns local network settings.
- NAT and a stateful firewall.
When a phone joins home Wi-Fi, the access point supplies the wireless connection. DHCP can then provide the phone's IP address, subnet, DNS server, and default gateway. The routing function enables access to other networks.
Router, Modem, Switch, Access Point, and Hub Compared
| Device | Primary role | Connects | Typical home-network use | May be combined with other functions? |
|---|---|---|---|---|
| Router | Forwards IP packets between different networks | LANs, WANs, and other routed networks | Connects the home LAN to the ISP | Yes; commonly combined with a switch, AP, NAT, DHCP, and firewall |
| Modem | Connects to or translates the ISP's access medium | The ISP service and an Ethernet network | Terminates a cable, DSL, or similar service | Yes; often combined with a router in one gateway |
| Switch | Forwards Ethernet frames within a LAN | Local wired devices | Adds Ethernet ports for computers and printers | Yes; built into most home routers |
| Wireless access point | Provides Wi-Fi connectivity to a network | Wi-Fi clients and a wired LAN | Lets phones and laptops join the LAN wirelessly | Yes; built into wireless routers and mesh systems |
| Hub | Repeats incoming electrical signals to all ports | Basic shared Ethernet segments | Legacy equipment; rarely appropriate today | Usually separate from modern router products |
A modem is an ISP-access device that connects to the provider's service medium. It may terminate or translate the ISP connection, while the router manages the local network and connects it to other IP networks. A single physical gateway can perform both functions.
A switch primarily connects devices within one LAN. An access point provides Wi-Fi access; it does not necessarily perform inter-network routing. A hub has no intelligent forwarding decision: it repeats traffic to every port. Modern switches are more efficient because they learn local hardware addresses and send frames toward the appropriate port.
Types of Routers
- Consumer or home routers: Designed for homes, with integrated Wi-Fi, switching, NAT, DHCP, and firewall features.
- Small-business routers: Often provide stronger policy controls, VPN support, multiple WAN options, VLANs, and more detailed monitoring.
- Enterprise routers: Handle larger networks, many interfaces, dynamic routing protocols, redundancy, and policy-based traffic control.
- Carrier routers: Operate in ISP and telecommunications networks and are designed for very high capacity and reliability.
- Wired routers: Use Ethernet or other wired interfaces without necessarily including Wi-Fi.
- Wireless routers: Combine routing with a wireless access point.
- Mesh Wi-Fi systems: Use multiple coordinated access points, with routing and other functions provided by one or more system components.
- Virtual or software routers: Run routing functions in an operating system, virtual machine, cloud instance, or dedicated appliance.
The product form does not change the core role: routing means forwarding IP packets between separate networks.
Basic Router Setup
- Connect the router's WAN or Internet port to the modem, optical network terminal (ONT), or upstream network device.
- Connect computers and other wired clients to LAN ports, or join clients to the router's Wi-Fi network.
- Open the router's management interface using the address supplied by the manufacturer or the client's default gateway address.
- Choose the WAN connection type required by the ISP: automatic addressing through DHCP, PPPoE with credentials, or a static IP configuration.
- Set a unique administrator password and configure a unique Wi-Fi SSID.
- Enable WPA2 or WPA3 security and use a strong Wi-Fi passphrase.
- Confirm that the LAN subnet does not overlap the upstream network. For example, two connected routers should not both use the same LAN range.
- Enable DHCP for the intended LAN range unless another DHCP server is deliberately being used.
- Install current firmware from the router vendor.
- Verify that clients receive an IP address, default gateway, and DNS server, then test local and internet connectivity.
A newly added router may need router mode, access-point mode, or bridge mode. The appropriate choice depends on whether it should perform routing or only extend an existing LAN. Using multiple routers in router mode can create double NAT, which may complicate inbound connections and some applications.
Security and Maintenance
- Change the default administrator username or password where the product permits it.
- Use WPA2 or WPA3 and a long, unique Wi-Fi passphrase.
- Keep router firmware updated and remove unsupported legacy firmware when possible.
- Disable remote administration unless there is a specific need and it can be secured.
- Disable unnecessary legacy features and services.
- Use a guest network or segmentation for visitors and untrusted smart devices.
- Review connected clients and firewall rules periodically.
- Configure port forwarding deliberately. It is a NAT and firewall rule that sends incoming traffic on a public port to an internal device, exposing that service to the outside.
Outbound connections from a game console or camera normally work without special changes. A service that must accept unsolicited internet connections may need port forwarding or a safer alternative remote-access design. The host firewall, changing private address, double NAT, carrier-grade NAT, and ISP filtering can all affect the result.
Troubleshooting a Router Connection
Separate a local-network problem from a WAN or ISP problem. A visible Wi-Fi SSID proves only that the wireless function is operating; it does not prove that the router has a working WAN connection.
| Symptom | Likely network layer or cause | Checks to perform | Typical resolution |
|---|---|---|---|
| No Wi-Fi or Ethernet link | Power, cable, interface, or local link problem | Check power, cables, port lights, Wi-Fi status, and whether another device can connect | Reconnect or replace the cable, enable the interface, or restart the local equipment |
| Connected device has no valid IP address | DHCP failure or address conflict | Inspect client IP details and DHCP status; renew the lease | Restore the DHCP service, correct the address pool, and remove a second unintended DHCP server |
| Client cannot ping the gateway | Local LAN, Wi-Fi isolation, subnet, or gateway issue | Check client address, subnet, gateway, VLAN or guest-network settings | Join the correct network and correct LAN or isolation settings |
| Gateway works but public IP test fails | WAN, modem/ONT, ISP, or WAN configuration issue | Check WAN address, router status, upstream cable, and modem/ONT indicators | Correct DHCP, PPPoE, or static settings; restore the upstream connection |
| Public IP works but domain names fail | DNS problem | Test a public IP, inspect DNS settings, and try another DNS server if appropriate | Correct DHCP or DNS configuration and resolve any provider DNS outage |
| Administration page will not open | Wrong management address, guest isolation, power, or changed access settings | Find the client's default gateway, confirm the local network, try Ethernet, and try HTTPS if supported | Use the correct address and network; restore management access only through a trusted local connection |
| Local service cannot be reached from outside | Port forwarding, firewall, changing internal IP, double NAT, or carrier-grade NAT | Test the service internally, check its stable address, rules, public WAN address, and an external test network | Correct the rule or use an appropriate remote-access method |
Useful Client-Side Checks
Windows: ipconfig /all
Windows: tracert example.com
macOS/Linux: ip addr
macOS/Linux: ip route
macOS/Linux: traceroute example.com
macOS/Linux: tracepath example.com
Use ping in stages: first ping the local default gateway, then a public IP address, and finally a domain name. A failure at the gateway suggests a local problem. Gateway success but public-IP failure suggests a WAN or routing problem. Public-IP success but domain-name failure points toward DNS.
Safe Reboot Sequence
When a separate modem or ONT and router are involved, power down or unplug both devices if the service instructions permit it. Start the modem or ONT first and wait until its connection indicators stabilize. Then start the router and wait for its WAN and LAN services to initialize. Avoid repeatedly rebooting equipment; allow each device time to obtain its upstream connection.
A factory reset should be a last resort. It removes WAN credentials, Wi-Fi settings, port forwards, reservations, and other configuration. Record required settings first and make sure you know how to access the management interface afterward.
Exam-Relevant Summary
- A router connects separate IP networks and forwards packets using destination addresses and routing information.
- A home router commonly connects a LAN to an ISP-facing WAN.
- A routing table maps destinations to interfaces or next hops; a default route handles destinations without a more specific match.
- Same-subnet traffic usually remains on the LAN and does not need inter-network routing.
- The default gateway is the router address used for traffic leaving the local subnet.
- NAT allows private IPv4 devices to share a public IPv4 address, while DHCP supplies local IP configuration.
- A modem connects to the ISP service, a switch connects LAN devices, and an access point provides Wi-Fi. One home gateway may combine all these functions.
- Port forwarding intentionally permits selected inbound traffic to reach an internal service and should be secured carefully.
For deeper study, continue with IP Routing Explained, How to Create Subnets, and Access and Trunk Ports Explained.