Skip to main content
Back to projects

Enterprise Campus Network Design, Automation & Telemetry

A fault-tolerant 3-tier campus network interconnecting four university engineering departments with HSRP load-sharing, declarative Ansible switch automation, idempotent Python router orchestration, and full-estate Zabbix telemetry.

Verified results and performance

11 / 11Managed Devices2 core/edge routers and 9 L2/L3 switches across 3 tiers
0Configuration DriftAnsible --check verified idempotency across all switches
100%Security Policy Pass16 of 16 matrix cells verified by independent ACL hit counters
4Telemetry TriggersLive Zabbix alerts including hidden HSRP core failover detection

Project details

Role
Network & Automation Engineer (Joint Engineering Project)
Timeline
2024 to 2025
Tracks
networking, devops, software

Technologies and skills

PythonCisco IOSGitGNS3
Zabbix visual network topology host map displaying real-time link health indicators and monitored campus devices
Zabbix visual network topology host map displaying real-time link health indicators and monitored campus devices
Slide 1 of 10The Spark: Why I Built This
Section 01

The Spark: Why I Built This

1 of 10

Enterprise campus networks in academic institutions face three persistent engineering headaches: fragile single-chassis core switches that create campus-wide blackouts when rebooted, manual command-line configuration changes that cause insidious configuration drift over time, and flat Layer 2 networks that lack granular department security boundaries.

"A campus network cannot rely on manual terminal sessions where every engineer types slightly different commands. Configuration must be codified as version-controlled data, and failover must be verified under simulated stress before production deployment."

Traditional university networking labs frequently configure switches manually and leave them unmonitored until users complain about broken default gateways. I wanted to design an enterprise-grade campus infrastructure from first principles: full dual-core hardware redundancy, strict micro-segmented department access control lists, declarative infrastructure as code, and continuous SNMP telemetry that alerts operators the moment a redundant link fails.

Zabbix visual network topology host map
Zabbix visual network topology host map displaying real-time link health indicators and monitored campus devices.
Scroll down or tap to advance
Section 02

Platform Architecture and Big Picture

2 of 10

The network interconnects four academic departments: Electrical and Information Engineering (DEIE), Civil and Environmental Engineering (DCEE), Mechanical and Manufacturing Engineering (DMME), and Interdisciplinary Studies (DIS). The infrastructure follows Cisco's proven three-layer hierarchical design across 11 network devices:

  • Core Layer: Redundant Cisco IOSvL2 multilayer switches (SW-CORE-1, SW-CORE-2) running Hot Standby Router Protocol (HSRP) and rapid Spanning Tree.
  • Distribution Layer: Dedicated department distribution switches (SW-D-DEIE, SW-D-DCEE, SW-D-DMME, SW-D-DIS) terminating department uplinks and enforcing 802.1Q trunk pruning.
  • Access Layer: Edge switches connecting departmental student workstations, servers, and dedicated management hosts.
  • Routing & WAN Edge: Cisco IOSv routers (R-CORE, R-EDGE) running single-area OSPF (Area 0) and Port Address Translation (NAT Overload) providing regulated internet connectivity for authorized departments.

Addressing is structured within private subnet space 10.0.0.0/8. Each department receives a dedicated /24 prefix (10.10.10.0/24 through 10.10.40.0/24), while an isolated out-of-band management VLAN (VLAN 99: 10.99.99.0/24) isolates network device management from regular student traffic.

Campus network topology diagram
GNS3 port map and build sheet
Three-tier hierarchical campus network topology diagram and physical interface build sheet.
Scroll down or tap to advance
Section 03

Active-Active Core Gateway Redundancy

3 of 10

To ensure high availability without wasting hardware capital, the redundant core pair runs HSRP with alternating active roles rather than an active-passive topology:

