Port Security

  • By default, all switch interfaces on a Cisco device are enabled.
    This means any physically connected device can instantly gain network access.

    Example of a client connecting to a network interface without port security enabled

    Figure 1 – Default Behavior of a Cisco Switch Port

    This behavior may seem convenient, but it exposes the network to risk.

    In shared offices, public spaces, or uncontrolled environments, anyone could plug in a rogue device and gain access.

    Without restrictions, the switch would accept the connection, allowing unauthorized traffic or even malicious activity.

    To prevent this, we use Port Security.

    This feature allows you to control which MAC addresses are allowed to send traffic on each port.

    Cisco Port Security blocking unauthorized device with MAC DDDD.EEEE.FFFF on interface G0/1, preventing access to server via SW1

    Figure 2 – Unauthorized Device Blocked by Port Security

    How Port Security Works

    Port Security is a Layer 2 feature.

    It verifies the source MAC address of each incoming frame and checks if it matches an allowed address for that port.

    Port security denying access to a device with an unknown MAC address

    Figure 3 – MAC Address Violation Detected by Port Security

    With Port Security, administrators can:

    • Choose what happens when a violation occurs

    • Define which devices are allowed on which ports

    • Limit the number of MAC addresses per port

    Answer the question below