How to Set Up an Ethernet LAN, How It Works, and Cable Types

how to setup an Ethernet LAN, how it's works and types of cables

A Local Area Network (LAN) is the foundation of almost every home and business network. Before your laptop talks to the internet, before your printer shows up on the network, before your security cameras stream video to your phone — all of that traffic first has to move across a LAN, and in the overwhelming majority of cases, that LAN is built on Ethernet.

This guide explains Ethernet from first principles: what it actually is, how data physically moves across a cable, the different cable types and when to use each, and a complete step-by-step walkthrough of setting up a wired LAN for a home or small business. Whether you are a student learning networking for the first time or an IT professional refreshing your fundamentals, this article is written to be useful to both.

What Is Ethernet?

Ethernet is a set of standards (IEEE 802.3) that define how devices on a wired local network communicate. It specifies:

  • The physical medium (cables and connectors)
  • How electrical or optical signals represent data (encoding)
  • How devices share access to the network and avoid collisions
  • The frame format used to package data for transmission

Ethernet operates at Layer 1 (Physical) and Layer 2 (Data Link) of the OSI model. It doesn’t know or care about IP addresses — that’s the job of Layer 3 protocols like IP. Ethernet’s job is simpler: get a frame of data from one network interface card (NIC) to another on the same physical segment, using a hardware address called a MAC address.

The Ethernet Frame

Every piece of data sent over Ethernet is wrapped in a frame with this basic structure:

FieldSizePurpose
Preamble7 bytesSynchronizes the receiver’s clock
Start Frame Delimiter1 byteMarks the start of the frame
Destination MAC6 bytesHardware address of the receiving NIC
Source MAC6 bytesHardware address of the sending NIC
EtherType/Length2 bytesIdentifies the upper-layer protocol (e.g., IPv4, IPv6, ARP)
Payload46–1500 bytesThe actual data (e.g., an IP packet)
Frame Check Sequence4 bytesCRC checksum for error detection

Every network card has a unique 48-bit MAC address burned into it at the factory, like 00:1A:2B:3C:4D:5E. When your computer sends a frame, it uses this address — not an IP address — to identify who should receive it on the local segment.

How Ethernet Actually Works

From Hubs to Switches

In the early days, Ethernet LANs used hubs, which were essentially dumb repeaters — anything received on one port was broadcast to every other port. This meant every device on the network was in the same “collision domain,” and devices had to use a mechanism called CSMA/CD (Carrier Sense Multiple Access with Collision Detection) to avoid talking over each other.

Modern LANs use switches instead. A switch learns which MAC address lives on which port by inspecting incoming frames, and builds a MAC address table. When it needs to forward a frame, it looks up the destination MAC address and sends the frame only out the correct port — not to everyone. This eliminates most collisions and lets multiple devices communicate simultaneously at full speed.

graph LR
    A[PC-1] ---|Cat6 Cable| SW[Ethernet Switch]
    B[PC-2] ---|Cat6 Cable| SW
    C[Printer] ---|Cat6 Cable| SW
    D[NAS Server] ---|Cat6 Cable| SW
    SW ---|Uplink| R[Router]
    R --- INT((Internet))

Full Duplex and Speed

Modern switched Ethernet runs in full duplex mode — meaning a device can send and receive at the same time on separate wire pairs, which is why collisions are effectively a non-issue on switched networks today.

Common Ethernet speeds:

StandardSpeedCommon Name
802.3i10 MbpsEthernet
802.3u100 MbpsFast Ethernet
802.3ab1 GbpsGigabit Ethernet
802.3an10 Gbps10 Gigabit Ethernet
802.3bz2.5/5 GbpsMulti-Gig Ethernet

Ethernet Cable Types

Twisted Pair Categories

Most Ethernet cabling today is unshielded twisted pair (UTP), made of 4 pairs of copper wires twisted together to reduce electromagnetic interference (crosstalk).

CategoryMax SpeedMax DistanceTypical Use
Cat5100 Mbps100mLegacy, largely obsolete
Cat5e1 Gbps100mHome networks, budget installs
Cat61 Gbps (10 Gbps up to 55m)100m / 55mHome and business standard
Cat6a10 Gbps100mModern business installs
Cat710 Gbps100mShielded, data centers
Cat825/40 Gbps30mData center short runs

Straight-Through vs Crossover Cables

  • Straight-through cable: Pin layout is identical on both ends (T568B on both). Used to connect different device types — e.g., PC to switch, switch to router.
  • Crossover cable: Transmit and receive pairs are swapped on one end. Historically used to connect like devices — e.g., switch to switch, PC to PC. Modern NICs and switches support Auto-MDI/MDI-X, which automatically detects and adjusts, making crossover cables largely unnecessary today.

Fiber Optic Alternatives

For longer distances or higher bandwidth, fiber replaces copper:

Fiber TypeDistanceUse Case
Multi-mode (OM3/OM4)Up to 550m/10GbpsData center, campus backbone
Single-mode (OS2)Up to 40km+Long-haul, ISP links

Step-by-Step: Setting Up a Wired LAN

Step 1: Plan Your Layout

Sketch where devices will sit and where your central switch/router will live. Aim to minimize cable runs and keep them under 100 meters for copper.

Step 2: Choose Your Hardware

For a home setup:

  • A router (often combined with a modem) — provides internet access and DHCP
  • An unmanaged switch if you need more ports than the router provides
  • Cat6 patch cables

For a small business:

  • A managed switch — supports VLANs, port monitoring, and QoS
  • Structured cabling with a patch panel
  • A firewall/router appliance

Step 3: Run and Terminate Cables

If installing in-wall cabling, use bulk Cat6 cable and terminate it with RJ45 connectors or into a patch panel using the T568B wiring standard:

Pin 1: White/Orange   Pin 5: White/Blue
Pin 2: Orange         Pin 6: Green
Pin 3: White/Green    Pin 7: White/Brown
Pin 4: Blue           Pin 8: Brown

Step 4: Connect Devices

Plug each device into a switch port using a patch cable. Connect the switch’s uplink port to your router’s LAN port.

Step 5: Verify Connectivity on Linux

# Check the interface is up and has a link
ip link show eth0

# Confirm the interface received an IP via DHCP
ip addr show eth0

# Test connectivity to the gateway
ping -c 4 192.168.1.1

# Check the negotiated speed and duplex
ethtool eth0

Example ethtool output confirming a healthy gigabit link:

Speed: 1000Mb/s
Duplex: Full
Link detected: yes

Step 6: Verify on Cisco Equipment

On a Cisco switch, check port status and negotiated speed:

Switch# show interfaces gigabitEthernet 0/1 status

Port      Name               Status       Vlan       Duplex  Speed Type
Gi0/1                        connected    1          a-full  a-1000 10/100/1000BaseTX

To manually set speed and duplex instead of relying on auto-negotiation (useful when troubleshooting mismatches):

Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# speed 1000
Switch(config-if)# duplex full

Step 7: Automate a Basic Connectivity Check with Python

import subprocess

def check_host(ip):
    result = subprocess.run(
        ["ping", "-c", "2", ip],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    return result.returncode == 0

devices = ["192.168.1.1", "192.168.1.10", "192.168.1.20"]
for ip in devices:
    status = "UP" if check_host(ip) else "DOWN"
    print(f"{ip}: {status}")

Best Practices

  • Keep cable runs under 100 meters; use fiber for longer distances.
  • Label both ends of every cable during installation — future you will thank you.
  • Avoid running Ethernet cable parallel to power lines to reduce EMI.
  • Use Cat6 or better for any new installation, even if you only need Gigabit today.
  • Separate voice, data, and management traffic using VLANs on managed switches.
  • Keep a spare patch cable and a cable tester on hand.
  • Document your patch panel port mappings.

Troubleshooting Common Issues

SymptomLikely CauseFix
No link lightBad cable or portSwap cable, try another port
Link but no connectivityIP config issueCheck ip addr, DHCP lease
Slow speedsDuplex mismatch, bad cable, Cat5 in useCheck ethtool/show interfaces, replace cable
Intermittent dropsCable damage, EMIReroute cable away from interference sources
Works wired, not wirelessUnrelated Wi-Fi issueIsolate the segment — this is a different problem

Use ping, traceroute/tracert, and arp -a as your first three diagnostic commands on any LAN issue.

Further Reading

Conclusion

Ethernet has remained the backbone of wired networking for decades because it is simple, reliable, and continuously improved without breaking backward compatibility. Understanding how frames move, how switches learn MAC addresses, and how to pick the right cable for the job gives you a solid foundation for everything else you’ll build on top of a LAN — from IP addressing to routing to advanced network security.

Total
1
Shares

Leave a Reply

Previous Post
internet services and port numbers

Internet Services and Port Numbers

Next Post
how to configure TCPIP network in linux

How to Configure TCP/IP Networking in Linux

Related Posts