VLANNameSW-CORE-1 SVISW-CORE-2 SVIHSRP Virtual IPActive CoreStandby Core
VLAN 10DEIE10.10.10.210.10.10.310.10.10.1SW-CORE-1 (Pri 110)SW-CORE-2 (Pri 100)
VLAN 20DCEE10.10.20.210.10.20.310.10.20.1SW-CORE-1 (Pri 110)SW-CORE-2 (Pri 100)
VLAN 30DMME10.10.30.210.10.30.310.10.30.1SW-CORE-2 (Pri 110)SW-CORE-1 (Pri 100)
VLAN 40DIS10.10.40.210.10.40.310.10.40.1SW-CORE-2 (Pri 110)SW-CORE-1 (Pri 100)
VLAN 99MGMT10.99.99.210.99.99.310.99.99.1SW-CORE-1 (Pri 110)SW-CORE-2 (Pri 100)

Preemption is enabled across all groups. Spanning Tree root priorities are strictly aligned with HSRP gateway priorities (SW-CORE-1 is primary root for VLANs 10, 20, 99; SW-CORE-2 is primary root for VLANs 30, 40). This alignment guarantees that Layer 2 switch forwarding paths match the Layer 3 default gateway, eliminating inefficient cross-core transit traffic during normal operations.

GNS3 topology build sheet
Hierarchical campus network topology
HSRP gateway allocation and Layer 2 spanning tree topology.
Scroll down or tap to advance
Section 04

Security Architecture and Access Control

4 of 10

Campus departments require strict traffic isolation. The security policy mandates an explicit default-deny stance, implemented via five named extended access lists applied inbound on the department Switch Virtual Interfaces (SVIs) on both core switches:

Because Cisco IOS access lists are stateless, replies from permitted server sessions would be dropped without explicit return path rules. The policy explicitly engineers return rules on the DIS SVI (ACL_DIS_IN). Reachability was validated across a complete 4x4 inter-department matrix from physical workstation hosts, and verified via IOS hardware ACL hit counters.

Code12 lines
Source       Destination  Policy Action  Engineering Rationale
------------------------------------------------------------------------------------
VLAN_DEIE    VLAN_DIS     Permit All     Engineering workstations access IT servers
VLAN_DCEE    VLAN_DIS     Permit HTTP(S) Web portal access only (Ports 80 & 443)
VLAN_DMME    VLAN_DIS     Deny All       Explicit isolation per security policy
VLAN_DCEE    VLAN_DEIE    Deny All       Inter-department student isolation
VLAN_DMME    VLAN_DCEE    Deny All       Inter-department student isolation
VLAN_DIS     VLAN_DEIE    Permit All     Stateless return path for established flows
VLAN_DIS     VLAN_DCEE    Permit HTTP(S) Stateless return path for web server replies
VM-ZABBIX    All Devices  Permit SNMP    Monitoring telemetry polling (UDP 161)
MGMT VLAN    All Devices  Permit SSH     Secure administrative access (TCP 22)
Any          Any          Deny           Implicit drop at conclusion of every ACL
Inter-department ping reachability matrix
Core switch ACL hit counters
Reachability matrix validation across departmental workstations and ACL match counters.
Scroll down or tap to advance
Section 05

Procedural Router Automation with Python and Netmiko

5 of 10

The core and edge routers (R-CORE, R-EDGE) are unique procedural devices that must be bootstrap-capable from bare metal. To manage them without third-party agent overhead, I built a custom Python automation engine utilizing Netmiko.

The critical architectural decision was separating intended state (YAML data) from execution code:

The script features timing-based reading (send_command_timing) to survive emulated control-plane latency, retries empty section responses to avoid mistaking a slow response for a missing interface, and writes timestamped logs for automated change auditing.

Python26 lines
# netmiko/configure_routers.py - Idempotency Comparison Logic
def line_is_present(line: str, current: list[str]) -> bool:
    """
    Handle IOS negation semantics. A 'no shutdown' command is satisfied
    when 'shutdown' is absent from the running-config, because IOS never
    writes 'no shutdown' explicitly into the NVRAM text representation.
    """
    if line.startswith("no "):
        command_target = line[3:].strip()
        return command_target not in current
    return line in current

