You are currently viewing Lecture 1.1: The Basics at Layer 2

Lecture 1.1: The Basics at Layer 2

Every network starts with a switch, that connects a couple of devices and eventually a device that is being used as a default gateway that would enable external reachability.

One should keep in mind that Switches make hosts communicate using their MAC Addresses, not their IP Addresses. To make that possible switches use a protocol called ARP (Address Resolution Protocol) that matches IP addresses to MAC addresses. They’re usually stored in a tabled called the ARP Table. 
To view the ARP table we use the command: 

SAMPLE-SW#show ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.10.10.12             0   0009.0f09.0012  ARPA   Vlan30
Internet  10.10.10.222           10   0050.56ae.8dab  ARPA   Vlan30
Internet  10.10.10.232            -   4ce1.755d.ebe5  ARPA   Vlan30
Internet  10.10.10.234            4   308b.b28d.179e  ARPA   Vlan30
Internet  10.10.10.235          131   6c41.0ec5.cb24  ARPA   Vlan30
As noticed, the ARP table contains the IP address, the MAC address and the interface it was learned on.
ARP works when a switch receives a packet with an IP address that is not being matched to a known MAC address so it Floods that packet to all of the available ports with the exception of the original port

Once an ARP request is fulfilled, the learned MAC address and the interface that it was learned on are added to the MAC address table with an entry type of dynamic.
 
the command to view the MAC Address table is 
CORE_SWITCH#sh mac address-table dynamic vlan 30
Mac Address Table
-------------------------------------------

Vlan Mac Address Type Ports
---- ----------- -------- -----
30 000c.29cf.7491 DYNAMIC Gi1/0/2
30 000c.820d.08ea DYNAMIC Gi1/0/48
30 0020.85df.956e DYNAMIC Gi1/0/16
30 0020.85df.9580 DYNAMIC Gi1/0/17
30 0045.1d6b.754b DYNAMIC Gi1/0/45
30 0050.565b.2608 DYNAMIC Gi1/0/12
30 0050.565d.acda DYNAMIC Gi1/0/3
30 0050.565e.5eee DYNAMIC Gi1/0/2
30 0050.565f.8174 DYNAMIC Gi1/0/11
30 0050.56a0.022f DYNAMIC Gi1/0/2
30 0050.56a0.034c DYNAMIC Gi1/0/2
Whenever more than 1 MAC address is mapped to a single port, it means that another switch (or a wireless access point) is connected to the other end.

Leave a Reply