TechKnowSurge
Cisco CCNA 3.1 Cisco CCNA 3.2 Cisco CCST Networking 4.4 CompTIA Network+ 2.1 CompTIA A+ Core 1 2.6
VideoNetworkFree

Layer 2 and Default Gateways

When a device needs to communicate outside its local network, it relies on a default gateway — typically the edge router — to forward traffic beyond the LAN. ARP resolves the gateway's MAC address so the device can properly frame and send packets to it.

Complete this video to capture a CTF flag worth 1 point.

About this video

Within a local area network, devices use ARP to resolve IP addresses to MAC addresses and deliver Ethernet frames directly to the intended recipient through a switch. This process works cleanly as long as both devices share the same network. Once the destination IP falls outside that network, however, MAC-based delivery alone is no longer sufficient, and a different forwarding mechanism takes over. Every networked device is configured with a default gateway — the IP address of the local router that sits at the edge of the network — which serves as the exit point for all traffic destined for external networks. When a device recognizes that a target IP is outside its subnet, it does not attempt direct delivery. Instead, it sends an ARP request to resolve the MAC address of the default gateway. The router responds to that request, and the originating device can then build a properly addressed Ethernet frame with the router's MAC as the destination. The router receives that frame, strips the Layer 2 header, and forwards the encapsulated packet outward toward its destination on the external network.

What you'll learn

What's covered

Default Gateway Communication

Aligned to

Cisco CCNA
3.1 Interpret the components of routing table
3.2 Determine how a router makes a forwarding decision by default
Cisco CCST Networking
4.4 Explain basic routing concepts
CompTIA Network+
2.1 Explain characteristics of routing technologies
CompTIA A+ Core 1
2.6 Compare and contrast common network configuration concepts

Key terms

Address Resolution Protocol
ARP
A protocol used to map an IP address to a physical MAC address on a local network.
Default Gateway
The router that a device uses to send traffic to destinations outside its local network.
Media Access Control
MAC
A sublayer of the Data Link layer that controls how devices on a network gain access to a medium and transmit data.
Router
A network device that forwards data packets between networks based on IP addresses.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Ethernet Frame
The Layer 2 data unit used on Ethernet networks, containing a preamble, source and destination MAC addresses, an EtherType field identifying the Layer 3 protocol, a payload (typically an IP packet), and a 4-byte FCS for error detection. Switches use the MAC addresses in Ethernet frames to make forwarding decisions.

Transcript

Hopefully by now you have this great understanding of how one machine talks to another machine on a local area network. It does this address resolution protocol to figure out what the MAC address is, and then sends those frames onto that MAC address, and the switch will forward it to that machine. However, what happens when the machine it's trying to communicate on is on another network? Then what we're going to have to do is go through the default gateway.

Default gateways

What if the IP address of the machine is somewhere outside of the network, so it's a whole other network? We already know MAC addresses are used to communicate on the local LAN, but it doesn't work once you get beyond the router. So what happens is that a machine will recognize if an IP address it's trying to reach is outside the network. And if it's outside of the network, then it has something called a default gateway. The default gateway on the machine is usually the router that's sitting on the edge of your network.

The machine is going to say, if I'm trying to communicate to an IP address that's outside of my network, then what I need to do is send this information to the default gateway, and I don't know what the MAC address of the default gateway is. So then the next question is, how does it figure out the MAC address?

Finding the gateway's MAC address

If you answered that it does an ARP request, you would be correct. So it has an IP address of the default gateway. It sends an ARP request out that's destined to that IP address. The ARP request gets flooded out of all connections. This router receives that ARP request, recognizes that it's an ARP request for the IP address that it has, and so it's going to reply back.

Now this machine knows the MAC address of the default gateway, and it can then form an Ethernet frame using the source MAC address of itself and the destination MAC address of the router, send it to that router, and then that router handles it as it goes externally outside of the network.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →