Unit

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:

  1. Receive: The packet arrives through a LAN, WAN, or another router interface.
  2. Inspect: The router reads the destination IP address.
  3. Select a route: It compares the destination with entries in its routing table.
  4. 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

  1. A laptop looks up the website name through DNS, a service that translates domain names into IP addresses.
  2. The laptop compares the destination IP address with its own subnet.
  3. Because the website is outside the local subnet, the laptop sends the packet to its default gateway.
  4. The router examines the destination and selects its WAN interface and default route.
  5. NAT commonly changes the packet's private source address to the home's public IPv4 address.
  6. The packet travels through the ISP and the internet to the destination.
  7. 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

ItemPurposeTypical exampleCommon configuration concern
LAN port or interfaceConnects local wired devices and the local IP networkEthernet ports for a desktop or printerLAN subnet and DHCP range
WAN or Internet interfaceConnects to the ISP or upstream networkEthernet cable from a modem or ONTDHCP, PPPoE, or static IP settings
Routing tableMaps destinations to forwarding pathsLocal route plus a default routeOverlapping or missing routes
DHCPAutomatically provides local IP settingsAddress, subnet mask, DNS, and gatewayAddress-pool exhaustion or conflicting servers
NATTranslates private and public IPv4 addressesSeveral home devices sharing one public addressPort forwarding and double NAT
FirewallPermits or blocks traffic using rules and connection stateBlocking unsolicited inbound WAN trafficUnsafe exceptions or remote administration
SSIDThe visible name of a Wi-Fi networkHome-NetworkWeak 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

DevicePrimary roleConnectsTypical home-network useMay be combined with other functions?
RouterForwards IP packets between different networksLANs, WANs, and other routed networksConnects the home LAN to the ISPYes; commonly combined with a switch, AP, NAT, DHCP, and firewall
ModemConnects to or translates the ISP's access mediumThe ISP service and an Ethernet networkTerminates a cable, DSL, or similar serviceYes; often combined with a router in one gateway
SwitchForwards Ethernet frames within a LANLocal wired devicesAdds Ethernet ports for computers and printersYes; built into most home routers
Wireless access pointProvides Wi-Fi connectivity to a networkWi-Fi clients and a wired LANLets phones and laptops join the LAN wirelesslyYes; built into wireless routers and mesh systems
HubRepeats incoming electrical signals to all portsBasic shared Ethernet segmentsLegacy equipment; rarely appropriate todayUsually 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

  1. Connect the router's WAN or Internet port to the modem, optical network terminal (ONT), or upstream network device.
  2. Connect computers and other wired clients to LAN ports, or join clients to the router's Wi-Fi network.
  3. Open the router's management interface using the address supplied by the manufacturer or the client's default gateway address.
  4. Choose the WAN connection type required by the ISP: automatic addressing through DHCP, PPPoE with credentials, or a static IP configuration.
  5. Set a unique administrator password and configure a unique Wi-Fi SSID.
  6. Enable WPA2 or WPA3 security and use a strong Wi-Fi passphrase.
  7. Confirm that the LAN subnet does not overlap the upstream network. For example, two connected routers should not both use the same LAN range.
  8. Enable DHCP for the intended LAN range unless another DHCP server is deliberately being used.
  9. Install current firmware from the router vendor.
  10. 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.

SymptomLikely network layer or causeChecks to performTypical resolution
No Wi-Fi or Ethernet linkPower, cable, interface, or local link problemCheck power, cables, port lights, Wi-Fi status, and whether another device can connectReconnect or replace the cable, enable the interface, or restart the local equipment
Connected device has no valid IP addressDHCP failure or address conflictInspect client IP details and DHCP status; renew the leaseRestore the DHCP service, correct the address pool, and remove a second unintended DHCP server
Client cannot ping the gatewayLocal LAN, Wi-Fi isolation, subnet, or gateway issueCheck client address, subnet, gateway, VLAN or guest-network settingsJoin the correct network and correct LAN or isolation settings
Gateway works but public IP test failsWAN, modem/ONT, ISP, or WAN configuration issueCheck WAN address, router status, upstream cable, and modem/ONT indicatorsCorrect DHCP, PPPoE, or static settings; restore the upstream connection
Public IP works but domain names failDNS problemTest a public IP, inspect DNS settings, and try another DNS server if appropriateCorrect DHCP or DNS configuration and resolve any provider DNS outage
Administration page will not openWrong management address, guest isolation, power, or changed access settingsFind the client's default gateway, confirm the local network, try Ethernet, and try HTTPS if supportedUse the correct address and network; restore management access only through a trusted local connection
Local service cannot be reached from outsidePort forwarding, firewall, changing internal IP, double NAT, or carrier-grade NATTest the service internally, check its stable address, rules, public WAN address, and an external test networkCorrect 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.