How to Prevent Unauthorized Switches from Connecting to a Company Network

systech_unauthorized_switches

By Arjun Kumar, Senior Trainer, Systech Group 15+ years in Network Security and Cloud Architecture  · Updated October 2026. 

7  min read

In short

Prevent unauthorized switches from connecting to a company network by enabling port security, limiting the number of MAC addresses allowed on each switch port, disabling unused ports, and using 802.1X authentication. Regularly monitor network connections and configure access controls to prevent rogue devices from compromising network security.

Table of Contents

Introduction

Imagine an employee secretly connects an unauthorized managed switch to a free network port in the office. The employee then connects several computers to that switch and tries to access the company network.

If the original switch port does not have proper security controls, the unauthorized switch may allow more devices to connect to the network. Depending on the network design, these devices could access shared resources, create security risks or interfere with normal network traffic.

How can a network administrator prevent this?

The best approach is to use multiple security controls on the company’s Cisco switch. These include 802.1X port authentication, BPDU Guard, MAC address restrictions, access-port configuration, unused-port shutdown and network monitoring. Each control addresses a different risk.

For networking fundamentals and practical switch configuration, readers can also explore CCNA Training in Chennai.

This guide explains how these controls work, when to use them, and how to check whether they are protecting the network correctly.

What Is an Unauthorized Switch?

An unauthorized switch is a network switch connected to a company network without approval from the network administrator.

A managed switch normally allows an administrator to configure VLANs, monitor ports and control network traffic. However, even a properly managed device can create a security risk when it is connected without permission.

For example, an employee might connect a personal managed switch to an office wall port. The employee could then connect multiple devices to that switch and give them access to the company network.

The unauthorized switch may create several risks:

  • Unauthorized network access: Additional computers can connect through one approved network port.
  • VLAN or trunking risks: Incorrect port configuration may expose more network segments than intended.
  • Network loops: Incorrect connections can create Layer 2 loops and disrupt communication.
  • Rogue DHCP services: An unauthorized device may try to provide false IP addresses or gateway details.
  • Data exposure: Additional devices may gain access to resources that should be restricted.

The actual risk depends on the switch configuration, VLAN design, authentication policy and the devices connected behind the unauthorized switch.

Use 802.1X Authentication to Control Network Access

IEEE 802.1X port-based authentication is one of the key ways to prevent unauthorized devices from gaining access to a company network.

It requires a connected device to pass an authentication process before the switch allows normal network traffic. The switch can work with a central authentication server, commonly using RADIUS, to check the device or user’s credentials.

Without successful authentication, normal network access can remain blocked. Cisco documents this behaviour in its 802.1X port-based authentication guide.

How does 802.1X help?

Suppose an employee connects an unauthorized switch to an authentication-controlled access port. If the connected device cannot complete the required authentication, the switch can deny normal network access.

For an enterprise network, the administrator should establish an access policy that identifies approved users or devices and defines what happens when authentication fails.

Important: A managed switch connected behind an access port is not automatically identified as unauthorized by 802.1X in every topology. The result depends on how the connected switch handles authentication, the configured host mode and whether the network supports multi-device authentication. Configure and test the policy for the actual equipment.

Security also requires more than controlling the physical switch port. Businesses should define how devices access sensitive data, servers and management interfaces. A broader Cyber Security Course in Chennai provides a related learning path for understanding access control, network threats and defensive security.

Enable BPDU Guard on End-Device Ports

BPDU Guard is a Cisco Spanning Tree Protocol (STP) security feature.

STP helps prevent Layer 2 switching loops. Switches exchange Bridge Protocol Data Units (BPDUs) to share information about the network topology.

When BPDU Guard is enabled on a suitable edge port, receiving a BPDU causes the switch to place that port into an error-disabled state. This helps stop an unauthorized switch from joining the spanning-tree topology through a port intended for an end device.

Cisco configuration example

Use this configuration on a port that should connect only to a workstation or another approved end device:

