Skip to content

Networking & Infrastructure

How LAN Devices Connect to the Internet Through a Network Switch

Date:

Nov 9, 2026

A practical, end-to-end guide to how LAN computers access the internet through Ethernet switches, routers, DHCP, ARP, DNS, NAT, IPv6 and internet service providers.

001

The Internet Starts Inside Your Local Network

Opening a website looks effortless: connect a computer to an Ethernet switch, launch a browser, and type a domain name. Behind that action, however, several systems cooperate. The switch moves local Ethernet frames, the router forwards IP packets to other networks, DNS helps locate servers, and internet providers carry traffic toward its destination.

A useful way to understand the process is to follow one request from a computer to a remote website and then trace the response back. Along the way, we can separate the responsibilities of a switch, router, modem or optical network terminal, and the protocols running on each device.

This article focuses on an ordinary wired LAN with a Layer 2 Ethernet switch and a router acting as its internet gateway. Real networks may combine these functions into one box or distribute them across several devices, but the underlying ideas stay remarkably similar.

002

What Is a LAN?

A Local Area Network, or LAN, connects devices within a limited location such as a home, office, laboratory, or campus building. Computers, printers, access points, storage systems, cameras, and local servers may all share the same LAN infrastructure.

A LAN makes local communication possible even when the internet connection is unavailable. For example, two computers in the same VLAN and IP subnet can usually exchange files through a switch without sending the file through the internet provider.

The internet, by contrast, is a global collection of interconnected networks. Reaching a server outside the local network requires a Layer 3 route and a working upstream connection.

003

Meet the Devices in the Connection Path

A common small-office path is Computer to Ethernet cable to Switch to Router to Modem or ONT to ISP to Internet. The return traffic usually follows the corresponding network connections back toward the computer, although paths within the internet can be asymmetric.

The computer creates and consumes data. The switch connects local Ethernet devices. The router forwards traffic between IP networks. A modem or optical network terminal, or ONT, terminates the broadband access technology. The Internet Service Provider, or ISP, carries traffic into its network and onward toward other networks.

In a home, a single residential gateway may combine routing, Wi-Fi, switching, firewall, and modem or ONT features. In a business, these often exist as separate components for easier management and expansion.

004

What a Network Switch Actually Does

A typical Ethernet switch operates primarily at Layer 2 of the OSI model, called the Data Link Layer. Its principal job is to receive Ethernet frames and forward them toward the correct port based on their destination MAC addresses and VLAN context.

If a computer on Port 1 sends traffic to a printer on Port 5, the switch can deliver the frames to Port 5 without flooding every frame through every connected port. This selective forwarding helps multiple conversations share the switch efficiently.

A basic Layer 2 switch does not need to understand the content of a website or decide which internet route to use. Those responsibilities belong to other protocols and devices. Some Layer 3 switches can also route IP packets, but that is an additional capability rather than an automatic property of every switch.

005

Why a Switch Alone Is Not an Internet Connection

Plugging several PCs into an unmanaged switch creates local connectivity, not an internet service. Without an upstream gateway and appropriate IP configuration, the machines may communicate with one another but cannot automatically reach external websites.

A conventional switch does not independently obtain a broadband subscription, establish an ISP session, provide a default route, or perform typical home-router functions such as stateful firewalling and IPv4 address translation.

A Layer 3 switch can perform routing when configured to do so. Even then, reaching the internet still requires an upstream path, valid addressing, and routing and security policies.

006

How Ethernet Cables Establish the Link

The physical connection commonly uses twisted-pair Ethernet cabling, such as Cat5e or Cat6, between the computer's network interface and a switch port. The two interfaces establish a link using supported Ethernet signaling and, where applicable, auto-negotiation.

A network interface might negotiate 100 Mbps, 1 Gbps, 2.5 Gbps, or another supported speed. That number describes the local Ethernet link, not necessarily the internet bandwidth purchased from the ISP.

Bad cables, damaged connectors, incompatible equipment, or a disabled port can prevent the link from forming or force it to a lower speed. Checking link status is often the first step in diagnosing an apparently missing internet connection.

007

MAC Addresses Identify Local Ethernet Destinations

Ethernet frames carry source and destination Media Access Control, or MAC, addresses. A common 48-bit MAC address is written as six hexadecimal groups, such as 02:1A:2B:3C:4D:5E. The example is illustrative, not an address assigned to a particular device.