def apply_section(connection, section: dict, read_timeout: int = 120) -> bool:
    """
    Push full configuration blocks atomically. Sending individual lines
    without context (e.g. 'ip address' without 'interface') lands commands
    in the wrong sub-mode or triggers syntax rejection.
    """
    connection.send_config_set(
        section["lines"],
        read_timeout=read_timeout,
        cmd_verify=False,
        exit_config_mode=False,
    )
    run_command(connection, "end", read_timeout)
    return True
Netmiko router configuration run
Netmiko executing idempotent router configuration pushes and verifying zero drift.
Scroll down or tap to advance
Section 06

Declarative Switch Orchestration with Ansible

6 of 10

While the routers required procedural bootstrap logic, the nine campus switches share near-identical structural patterns: VLAN databases, 802.1Q trunks, access port assignments, and STP priorities. For the switch estate, I engineered an Ansible automation project using the cisco.ios collection across five modular roles:

  • roles/vlans: Configures VLAN 10, 20, 30, 40, 99, 100 with explicit un-shutdown attributes.
  • roles/trunking: Establishes 802.1Q encapsulation, sets native VLAN 100, and prunes unused department VLANs.
  • roles/access_ports: Assigns host interfaces, disables DTP negotiations, and enables PortFast Edge.
  • roles/stp: Enforces deterministic PVST+ root priorities aligned with HSRP gateways.
  • roles/management: Injects default management gateway routes (ip route 0.0.0.0 0.0.0.0 10.99.99.1).

Concurrency is tuned to forks = 2 in ansible.cfg. Emulated Cisco switch CPU threads fail authentication when bombarded with five simultaneous SSH handshakes. Running with serial batches of two ensures 100% login reliability.

Yaml17 lines
# ansible/site.yml - Multi-Role Orchestration Playbook
---
- name: Orchestrate Department Campus Switch Estate
  hosts: core_switches:distribution_switches:access_switches
  gather_facts: false
  serial: 2
  roles:
    - role: vlans
    - role: trunking
    - role: access_ports
    - role: stp

- name: Configure Out-of-Band Management Routing
  hosts: distribution_switches:access_switches
  gather_facts: false
  roles:
    - role: management
Ansible switch playbook execution
Ansible rollback execution
Ansible playbook execution across the switch estate reporting zero changes in check mode.
Scroll down or tap to advance
Section 07

Idempotency Traps: What the Tools Did Not Tell Us

7 of 10

Building automated network pipelines exposed three major idempotency traps where standard configuration syntax produced subtle production failures:

  • The Locally Shut VLAN Trap (act/lshut): During switch rollbacks, recreating a VLAN without an explicit state left it administratively shut down in the VLAN database. Ansible --check reported 0 changes and green status because every line it managed matched running-config. Yet hosts could not reach their gateway! The lesson: Checking compares declared intent against reality, but remains blind to whatever the intent omitted.
  • The PortFast Edge Syntax Drift: Cisco IOS 15.2(4)E accepts spanning-tree portfast but stores it internally as spanning-tree portfast edge. If playbooks declare the legacy command, the task reports changed=true on every single execution. The fix was parameterizing the syntax in role defaults.
  • The Inactive Default Gateway: Switches in VLAN 99 configured with ip default-gateway could not reply to SNMP queries from the Zabbix server in VLAN 40. On Cisco IOSvL2, ip routing is enabled invisibly by default, causing ip default-gateway to be silently ignored. An explicit static route (ip route 0.0.0.0 0.0.0.0 10.99.99.1) was required.
Trap EncounteredSymptomsRoot CauseEngineering Solution
VLAN act/lshutZero ping reachability despite green --checkMissing shutdown: disabled in VLAN mergeMapped explicit shutdown disabled state to all VLANs
PortFast syntax driftEndless changed task reportsIOS stores portfast edge variantCodified exact stored command in role defaults
Silent gateway dropZabbix telemetry dropped on L2 switchesip default-gateway inactive when routing onConfigured explicit management static default route
Scroll down or tap to advance
Section 08

Zero-Outage Rollback Strategy

8 of 10

Most automation tutorials demonstrate destructive rollbacks: erasing startup-config and reloading the chassis. In an enterprise network, wiping a switch destroys the management VLAN SVI, SSH authentication keys, and trunk uplinks, isolating the switch completely and requiring emergency physical console access.