Switch# configure terminal

Switch(config)# interface GigabitEthernet1/0/10

Switch(config-if)# switchport mode access

Switch(config-if)# spanning-tree portfast

Switch(config-if)# spanning-tree bpduguard enable

Switch(config-if)# end

In this example:

  • switchport mode access forces the interface to operate as an access port rather than negotiate a trunk.
  • spanning-tree portfast allows a suitable end-device port to enter the forwarding state quickly.
  • spanning-tree bpduguard enable protects the interface against unexpected BPDUs.

     

If an attached switch sends BPDUs on this port, BPDU Guard can shut down the port to help prevent an unsafe spanning-tree connection.

Do not apply this configuration blindly to authorized switch uplinks or links that must exchange BPDUs. Use BPDU Guard on appropriate edge ports and follow the design requirements for legitimate switch-to-switch links.

This control also has a limitation: if an unauthorized device does not send BPDUs on the port, BPDU Guard alone may not detect it. That is why multiple security controls are necessary.

For further practical learning about network attacks, security testing and defensive measures, readers can explore Ethical Hacking Training in Chennai.

Configure Cisco Port Security to Restrict MAC Addresses

Cisco Port Security limits which source MAC addresses a switch port accepts. A MAC address is the hardware address used to identify a network interface on a local network.

Consider an office port that should connect to just one approved computer. If an unauthorized switch is connected and traffic from multiple computers appears on the port, a correctly configured MAC address limit can help detect and block the extra devices.

Example: Allow one MAC address on an access port

The following example is intended for an ordinary end-device port on a Cisco platform that supports the shown Port Security commands.

Switch# configure terminal

Switch(config)# interface GigabitEthernet1/0/10

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan 20

Switch(config-if)# switchport port-security

Switch(config-if)# switchport port-security maximum 1

Switch(config-if)# switchport port-security mac-address sticky

Switch(config-if)# switchport port-security violation shutdown

Switch(config-if)# spanning-tree portfast

Switch(config-if)# spanning-tree bpduguard enable

Switch(config-if)# end

What do these commands do?

With this example, traffic from an additional, unapproved MAC address can trigger a port-security violation. The interface can then be shut down to prevent further traffic.

Cisco’s current Catalyst 9200 Port Security guide explains how secure MAC address limits and violation modes work.

Important Port Security limitations

Port Security is useful, but it does not prove that a physical switch itself is approved. It limits traffic based on MAC addresses, and MAC addresses can potentially be spoofed.

Also, the maximum 1 setting may be unsuitable for a port connecting an approved IP phone and computer. Such ports may need a different secure MAC limit and a correctly configured voice VLAN.

Platform warning: Do not combine this Port Security configuration with an 802.1X authenticator configuration without checking the exact switch model and software version. Cisco’s Catalyst 9200 IOS XE 26.x documentation advises against enabling Port Security on an 802.1X authenticator interface. Treat the Port Security example above and an enterprise 802.1X/NAC design as separate configuration approaches unless the platform documentation explicitly supports the combination.

Prevent Unauthorized Trunk Connections

A trunk port can carry traffic for multiple VLANs. This is normally required on approved links between switches, but a user-facing port should not automatically become a trunk.

If a port is left in a dynamic trunking mode, an improperly connected device may create an unwanted trunk under the applicable negotiation settings.

For ports that should connect only to end devices, explicitly configure access mode:

Switch(config)# interface GigabitEthernet1/0/10

Switch(config-if)# switchport mode access

On supported platforms, switchport nonegotiate can also be used to disable Dynamic Trunking Protocol (DTP) negotiation:

Switch(config-if)# switchport nonegotiate

Use the command only where supported and appropriate for the interface configuration.

These settings help ensure that an edge port remains an access port. They do not replace 802.1X authentication or MAC address restrictions, because an unauthorized switch may still forward ordinary endpoint traffic through an access port.

Administrators should also review approved trunks, remove unused VLANs from trunk links and restrict VLAN membership to what each link actually needs.