The source MAC address helps a switch learn where traffic came from; the destination MAC address tells it where an Ethernet frame should go on the local Layer 2 network. A device may use a hardware-assigned, locally administered, or randomized address depending on its configuration.

A MAC address is not a substitute for an IP address. Ethernet uses MAC addresses for local frame delivery, while IP addresses allow routers to forward packets across different networks.

008

How Switches Learn Which Device Is on Which Port

A switch builds a MAC forwarding table by examining the source MAC address of arriving frames. If a frame from Computer A arrives on Port 2, the switch records that Computer A's MAC address can be reached through Port 2 within the relevant VLAN.

When a frame arrives for a known destination MAC address, the switch forwards it toward the learned port. When the destination is unknown, the switch generally floods that frame to eligible ports in the same VLAN, apart from the incoming port.

Learned entries age out when not refreshed. This allows the switch to adapt when devices move to different ports. Broadcast traffic, such as many IPv4 ARP requests, is also flooded within the applicable broadcast domain.

009

IP Addresses and Subnets Explain Who Is Local

An IPv4 address such as 192.168.1.10 identifies an interface in an IP network. A subnet mask or prefix length tells the computer which destinations are directly reachable on the local network and which require routing.

Suppose a LAN uses 192.168.1.0/24, with Computer A at 192.168.1.10 and the router at 192.168.1.1. A second computer at 192.168.1.20 is normally considered local. A public destination outside that prefix is normally sent through a configured route, often the default gateway.

Private IPv4 ranges include 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These address spaces can be used internally but are not globally routed across the public IPv4 internet.

010

DHCP Gives Devices Network Settings Automatically

Most home and office clients use the Dynamic Host Configuration Protocol, or DHCP, to obtain their IPv4 settings. In a common initial exchange, the client sends Discover, a server responds with Offer, the client sends Request, and the server confirms with Acknowledge. This is often abbreviated DORA.

A DHCP lease can include an IP address, subnet mask, default gateway, DNS resolver addresses, and lease duration. For example, a PC could receive 192.168.1.10/24 with gateway 192.168.1.1 and a designated DNS resolver.

The DHCP server often runs on the home router, but a business can use a dedicated server with DHCP relay across subnets. The Ethernet switch typically forwards DHCP-related frames rather than assigning addresses itself.

011

The Default Gateway Is the Exit From the LAN

The default gateway is the next-hop router used when no more specific route matches an external destination. It is commonly an IP address assigned to the router's LAN interface, such as 192.168.1.1.

The computer examines its routing table before sending traffic. If the destination is within a directly connected subnet, it normally sends locally. If the destination is elsewhere, it forwards the packet toward a router identified by the selected route.

A missing or incorrect default gateway can create a confusing symptom: local printers and nearby PCs still work, but internet websites do not. That is why gateway configuration deserves its own troubleshooting check.

012

ARP Finds the Gateway's Ethernet Address

For IPv4 over Ethernet, a computer must know the next hop's MAC address before it can send an Ethernet frame toward that next hop. The Address Resolution Protocol, or ARP, resolves a local IPv4 address into a MAC address.

If Computer A needs to send traffic through 192.168.1.1 and does not have a usable ARP cache entry, it broadcasts a request asking which interface owns that address. The router replies with its MAC address, and the computer can then address frames to the gateway.

Notice the distinction: the Ethernet destination is the router's MAC address, but the IP destination inside the frame remains the remote server's IP address. The switch forwards the frame using local Ethernet information.

013

DNS Turns Domain Names Into Addresses

When someone enters a website's name, the browser generally needs one or more destination IP addresses. DNS provides records that associate domain names with information such as IPv4 A records and IPv6 AAAA records.

The computer may first consult local or browser caches. If necessary, it queries a configured DNS resolver. Depending on the network, that resolver could be a service on the router, a local organization, an ISP, or another DNS provider.

DNS traffic itself travels as network traffic across the LAN and, when appropriate, through the router. The Ethernet switch does not understand the domain name as part of its normal frame-forwarding decision.

014

From Browser Data to Ethernet Frames

Network communication is organized into layers. A web browser produces an application request, the transport layer provides a mechanism to exchange data, IP handles addressing and routing, and Ethernet frames carry IP packets across the local link.