To prevent this, I engineered a dedicated rollback playbook (ansible/playbooks/rollback/rollback.yml):

The rollback playbook enforces a mandatory --limit flag, protects critical automation uplinks (such as SW-A-DIS Gi2/1 connecting the automation host), removes only automated department VLANs, and preserves the out-of-band management channel so immediate re-provisioning can take place.

Yaml24 lines
# ansible/playbooks/rollback/rollback.yml - Safe Rollback Assertion
- name: Emergency Switch State Rollback
  hosts: all
  gather_facts: false
  tasks:
    - name: Assert explicit single-switch limit flag
      ansible.builtin.assert:
        that:
          - ansible_limit is defined
        fail_msg: "FATAL: Rollback requires explicit --limit to prevent campus-wide outage"

    - name: Restore baseline access interface configuration
      cisco.ios.ios_interfaces:
        config: "{{ rollback_interfaces }}"
        state: overridden

    - name: Purge non-baseline department VLANs
      cisco.ios.ios_vlans:
        config:
          - vlan_id: 99
            name: MGMT
          - vlan_id: 100
            name: NATIVE
        state: overridden
Ansible rollback execution
Automated rollback restoring baseline access port state without dropping management connectivity.
Scroll down or tap to advance
Section 09

Continuous Telemetry with Zabbix 6.0 LTS

9 of 10

Deploying a resilient architecture is only half the battle: operators must be immediately alerted when redundant components fail before both nodes go down. The entire 11-device network was brought under continuous monitoring using Zabbix 6.0 LTS over SNMPv2c.

SNMP community strings and host ACL exceptions were pushed to every router and switch via automated Netmiko and Ansible tasks. Four custom triggers were engineered:

  • Router/Switch Availability Probe: ICMP and SNMP responsiveness polling every 30 seconds.
  • CPU Threshold Trigger: Catches control-plane CPU spikes over 80% on core routers.
  • Interface Flap Alert: Detects rapid link status changes on inter-core 802.1Q trunks.
  • Core Redundancy Failover Detection: Alerts operators if a core switch loses HSRP active state, detecting a silent single-point failure before the backup core also experiences distress.

The Zabbix environment was validated by intentionally disabling core switch interfaces and observing the triggers fire instantly on the dashboard. Dashboards and host maps were fully codified and exported to JSON for version-controlled disaster recovery.

Zabbix network monitoring dashboard
Zabbix 11-device SNMP host inventory
Zabbix visual topology map
Zabbix dual-core failover trigger firing
Zabbix 6.0 LTS live monitoring dashboard, SNMP host inventory, topology map, and triggered alert view.
Scroll down or tap to advance
Section 10

Key Lessons and Engineering Insights

10 of 10
  1. Redundancy Introduces State-Consistency Hazards: Adding a second core switch eliminates hardware single points of failure, but introduces insidious split-brain and synchronization risks. If an access list or VLAN database differs between SW-CORE-1 and SW-CORE-2, traffic behaves unpredictably depending on which HSRP gateway forwards the packet. Automated declarative tooling is not a luxury; it is the only way redundant cores remain safe.

  2. Idempotency Must Be Hand-Engineered for Procedural Devices: Netmiko has no native awareness of state. Achieving idempotent router configurations required line-by-line comparison logic, regex parsing, and timing-based command delivery to distinguish between slow responses and missing commands.

  1. Treat Network Intent as Version-Controlled Data: Hardcoding IPs or interface lists in automation scripts destroys maintainability. By isolating device parameters into YAML inventories and Jinja2 templates, updating a department subnet requires editing a single line in a data file.

  2. Zero-Touch Rollback Must Protect the Management Plane: A rollback routine that removes management interfaces or trunk ports turns a software roll-back into a physical maintenance outage. Safe automation always protects out-of-band access channels.

Discuss this project

Have questions about the architecture or design decisions?

Contact Dineth

Dineth Anjitha

Computer engineering graduate

University of Ruhuna, Sri Lanka

© 2026 Dineth Anjitha

First-party analytics only. No third-party trackers.