Disable Unused Switch Ports

Unused network ports are an avoidable entry point. If an employee or visitor can physically reach an unused active port, they may be able to connect an unauthorized switch or other device.

The simplest control is to shut down ports that are not in use.

Cisco configuration example

Switch# configure terminal

Switch(config)# interface range GigabitEthernet1/0/20-48

Switch(config-if-range)# switchport mode access

Switch(config-if-range)# switchport access vlan 999

Switch(config-if-range)# shutdown

Switch(config-if-range)# end

In this example, ports 20 through 48 are treated as unused ports. VLAN 999 is an example of a reserved, unused VLAN.

Replace the interface range and VLAN number with values appropriate for your network. Check every port before applying an interface-range command, and ensure VLAN 999 is not used for normal access or routing.

The shutdown command is the main protection here: it administratively disables the selected interfaces. The unused VLAN provides an additional configuration safeguard if a port is later enabled by mistake.

Best practice: Keep a current inventory of active switch ports and review it when employees move, equipment is removed or office layouts change.

Protect the Network with DHCP Snooping, Dynamic ARP Inspection and IP Source Guard

Stopping unauthorized switches from connecting is important, but administrators must also reduce the damage that a rogue device might cause if it reaches the network.

Three additional protections are useful.

DHCP Snooping

DHCP Snooping helps prevent unauthorized DHCP server messages from reaching clients. The administrator defines which ports are trusted to receive legitimate server-side DHCP messages; user-facing ports normally remain untrusted.

If a device behind an unauthorized switch attempts to act as a rogue DHCP server, correctly configured DHCP Snooping can block the offending messages.

Dynamic ARP Inspection (DAI)

DAI checks ARP traffic to help prevent false address-resolution information from being accepted on protected VLANs. It can reduce the risk of an attacker trying to redirect local traffic through an unauthorized device.

IP Source Guard

IP Source Guard restricts traffic according to configured or learned IP-to-MAC bindings, where supported and enabled. It can help prevent devices from using unauthorized IP addresses on protected interfaces.

Cisco lists DHCP Snooping, Dynamic ARP Inspection and IP Source Guard among its Layer 2 security features.

These features do not all do the same job. DHCP Snooping, DAI and IP Source Guard help protect against particular forms of traffic misuse; they are not substitutes for authenticating devices or controlling physical switch-port access.

Separate VLANs and Restrict Management Access

A company should not place every device in one unrestricted network segment.

Use VLANs to separate areas such as:

  • Employee computers
  • Guest devices
  • Servers and sensitive business systems
  • Network management interfaces
  • Voice and other specialised devices

Then apply suitable access-control rules between VLANs. This reduces the ability of an unauthorized device on one segment to reach systems on another.

The management interfaces of Cisco switches also need protection. Use a dedicated management network where possible, restrict access to approved administrator addresses, prefer SSH over Telnet, and apply appropriate authentication and access controls.

VLANs alone do not prevent an unauthorized switch from joining the same VLAN as an employee computer. Their value is in limiting what a device can reach after it connects.

Monitor Security Events and Check the Configuration

Security configurations need to be checked after they are deployed. A switch can be configured correctly on paper but fail to protect the network if the wrong port is selected, a setting is unsupported or legitimate devices are not accounted for.

Common Cisco IOS/IOS XE verification commands include:

show port-security interface GigabitEthernet1/0/10

show port-security address

show spanning-tree interface GigabitEthernet1/0/10 detail

show interfaces status

show logging

For an 802.1X-enabled switch, use the authentication-session commands supported by that particular software release.

These commands help an administrator review port-security settings, learned secure MAC addresses, spanning-tree status, interface state and system messages.

Look for unexpected MAC addresses, interfaces that have entered an error-disabled state, unexpected trunk ports, unusual network loops and repeated authentication failures.

A port that is shut down after a security violation should be investigated before it is returned to service. Do not simply re-enable it without checking what caused the event.