For an HTTPS connection using TCP, the communication includes TCP segments carried in IP packets, which are in turn encapsulated in Ethernet frames on the LAN. HTTP/3 commonly uses QUIC over UDP, so its transport behavior differs while the basic IP and local Ethernet responsibilities remain.

The switch mainly examines the outer frame information. It does not need to decrypt HTTPS or interpret HTTP requests to forward ordinary Layer 2 traffic.

015

The First Hop: Computer to Switch to Router

Imagine a computer connected to Switch Port 3 and the router connected to Port 8. After learning the gateway's MAC address, the computer sends an Ethernet frame with that MAC as the local destination.

The switch receives the frame on Port 3, refreshes its forwarding table entry for the source, and checks where the destination MAC is reachable. If it has learned the router on Port 8, it transmits the frame through Port 8.

The router accepts the Ethernet frame, processes the enclosed IP packet, and chooses the next hop using its routing table. It will normally build an appropriate new link-layer frame for the next network segment rather than forwarding the original Ethernet frame unchanged across the internet.

016

What the Router Does With the Packet

A router connects different IP networks. Its forwarding decision depends on the destination IP address and its routing table rather than solely on the frame's MAC address.

A home router usually has a LAN-side network and a WAN-side path toward the provider. It may apply firewall rules, connection tracking, policy routing, or address translation before forwarding the packet toward the ISP.

A router must also have a working upstream route. A correctly connected switch and properly configured client will not restore internet access if the router itself cannot reach the provider.

017

NAT Lets Many IPv4 Clients Share a Connection

Many networks use private IPv4 addresses that cannot be routed directly across the public IPv4 internet. Network Address Translation, or NAT, allows a router to modify addressing information as traffic crosses a network boundary.

A common home configuration uses Network Address and Port Translation, often called PAT or NAPT. The router can associate connections from several internal devices with a public-facing address while assigning distinct translated transport-port mappings.

The router maintains state to send returning packets to the proper internal host. This explains how multiple computers can browse simultaneously without each having its own public IPv4 address. NAT is common in IPv4 environments, but it is not required for all internet connectivity and is generally unnecessary for ordinary globally routed IPv6 communication.

018

What a Modem or ONT Contributes

The modem or Optical Network Terminal connects the customer installation to the ISP's access technology. A cable modem, DSL modem, and fiber ONT each serve technology-specific roles and may use different physical media and signaling.

Some installations place a separate router behind a bridged modem or ONT. Others use an integrated residential gateway with switching, Wi-Fi, routing, and access termination in a single enclosure.

A bridged ONT should not automatically be treated as a router. Connecting an unmanaged switch directly to the provider handoff may not allow several devices to receive usable internet service, depending on the ISP's configuration.

019

How the ISP and the Wider Internet Forward Traffic

After leaving the customer network, packets enter the provider's infrastructure. They may travel through access aggregation systems, provider edge routers, backbone links, and interconnections with other organizations.

The internet comprises independently operated networks, often called Autonomous Systems. Networks exchange reachability information using BGP and make forwarding decisions according to routes and policies.

The resulting path may include a direct peering connection, an internet exchange, or transit through other providers. The local switch does not maintain a map of the global internet; it needs only to deliver its frames to the correct local next hop.

020

HTTPS Protects the Application Conversation

After identifying a server and reaching it over the network, the browser establishes the necessary transport and security communication. For traditional HTTPS over TCP, the TCP connection commonly begins with SYN, SYN-ACK, and ACK.

TLS then provides server authentication and encryption. The browser checks the server's certificate and negotiates keys before sending protected application requests. With HTTP/3, QUIC integrates TLS 1.3 into a transport built over UDP.

Encryption protects the application exchange as it crosses the switch, router, ISP, and other intermediate networks. It does not eliminate the need to secure the endpoints, network management, and routing infrastructure.

021

How the Reply Gets Back to the Right Computer

The destination server processes the request and sends a response. The return packets travel toward the client network through the networks selected by internet routing.

In a common IPv4 NAT setup, the home or office router receives the returning traffic, uses its connection and translation state to identify the correct internal destination, and forwards the IP packet onto the LAN.

The router encapsulates the outgoing LAN packet into an Ethernet frame addressed to the client. The switch finds the client's MAC address in its forwarding table and sends the frame through the correct port. The operating system passes the received data to the browser, which renders the page.

022

Why Local File Transfers Can Bypass the Router

Two hosts in the same VLAN and subnet can normally communicate without an IP router forwarding their packets. Each host identifies the other's local link-layer address and sends traffic over the switch.

For example, a desktop connected to Port 2 can send a file to a NAS connected to Port 6. Once the switch learns the relevant MAC addresses, it forwards their frames directly within the LAN.

A broken ISP connection does not necessarily prevent this local transfer. Communication between different VLANs or subnets, however, usually requires a router or routing-capable switch and suitable access rules.

023

How Ten Computers Share One Uplink

A switch can handle many Ethernet conversations at once. Each client has a separate local link, but the uplink toward the router and the internet service may be shared by all active users.

When one PC downloads a large update and others join video meetings, they compete for bandwidth along any shared bottleneck. Port speed, switch uplink capacity, router performance, ISP bandwidth, congestion, and remote-server limitations all affect results.

A 1 Gbps connection from a PC to its switch does not turn a 100 Mbps broadband subscription into a 1 Gbps internet service. Local network capacity and internet bandwidth are different measurements.

024

Broadcast, Unicast, and Multicast Traffic

Unicast frames target a specific Ethernet destination. A learned switch can send a known unicast frame toward the relevant port. Broadcast frames reach the eligible devices in the local broadcast domain, which is useful for procedures such as IPv4 ARP discovery.

Multicast frames represent traffic intended for groups of receivers. Some managed switches use IGMP snooping or MLD snooping to learn group memberships and reduce unnecessary multicast flooding.

Excessive flooding can consume shared capacity. Proper VLAN design, loop prevention, and monitoring become increasingly important as LANs grow.

025

VLANs Divide One Switch Into Logical Networks

Virtual Local Area Networks, or VLANs, allow a shared physical switching system to support separate Layer 2 broadcast domains. An office might place staff computers, guest devices, security cameras, and management interfaces into different VLANs.

Devices in different VLANs normally need Layer 3 routing to communicate. Administrators can apply firewall or access-control policies at that boundary to limit which services are reachable.

On links between managed switches, IEEE 802.1Q tagging can identify VLAN membership. VLANs improve organization and separation, but they are not by themselves a complete substitute for security controls.

026

Where Wi-Fi Access Points Fit

A wireless access point connects Wi-Fi clients to an underlying network. In an office, the access point is often connected to an Ethernet switch through a cable and may receive power using Power over Ethernet when both equipment and standards support it.

Traffic from a smartphone can travel over Wi-Fi to the access point, through the wired switch to the router, and then toward the internet. The access point bridges or otherwise handles wireless client traffic according to its operating mode and configuration.

Multiple wireless networks can be mapped to different VLANs on compatible equipment, allowing guest and staff traffic to follow different network policies.

027

IPv6 Uses a Different Neighbor Discovery System

IPv6 uses 128-bit addresses and generally relies on Neighbor Discovery rather than IPv4 ARP. Router Advertisements can tell a host about network prefixes and default routers, and devices may configure addresses with SLAAC or DHCPv6 as appropriate.

In many IPv6 deployments, hosts receive globally routable addresses without traditional IPv4-style NAT. Stateful firewalls and other access restrictions remain important because routable addressing does not imply that unsolicited inbound traffic should be permitted.

The Ethernet switch still forwards frames based on local MAC addresses, while the router forwards IPv6 packets using Layer 3 routing information. Many contemporary networks carry IPv4 and IPv6 side by side.

028

Managed and Unmanaged Switches

An unmanaged switch is usually designed for straightforward plug-and-play Ethernet connectivity. It learns MAC addresses and forwards frames without requiring an administrator to configure VLANs, routing, or detailed monitoring.

A managed switch can provide features such as VLAN configuration, port statistics, link aggregation, quality-of-service policies, port mirroring, spanning tree, and sometimes Layer 3 routing. The available functions depend on the specific device.

For a small home LAN, an unmanaged switch may be sufficient. For an office with separate guest, staff, and infrastructure networks, managed switching is often the better foundation.

029

How Network Loops Can Break Connectivity

Ethernet loops can occur when multiple active paths connect the same Layer 2 segments without appropriate protection. Broadcast and unknown-unicast traffic may circulate repeatedly, creating traffic amplification and instability.

Managed switches commonly support loop-prevention mechanisms such as Spanning Tree Protocol or Rapid Spanning Tree Protocol. Some equipment also provides storm control and loop detection.