What Is the Best Cisco Switch Security Configuration for This Scenario?

The most suitable design depends on the switch model, software version, connected devices and whether the company can operate central authentication.

For an enterprise network, use 802.1X/NAC as an access-control foundation, supported by suitable BPDU Guard settings on edge ports, controlled trunking, unused-port shutdown and monitoring. Where 802.1X is not available, use supported port-security features and other appropriate controls, while recognising their limits.

Not sure which route fits you?

Tell us your stream and what you are hoping for, and we will tell you honestly which option suits.

Get course details

Practical Testing Checklist

After the security policy is configured, test it in a controlled lab or approved maintenance window not by connecting an unauthorized switch to a live production network.

Verify the following:

  • An approved computer can connect and access only the resources allowed by policy.
  • An unauthenticated test device cannot obtain normal network access on an 802.1X-controlled port.
  • An unexpected MAC address triggers the configured Port Security action on a test port where Port Security is used.
  • A BPDU received on a protected end-device port triggers BPDU Guard as expected.
  • Unused ports remain administratively disabled.
  • A user-facing port cannot negotiate into an unintended trunk.
  • A simulated rogue DHCP server is blocked on an untrusted port when DHCP Snooping is correctly configured.
  • Security violations appear in the switch logs or monitoring system, and the response procedure is understood.

     

Record the expected result for each test, compare it with the actual outcome and correct any differences before deploying the configuration more widely.

For learners who want hands-on practice with Cisco routing, switching and port configuration, CCNA Course in Tambaram is a relevant next learning resource.

Conclusion

Preventing unauthorized switches from accessing a company network requires more than one command. Network administrators should authenticate devices where possible, protect end-device ports with BPDU Guard, restrict MAC addresses when supported, prevent unintended trunking, disable unused ports and monitor security events.

The key is to use each control for the risk it is designed to address and verify that the complete configuration works with the actual Cisco switch model and software version.

To build practical knowledge of network attacks, access controls and defensive testing, explore Ethical Hacking Course in Tambaram.

Frequently asked questions

Which Cisco feature is best for preventing unauthorized switches?

There is no single feature that detects and blocks every unauthorized switch. 802.1X/NAC controls access through authentication, BPDU Guard protects suitable edge ports against unexpected BPDUs, and Port Security can limit the MAC addresses allowed on an interface. Use a combination that is supported by the switch platform.

BPDU Guard can shut down a protected port when it receives a BPDU. This helps stop a switch that participates in spanning tree from joining the network through an edge port. It is not a guarantee against every type of unauthorized device.

Yes. If the connected devices send traffic with more distinct MAC addresses than the port allows, the switch can register a violation and take the configured action. However, Port Security does not authenticate the physical switch itself, and administrators must choose the correct MAC limit for approved devices.

BPDU Guard is appropriate for suitable edge ports that connect to end devices and should not receive BPDUs. Authorized switch links and other ports that need spanning-tree communication require a different, carefully planned configuration.

A properly designed VLAN and access-control policy can restrict access to sensitive resources. However, VLAN assignment by itself does not stop an unauthorized switch from connecting, especially when it is attached to a port in the same VLAN as legitimate devices.

An active unused port can provide a physical connection to the network. Administratively shutting it down removes that unnecessary entry point until the port is required and approved.

DHCP Snooping is mainly designed to control DHCP messages and help block rogue DHCP servers. It can reduce risks from an unauthorized device, but it does not replace authentication, port-security policy or spanning-tree safeguards.

Review port-security status, secure MAC address entries, spanning-tree status, port state, authentication sessions and switch logs. Then perform controlled tests using approved test devices to verify that each configured control behaves as expected.

Ethical Hacking Course Quick Enquiry Form

Fill the Form Get Free Consultation From Industry Experts!

CCNA Quick Enquiry Form

Fill the Form Get Free Consultation From Industry Experts!

Quick Enquiry Form

Fill the Form Get Free Consultation From Industry Experts!