Redundant links should be planned intentionally, using supported protocols or properly configured aggregation, rather than simply adding extra cables between switch ports.

030

Security Matters on the LAN Too

A switch does not automatically protect devices from malicious local traffic. Risks include unauthorized physical connections, rogue DHCP services, ARP spoofing, insecure switch-management interfaces, and mistakes in VLAN or access-control configuration.

Depending on the equipment, managed networks may support protections such as DHCP snooping, Dynamic ARP Inspection, port security, 802.1X authentication, management VLAN separation, and restricted administration access.

Use encrypted application protocols, update network equipment, secure credentials, and apply firewall policies appropriate to the network. Layered protection is more dependable than treating any one switching feature as a complete security solution.

031

Troubleshooting: Start With the Physical Link

When internet access fails, first check the Ethernet cable, port LEDs, and network interface status. An inactive link points toward cabling, port configuration, equipment power, or a faulty interface rather than DNS.

On Windows, ipconfig /all shows interface details, IPv4 addresses, DHCP status, gateway settings, and DNS servers. A missing or self-assigned address may indicate a DHCP or connectivity problem.

Confirm that the computer has an IP address belonging to its intended subnet and that the default gateway is correct before testing outside destinations.

032

Troubleshooting: Is It the Gateway, DNS, or ISP?

Test basic communication with the gateway, for example ping 192.168.1.1 if that is the actual gateway address. A failed ping is a clue, but not final proof of failure because some devices block or limit ICMP echo responses.

Next, test external IP connectivity using a suitable known destination and an appropriate protocol. If reaching an external address works but domain names fail, inspect name resolution with nslookup or another DNS diagnostic tool.

Windows tracert and comparable traceroute utilities can reveal parts of the path toward a destination. Missing intermediate responses do not necessarily mean traffic is broken, because routers may suppress diagnostic messages.

033

A Complete Packet Walkthrough

Imagine Computer A at 192.168.1.10 connected to Switch Port 1, with a router at 192.168.1.1 connected to Port 8. The router has an active broadband connection through a fiber ONT.

First, DHCP supplies Computer A with its address, subnet, gateway, and DNS settings. Next, the user opens a website, and the browser obtains a server address through DNS or cache. The operating system identifies the destination as external and selects the default gateway.

If needed, ARP resolves the gateway's MAC address. Computer A sends Ethernet frames addressed to the gateway. The switch forwards them toward Port 8. The router applies routing, firewall processing, and any required IPv4 address translation before sending traffic toward the ISP.

The provider and other internet networks forward the packets toward the server. The browser and server negotiate the transport and security protocols required for the application, exchange requests and responses, and send return traffic toward the client network.

The office router forwards each returned packet to Computer A, including reversing applicable NAT mappings. The switch then delivers the corresponding Ethernet frames to Port 1, and the browser processes the response.

034

Common Misunderstandings Worth Correcting

A switch is not automatically a router, and a router does not always include a modem or ONT. Some consumer devices contain all of these functions, which can make them appear interchangeable even though their networking roles are different.

MAC addresses do not guide packets across the entire internet. They guide local Ethernet delivery. Likewise, not all communication crosses the internet: computers in the same VLAN and subnet often exchange data entirely within the LAN.

A working Ethernet link does not guarantee valid addressing, DNS resolution, or an operational ISP connection. And a faster switch will not fix a slow remote server or a broadband bottleneck.

035

Putting the Journey Together

At the local level, a computer joins the LAN, receives appropriate network settings, resolves nearby next-hop addresses, and sends Ethernet frames into the switch. The switch learns MAC addresses and forwards frames to the relevant ports.

When the destination is on another IP network, the default gateway receives the packet and forwards it according to routing and security rules. The provider then carries it toward the larger internet, where other routers continue forwarding it toward the destination.

The response returns to the client network. The local router sends packets toward the correct computer, and the switch delivers their frames. A process that spans Ethernet, DHCP, ARP or IPv6 neighbor discovery, DNS, routing, transport security, and application protocols becomes the simple experience of loading a webpage.

The central lesson is clear: a network switch provides the local connection, while the router and upstream network provide the path to the internet. Knowing where one role ends and the next begins is the foundation for building, securing, and troubleshooting reliable networks.

More Articles

Keep reading