LABORATORY NOTEBOOK

Systems & Network Labs

Detailed technical laboratory logs including topology designs, configurations, problems solved, and operational takeaways.

LIVE CLI SIMULATOR // VM-NETOS-v2.6 // MULTI-VENDOR SHELL INTERACTIVE TERMINAL
[VM-NETOS v2.6.4 // MULTI-VENDOR LAB EMULATOR ONLINE]
Connected to virtual enterprise gateway. Press TAB to autocomplete commands, or type '?' after any keyword for context-sensitive help.
Type 'help' to inspect all commands, or click any quick-run chip.
Quick Commands:
VM-Gateway#
LAB // 001

Enterprise Multi-Area OSPF Topology

VERIFIED LAB

Objective: Design and configure a high-availability multi-area OSPF network with Area 0 (Backbone), Area 1 (HQ Core), and Area 2 (Branch), with inter-VLAN trunking and ABR route summarization to reduce link-state database (LSDB) size.

cisco-ios // abr-router-config.ios
! Configure Multi-Area OSPF on Area Border Router (ABR)
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Router(config-router)# network 10.0.0.0 0.0.0.3 area 0
Router(config-router)# network 192.168.10.0 0.0.0.255 area 1
Router(config-router)# area 1 range 192.168.0.0 255.255.0.0
Router(config-router)# passive-interface GigabitEthernet0/0
Router(config-router)# exit
Router# show ip ospf neighbor
Router# show ip route ospf
Problem Diagnosed:

Frequent SPF recalculations occurred whenever edge switch ports flapped, generating global Type-1 LSAs.

Resolution & Takeaway:

Configuring passive-interface on edge LANs and ABR route summarization contained LSAs within Area 1, stabilizing the backbone.

LAB // 002

Hardened Nginx Reverse Proxy & HTTP/2 Gateway

OPERATIONAL

Objective: Deploy a secure reverse proxy on Ubuntu Server to terminate TLS 1.3, enforce HTTP/2, sanitize proxy headers, and prevent unauthenticated direct exposure of backend services.

nginx // /etc/nginx/sites-available/production.conf
server {
    listen 443 ssl http2;
    server_name gautambhuwan.com.np;

    ssl_certificate /etc/ssl/certs/fullchain.pem;
    ssl_certificate_key /etc/ssl/private/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
Problem Diagnosed:

Client IP addresses were being masked by the reverse proxy, resulting in uniform upstream log entries.

Resolution & Takeaway:

Enforcing X-Real-IP and X-Forwarded-For headers allowed backend applications to correctly inspect client origin.

LAB // 003

Isolated Microservice Bridge Networks in Docker

VERIFIED LAB

Objective: Create isolated user-defined Docker bridge networks to restrict inter-container discovery and implement persistent storage volumes on Linux.

bash // docker-network-setup.sh
# Create isolated bridge network with custom subnet
docker network create --driver bridge --subnet 172.28.0.0/16 app_net

# Run isolated container connected only to the defined network
docker run -d --name secure_gateway   --network app_net   --ip 172.28.0.10   -v /var/data/app:/app/data:ro   -p 8080:80   nginx:alpine

# Verify bridge interface on host
ip addr show dev br-$(docker network inspect app_net -f '{{.Id}}' | cut -c1-12)
Problem Diagnosed:

Default bridge network does not provide automatic DNS resolution between container names.

Resolution & Takeaway:

User-defined bridge networks automatically enable built-in DNS service discovery while isolating container traffic.

LAB // 004

Enterprise Campus LAN: HSRP Gateway Redundancy & LACP EtherChannel

VERIFIED LAB

Objective: Deploy a high-availability dual-core campus network with Distribution Switch 1 & 2 (DSW1 & DSW2). Configure Hot Standby Router Protocol (HSRPv2) with interface tracking for seamless gateway failover, bundle multi-link trunks with LACP (802.3ad) EtherChannel, and align Rapid-PVST+ root bridge priority with HSRP active states.

cisco-ios // dsw1-core-redundancy.ios
! 1. Configure LACP EtherChannel Trunk between Distribution Switches
DSW1(config)# interface range GigabitEthernet0/1 - 2
DSW1(config-if-range)# channel-group 1 mode active
DSW1(config-if-range)# exit
DSW1(config)# interface Port-channel 1
DSW1(config-if)# switchport trunk encapsulation dot1q
DSW1(config-if)# switchport mode trunk
DSW1(config-if)# switchport trunk allowed vlan 10,20,99

! 2. Configure HSRPv2 with Priority, Preemption & Uplink Tracking
DSW1(config)# interface Vlan10
DSW1(config-if)# ip address 192.168.10.2 255.255.255.0
DSW1(config-if)# standby version 2
DSW1(config-if)# standby 10 ip 192.168.10.1
DSW1(config-if)# standby 10 priority 110
DSW1(config-if)# standby 10 preempt
DSW1(config-if)# standby 10 track GigabitEthernet0/0 20
DSW1(config-if)# exit

! 3. Align Spanning Tree Root with HSRP Active Node
DSW1(config)# spanning-tree mode rapid-pvst
DSW1(config)# spanning-tree vlan 10 root primary
DSW1(config)# spanning-tree portfast default
DSW1(config)# spanning-tree portfast bpduguard default
DSW1# show standby brief
DSW1# show etherchannel summary
Problem Diagnosed:

Uplink loss on primary DSW1 resulted in blackholed traffic because downstream access switches continued forwarding packets to DSW1 due to static default gateway pointers.

Resolution & Takeaway:

Configuring HSRP interface tracking (standby 10 track Gi0/0 20) with preemption immediately reduced DSW1's priority from 110 to 90, triggering seamless sub-second failover to standby DSW2.

LAB // 005

Route-Based Site-to-Site IPsec VTI VPN with Dynamic BGP

OPERATIONAL

Objective: Establish an encrypted route-based IPsec Virtual Tunnel Interface (VTI) between Corporate HQ (AS 65001) and Remote Branch (AS 65002) over an untrusted WAN. Configure hardened IKEv2 cryptographic suites, enable Dead Peer Detection (DPD), and establish dynamic eBGP routing for zero-touch subnet convergence.

cisco-ios // hq-vpn-vti-bgp.ios
! 1. Hardened IKEv2 Proposal & Keyring
crypto ikev2 proposal IKEV2-SEC-PROP
 encryption aes-gcm-256
 prf sha256
 group 19
crypto ikev2 policy IKEV2-POLICY
 proposal IKEV2-SEC-PROP
crypto ikev2 keyring BRANCH-KEYRING
 peer BRANCH-ROUTER
  address 203.0.113.2
  pre-shared-key SuperSecretVpnKey2026

! 2. IPsec Profile & Virtual Tunnel Interface (VTI)
crypto ipsec transform-set TS-GCM esp-gcm 256
 mode transport
crypto ipsec profile IPSEC-VTI-PROF
 set transform-set TS-GCM
 set ikev2-profile IKEV2-PROFILE

interface Tunnel0
 ip address 10.255.255.1 255.255.255.252
 ip mtu 1400
 ip tcp adjust-mss 1360
 tunnel source GigabitEthernet0/0
 tunnel destination 203.0.113.2
 tunnel mode ipsec ipv4
 tunnel protection ipsec profile IPSEC-VTI-PROF

! 3. Dynamic eBGP Peering across Encrypted Tunnel
router bgp 65001
 neighbor 10.255.255.2 remote-as 65002
 neighbor 10.255.255.2 timers 5 15
 address-family ipv4 unicast
  network 192.168.10.0 mask 255.255.255.0
  neighbor 10.255.255.2 activate
HQ-RTR# show crypto session detail
HQ-RTR# show ip bgp summary
Problem Diagnosed:

Legacy policy-based IPsec crypto maps required continuous manual ACL edits on both ends whenever new subnets were provisioned, and 1500-byte packets caused silent fragmentation packet drops.

Resolution & Takeaway:

Route-based VTI provides a clean virtual interface supporting multicast and dynamic BGP routing, while ip tcp adjust-mss 1360 completely resolved TCP window fragmentation drops.

LAB // 006

MikroTik Dual-WAN PCC Balancing with Recursive Failover & PCQ QoS

PRODUCTION CONFIG

Objective: Architect a redundant multi-homed edge gateway on MikroTik RouterOS. Implement Per-Connection Classifier (PCC) dual-WAN load balancing, target-scope recursive routing checks to detect upstream ISP backhaul blackouts, and Per-Connection Queue (PCQ) dynamic bandwidth shaping to eliminate bufferbloat.

routeros // edge-gateway-pcc-qos.rsc
# 1. Multi-Hop Recursive Route Failover via Public DNS
/ip route
add dst-address=1.1.1.1/32 gateway=192.168.1.1 scope=10 comment="Host-Route-ISP1"
add dst-address=8.8.8.8/32 gateway=192.168.2.1 scope=10 comment="Host-Route-ISP2"
add distance=1 gateway=1.1.1.1 check-gateway=ping target-scope=11 comment="Default-ISP1-Recursive"
add distance=2 gateway=8.8.8.8 check-gateway=ping target-scope=11 comment="Default-ISP2-Recursive"

# 2. Firewall Mangle Rules for PCC Load Balancing
/ip firewall mangle
add chain=prerouting dst-address-type=!local in-interface=bridge-lan \
    per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=bridge-lan \
    per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP2_conn passthrough=yes
add chain=prerouting in-interface=bridge-lan connection-mark=ISP1_conn action=mark-routing new-routing-mark=to_ISP1
add chain=prerouting in-interface=bridge-lan connection-mark=ISP2_conn action=mark-routing new-routing-mark=to_ISP2

# 3. Dynamic Bandwidth Fairness via PCQ (Per-Connection Queue)
/queue type
add name=pcq-download kind=pcq pcq-classifier=dst-address pcq-rate=30M
add name=pcq-upload kind=pcq pcq-classifier=src-address pcq-rate=15M
/queue tree
add name=Total-Download parent=bridge-lan queue=pcq-download priority=1
add name=Total-Upload parent=ether1-wan1 queue=pcq-upload priority=1
Problem Diagnosed:

Local ISP gateways remained link-UP during optical upstream fibre breaks, rendering standard default route metric failover useless. Heavy single-user downloads also choked real-time VoIP packets.

Resolution & Takeaway:

Recursive routing with target-scope=11 pings public Anycast DNS through respective gateways, triggering automated reroutes on genuine WAN loss, while PCQ queues dynamically enforce per-host bandwidth limits.

LAB // 007

Hierarchical IPv4/IPv6 VLSM Engine & IPAM Architecture

REFERENCE BLUEPRINT

Objective: Engineer an enterprise-grade hierarchical IP address allocation scheme for a multi-tier enterprise network from a single 172.16.0.0/23 supernet block (512 total addresses) and dual-stack 2001:db8:acad::/48 IPv6 global unicast assignment. Maximize host density via Variable Length Subnet Masking (VLSM), eliminate broadcast spillover, preserve address space for expansion, and maintain clean contiguous route summarization boundaries.

Segment / Role VLAN Hosts Req. Network ID Prefix / Mask Usable Host Range Broadcast Dual-Stack IPv6 (/64)
Engineering & Dev VLAN 10 110 172.16.0.0 /25 (255.255.255.128) 172.16.0.1 – 172.16.0.126 172.16.0.127 2001:db8:acad:10::/64
Corporate Operations VLAN 20 55 172.16.0.128 /26 (255.255.255.192) 172.16.0.129 – 172.16.0.190 172.16.0.191 2001:db8:acad:20::/64
Server Farm & DMZ VLAN 30 28 172.16.0.192 /27 (255.255.255.224) 172.16.0.193 – 172.16.0.222 172.16.0.223 2001:db8:acad:30::/64
VoIP & Unified Comms VLAN 40 26 172.16.0.224 /27 (255.255.255.224) 172.16.0.225 – 172.16.0.254 172.16.0.255 2001:db8:acad:40::/64
Guest Wi-Fi Isolation VLAN 50 120 172.16.1.0 /25 (255.255.255.128) 172.16.1.1 – 172.16.1.126 172.16.1.127 2001:db8:acad:50::/64
IT Out-of-Band Mgmt VLAN 99 12 172.16.1.128 /28 (255.255.255.240) 172.16.1.129 – 172.16.1.142 172.16.1.143 2001:db8:acad:99::/64
HQ-to-Branch WAN Link P2P WAN 2 172.16.1.240 /30 (255.255.255.252) 172.16.1.241 – 172.16.1.242 172.16.1.243 2001:db8:acad:fff0::/64
HQ-to-Cloud Interconnect P2P Cloud 2 172.16.1.244 /30 (255.255.255.252) 172.16.1.245 – 172.16.1.246 172.16.1.247 2001:db8:acad:fff1::/64
cisco-ios // core-router-vlsm-subinterfaces.ios
! Core Gateway 802.1Q Subinterface & Route Summarization Configuration
Core-RTR(config)# ipv6 unicast-routing

! Engineering Subinterface (VLAN 10)
Core-RTR(config)# interface GigabitEthernet0/0/0.10
Core-RTR(config-subif)# encapsulation dot1Q 10
Core-RTR(config-subif)# ip address 172.16.0.1 255.255.255.128
Core-RTR(config-subif)# ipv6 address 2001:db8:acad:10::1/64
Core-RTR(config-subif)# exit

! Guest Wi-Fi Subinterface (VLAN 50)
Core-RTR(config)# interface GigabitEthernet0/0/0.50
Core-RTR(config-subif)# encapsulation dot1Q 50
Core-RTR(config-subif)# ip address 172.16.1.1 255.255.255.128
Core-RTR(config-subif)# ipv6 address 2001:db8:acad:50::1/64
Core-RTR(config-subif)# exit

! Single Contiguous OSPF Route Summarization towards WAN Core
Core-RTR(config)# router ospf 1
Core-RTR(config-router)# area 1 range 172.16.0.0 255.255.254.0
Core-RTR(config-router)# exit
Core-RTR# show ip route summary
Problem Diagnosed:

Legacy flat /24 subnet assignments exhausted private address pools rapidly while incurring >85% host address waste on small P2P and server networks, and resulted in fragmented routing tables.

Resolution & Takeaway:

Structuring subnets in descending order of host requirements fit 6 distinct department VLANs plus WAN point-to-point transit circuits inside a single compact 172.16.0.0/23 block, allowing instantaneous upstream route summarization.

LAB // 008

Carrier GPON/EPON OLT Deployment & FTTH Provisioning

Huawei SmartAX ZTE C320 GPON / EPON QinQ (802.1ad)

Carrier-grade optical line terminal (OLT) commissioning and Fiber-to-the-Home (FTTH) service profiling. Configured Type 4 Dynamic Bandwidth Allocation (DBA) profiles, mapped Transmission Containers (T-CONTs) to GEM ports, bound service-ports with outer SVLAN and inner CVLAN QinQ tagging, and executed automated optical power diagnostics to maintain strict optical margin thresholds (-8 dBm to -27 dBm).

huawei-olt // ma5608t-ftth-service-provisioning.txt
! Huawei SmartAX MA5608T GPON Service Provisioning
MA5608T(config)# dba-profile add profile-id 15 profile-name "100M_BIZ" type4 max 102400
MA5608T(config)# ont-lineprofile gpon profile-id 20 profile-name "FTTH_INTERNET"
MA5608T(config-gpon-lineprofile-20)# tcont 1 dba-profile-id 15
MA5608T(config-gpon-lineprofile-20)# gem add 1 eth tcont 1
MA5608T(config-gpon-lineprofile-20)# gem mapping 1 0 vlan 100
MA5608T(config-gpon-lineprofile-20)# commit
MA5608T(config-gpon-lineprofile-20)# exit

! Define Service Profile for 4-port Gigabit Ethernet ONT
MA5608T(config)# ont-srvprofile gpon profile-id 20 profile-name "4GE_WIFI_ONT"
MA5608T(config-gpon-srvprofile-20)# ont-port eth 4
MA5608T(config-gpon-srvprofile-20)# port vlan eth 1 translation 100 user-vlan 100
MA5608T(config-gpon-srvprofile-20)# commit
MA5608T(config-gpon-srvprofile-20)# exit

! Auto-Discovery & Authorization on GPON Port 0/1/0
MA5608T(config)# interface gpon 0/1
MA5608T(config-if-gpon-0/1)# ont add 0 1 sn-auth "48575443B1A2C3D4" omci ont-lineprofile-id 20 ont-srvprofile-id 20 desc "CUST_FIBER_ENTERPRISE_01"
MA5608T(config-if-gpon-0/1)# exit

! QinQ Service Port Tagging (Outer S-VLAN 200, Inner C-VLAN 100)
MA5608T(config)# service-port 10 vlan 200 gpon 0/1/0 ont 1 gemport 1 multi-service user-vlan 100 tag-transform translate-and-add inner-vlan 100 inbound traffic-table index 6 outbound traffic-table index 6

! Diagnostic & Optical Power Budget Verification
MA5608T# display ont optical-info 0/1 0 1
! Output verifies Rx Optical Power: -19.45 dBm (Within -8 to -27 dBm standard margin)
Problem Diagnosed:

High upstream jitter and intermittent fiber packet loss due to mismatched DBA profile allocation and rogue ONT uncalibrated Tx power jamming the shared 1310nm upstream PON wavelength.

Resolution & Takeaway:

Standardized Type 4 dynamic bandwidth allocation with strict assured/max bursting boundaries, isolated rogue ONTs with automated optical transceiver shutdown, and implemented dual-tag QinQ to isolate customer Layer 2 broadcast domains.

LAB // 009

Metro Ethernet L2/L3 Switching Fabric (Cisco & Juniper EX)

Cisco Catalyst Juniper EX MSTP (802.1s) LACP (802.3ad) DHCP Snooping

Designed a carrier metro Ethernet and enterprise campus switching ring. Deployed Multiple Spanning Tree (MSTP IEEE 802.1s) across diverse vendor boundaries, bundled dual 10G uplinks with dynamic LACP, configured DHCP Snooping with Option 82 circuit-id insertion, and enabled Dynamic ARP Inspection (DAI) to prevent ARP spoofing and man-in-the-middle attacks.

cisco-catalyst // metro-access-switch-security.ios
! Cisco Catalyst 3850/9300 Metro Aggregation Hardening
Cat-SW01(config)# spanning-tree mode mst
Cat-SW01(config)# spanning-tree mst configuration
Cat-SW01(config-mst)# name METRO-RING-01
Cat-SW01(config-mst)# revision 1
Cat-SW01(config-mst)# instance 1 vlan 10, 20, 30
Cat-SW01(config-mst)# instance 2 vlan 100, 200, 300
Cat-SW01(config-mst)# exit
Cat-SW01(config)# spanning-tree mst 1 priority 4096

! 802.3ad LACP Uplink Port-Channel to Distribution Switch
Cat-SW01(config)# interface range TenGigabitEthernet1/1/1 - 2
Cat-SW01(config-if-range)# switchport mode trunk
Cat-SW01(config-if-range)# switchport trunk allowed vlan 10,20,30,100,200,300
Cat-SW01(config-if-range)# channel-group 1 mode active
Cat-SW01(config-if-range)# exit

! Layer 2 Boundary Security: DHCP Snooping, Option 82 & DAI
Cat-SW01(config)# ip dhcp snooping
Cat-SW01(config)# ip dhcp snooping vlan 10,20,30,100,200
Cat-SW01(config)# ip dhcp snooping information option
Cat-SW01(config)# interface Port-channel 1
Cat-SW01(config-if)# ip dhcp snooping trust
Cat-SW01(config-if)# ip arp inspection trust
Cat-SW01(config-if)# exit

! Edge Access Ports with DAI & Storm Control
Cat-SW01(config)# interface range GigabitEthernet1/0/1 - 24
Cat-SW01(config-if-range)# switchport mode access
Cat-SW01(config-if-range)# switchport port-security
Cat-SW01(config-if-range)# switchport port-security maximum 2
Cat-SW01(config-if-range)# switchport port-security violation restrict
Cat-SW01(config-if-range)# ip arp inspection limit rate 15
Cat-SW01(config-if-range)# storm-control broadcast level 1.00
Cat-SW01(config-if-range)# spanning-tree portfast
Cat-SW01(config-if-range)# spanning-tree bpduguard enable
Problem Diagnosed:

Rogue customer DHCP servers on access switches causing gateway hijacking, while vendor-specific Spanning Tree (PVST+) failed to converge cleanly with Juniper EX switches in the metro ring.

Resolution & Takeaway:

Standardized on vendor-neutral MSTP (802.1s) across all Cisco and Juniper nodes, locked untrusted access ports with DHCP Snooping + DAI, and bounded broadcast storms to <1% port bandwidth.

LAB // 010

Juniper Junos Core BGP Edge & RE Protection Firewall Filters

Juniper Junos MX204 / SRX345 eBGP Transit BGP Communities lo0.0 RE Filter

Hardened edge BGP border router configuration on Juniper MX204 and SRX345 platforms running Junos OS. Implemented multi-homed eBGP with dual upstream Tier-1 transit providers, applied BGP community tags for local-preference and MED manipulation, enforced route dampening on unstable peers, and applied a strict stateless packet filter to loopback interface lo0.0 to defend the Routing Engine (RE) against denial-of-service floods.

juniper-junos // border-bgp-and-re-defense.set
# Juniper Junos Hierarchical eBGP Peering & Loopback Defense
set protocols bgp group UPSTREAM-TRANSIT type external
set protocols bgp group UPSTREAM-TRANSIT peer-as 64500
set protocols bgp group UPSTREAM-TRANSIT neighbor 198.51.100.1 description "PRIMARY_TRANSIT_ISP_A"
set protocols bgp group UPSTREAM-TRANSIT neighbor 198.51.100.1 export BGP-EXPORT-POLICY
set protocols bgp group UPSTREAM-TRANSIT neighbor 198.51.100.1 import BGP-IMPORT-POLICY
set protocols bgp group UPSTREAM-TRANSIT neighbor 198.51.100.1 graceful-restart
set protocols bgp group UPSTREAM-TRANSIT neighbor 198.51.100.1 family inet unicast

# Routing Policies with Community Tagging & Local Preference
set policy-options policy-statement BGP-IMPORT-POLICY term PRIMARY-IN from community COMM-PREF-HIGH
set policy-options policy-statement BGP-IMPORT-POLICY term PRIMARY-IN then local-preference 200
set policy-options policy-statement BGP-IMPORT-POLICY term PRIMARY-IN then accept
set policy-options policy-statement BGP-EXPORT-POLICY term ADVERTISE-OUR-PREFIX from route-filter 203.0.113.0/24 exact
set policy-options policy-statement BGP-EXPORT-POLICY term ADVERTISE-OUR-PREFIX then accept
set policy-options policy-statement BGP-EXPORT-POLICY then reject

# Stateless Firewall Filter Protecting the Routing Engine (lo0.0)
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-BGP from source-prefix-list BGP-NEIGHBORS
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-BGP from protocol tcp
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-BGP from port bgp
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-BGP then accept

set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-NOC-SSH from source-prefix-list NOC-MGMT-SUBNET
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-NOC-SSH from protocol tcp
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-NOC-SSH from destination-port 22
set firewall family inet filter PROTECT-ROUTING-ENGINE term ALLOW-NOC-SSH then accept

set firewall family inet filter PROTECT-ROUTING-ENGINE term RATE-LIMIT-ICMP from protocol icmp
set firewall family inet filter PROTECT-ROUTING-ENGINE term RATE-LIMIT-ICMP then policer ICMP-100K-POLICER
set firewall family inet filter PROTECT-ROUTING-ENGINE term RATE-LIMIT-ICMP then accept

set firewall family inet filter PROTECT-ROUTING-ENGINE term DEFAULT-DISCARD-LOG then count RE-ATTACK-DROPS
set firewall family inet filter PROTECT-ROUTING-ENGINE term DEFAULT-DISCARD-LOG then discard

# Apply Filter to Loopback 0 Unit 0
set interfaces lo0 unit 0 family inet filter input PROTECT-ROUTING-ENGINE
commit confirmed 5
Problem Diagnosed:

Unprotected Routing Engine CPU spikes (100% utilization) caused by external port scans and ICMP flood attacks directed at border router interface addresses, leading to BGP keepalive timeouts and session flapping.

Resolution & Takeaway:

Binding a stateless firewall filter to lo0.0 filtered all traffic hitting the Routing Engine at hardware line rate, restricting BGP to verified peers and rate-limiting ICMP to prevent control-plane exhaustion.

LAB // 011

Next-Gen Firewall (FortiGate & pfSense HA) & Deterministic CGNAT

Fortinet FortiGate pfSense HA CGNAT (RFC 6598) CARP Failover IPsec IKEv2

Enterprise edge firewall cluster and large-scale subscriber address translation deployment. Built an active-passive High Availability (HA) firewall pair running Fortinet FortiOS and pfSense Plus CARP synchronization. Configured Carrier-Grade NAT (RFC 6598 shared address space 100.64.0.0/10) with deterministic port block allocations of 2,000 ports per client to comply with ISP regulatory logging, coupled with policy-based routing (PBR) and hardware-accelerated IPsec IKEv2 tunnels.

fortigate // cgnat-and-zone-firewall-ha.conf
! FortiGate Carrier-Grade NAT & Zone Firewall Policy
config firewall ippool
    edit "CGNAT_SUBSCRIBER_POOL"
        set type cgn-resource-allocation
        set startip 198.51.100.10
        set endip 198.51.100.20
        set arp-reply enable
        set cpa-port-block-size 2000
        set cpa-max-port-blocks 2
    next
end

! Define Security Zones for Micro-Segmentation
config system zone
    edit "ZONE_SUBSCRIBER_LAN"
        set interface "vlan100" "vlan200" "vlan300"
    next
    edit "ZONE_WAN_UPSTREAMS"
        set interface "port1" "port2"
    next
end

! Carrier-Grade NAT Policy with Deep Inspection & Session Limits
config firewall policy
    edit 101
        set name "SUBSCRIBER_TO_INTERNET_CGNAT"
        set srcintf "ZONE_SUBSCRIBER_LAN"
        set dstintf "ZONE_WAN_UPSTREAMS"
        set srcaddr "SUBSCRIBER_CGNAT_BLOCK_100.64.0.0_10"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
        set nat enable
        set ippool enable
        set poolname "CGNAT_SUBSCRIBER_POOL"
        set tcp-mss-sender 1400
        set tcp-mss-receiver 1400
        set logtraffic all
    next
end

! High Availability Heartbeat & Session Sync
config system ha
    set group-name "NOC_CORE_FW_HA"
    set mode a-p
    set hbdev "port7" 50 "port8" 50
    set session-pickup enable
    set override disable
    set priority 200
end
Problem Diagnosed:

Public IPv4 pool exhaustion across growing broadband subscribers, combined with massive centralized syslog storage bottlenecks caused by logging every individual NAT connection translation.

Resolution & Takeaway:

Implemented Deterministic CGNAT (RFC 6598) mapping fixed private IPs to predictable public IP + port block ranges (2,000 ports/subscriber), eliminating 99% of per-session log overhead while securing subscriber traffic behind stateful zone firewalls.

LAB // 012 ENTERPRISE SD-WAN
FORTINET / CISCO // MULTI-SITE HUBS

Enterprise Multi-Site SD-WAN Hub-and-Spoke Topology

Engineered multi-branch SD-WAN architecture interconnecting corporate headquarters, school campuses, and municipal government ward offices. Configured dual-ISP active-active uplinks with continuous SLA health probing (latency, jitter, packet loss), sub-second failover, and quality-of-service (QoS) traffic prioritization for real-time applications.

TOPOLOGY BLUEPRINT // MULTI-SITE SD-WAN OVERLAY
+-----------------------------------------------------------------------------------+
|               CENTRAL HQ / MUNICIPAL CITY HALL DATA CENTER (HUB-01)               |
|            Dual WAN: WAN-1 (Fiber Leased Line) + WAN-2 (Metro Broadband)          |
|                   Fortinet / Cisco Secure SD-WAN Controller                       |
+-----------------------------------------------------------------------------------+
                  |                                     |
    [SD-WAN IPsec Overlay Tunnel A]       [SD-WAN IPsec Overlay Tunnel B]
    Dynamic SLA: Loss < 1%, Jitter < 15ms  Dynamic SLA: Loss < 1%, Jitter < 15ms
                  |                                     |
                  v                                     v
+-----------------------------------+ +-----------------------------------+
|     SPOKE 1: SCHOOL / CAMPUS      | |   SPOKE 2: MUNICIPAL WARD OFFICE  |
| - Admin & Student Labs LAN        | | - Citizen Service Kiosks LAN      |
| - Dual-ISP Auto-Steering          | | - e-Governance Encrypted VPN      |
| - VoIP & LMS Traffic Prioritized  | | - Real-Time Biometric Sync        |
+-----------------------------------+ +-----------------------------------+
CLI CONFIGURATION // FORTINET & CISCO SD-WAN SPECIFICATION
! --- FortiOS SD-WAN Zone & Performance SLA Configuration ---
config system sdwan
    set status enable
    config zone
        edit "SDWAN_INTERNET_ZONE"
        next
        edit "SDWAN_CORPORATE_OVERLAY"
        next
    end
    config members
        edit 1
            set interface "wan1"
            set zone "SDWAN_INTERNET_ZONE"
            set gateway 198.51.100.1
        next
        edit 2
            set interface "wan2"
            set zone "SDWAN_INTERNET_ZONE"
            set gateway 203.0.113.1
            set cost 10
        next
        edit 3
            set interface "vpn_hub_tun1"
            set zone "SDWAN_CORPORATE_OVERLAY"
        next
        edit 4
            set interface "vpn_hub_tun2"
            set zone "SDWAN_CORPORATE_OVERLAY"
            set cost 5
        next
    end
    config health-check
        edit "SLA_VOIP_AND_CRITICAL_ERP"
            set server "10.100.0.1" "8.8.8.8"
            set interval 500
            set probe-timeout 300
            set recoverytime 5
            config sla
                edit 1
                    set latency-threshold 50
                    set jitter-threshold 15
                    set packetloss-threshold 1
                next
            end
            set members 3 4
        next
    end
    config service
        edit 1
            set name "STEER_VOIP_ERP_TO_BEST_SLA"
            set mode priority
            config sla
                edit "SLA_VOIP_AND_CRITICAL_ERP"
                    set id 1
                next
            end
            set priority-members 3 4
            set dst "CORPORATE_HQ_SUBNETS"
            set service "SIP" "HTTPS" "CUSTOM_ERP"
        next
    end
end
Problem Diagnosed:

Branch school campuses and remote municipal ward offices experienced frequent packet loss and dropped VoIP / video conference calls during ISP brownouts on single broadband lines.

Resolution & Takeaway:

Deployed an automated SD-WAN overlay with real-time SLA health checks across dual uplinks, achieving seamless sub-second traffic re-steering to healthy paths with zero active call drops or data corruption.

LAB // 013 ZERO-TRUST ISOLATION
CISCO / JUNIPER // CAMPUS & MUNICIPAL LAN

Campus LAN Micro-Segmentation & Zero-Trust Network Isolation

Engineered strict internal network isolation across multi-floor corporate headquarters, educational institutions (schools & colleges), and municipal city offices. Utilized VRF-Lite Layer 3 routing domains, Private VLANs (PVLANs) to prevent lateral malware propagation, and stateful inter-VLAN firewall inspection.

TOPOLOGY BLUEPRINT // VRF-LITE & PRIVATE VLAN SEGMENTATION
+-----------------------------------------------------------------------------------+
|             CAMPUS DISTRIBUTION CORE SWITCH (CISCO CATALYST / JUNIPER EX)        |
|  VRF_ADMINISTRATION  |  VRF_ACADEMIC_LABS  |  VRF_MUNICIPAL_EGOV  |  VRF_SURVEILLANCE |
+-----------------------------------------------------------------------------------+
           |                        |                       |               |
           v                        v                       v               v
  [VLAN 10: Admin Staff]   [VLAN 20: PVLAN Labs]   [VLAN 30: eGov Data]   [VLAN 40: CCTV]
  - Community Ports:       - Isolated Ports:       - Non-routable to Net  - Dedicated DMZ
    Staff inter-talk         Host-to-host BLOCKED  - Database Vault       - NVR Storage
  - 802.1X NAC Authenticated - Promiscuous Uplink to Gateway Only         - Zero Internet
CLI CONFIGURATION // CISCO CATALYST & JUNIPER VRF / PVLAN
! --- Cisco Catalyst Switch: VRF-Lite & Private VLAN Definition ---
ip vrf VRF_ADMIN
 rd 65000:10
!
ip vrf VRF_ACADEMIC_LABS
 rd 65000:20
!
ip vrf VRF_MUNICIPAL_EGOV
 rd 65000:30
!
! --- Private VLAN Configuration (Blocking Lateral Host Movement) ---
vlan 201
 name LAB_STUDENT_ISOLATED
 private-vlan isolated
!
vlan 202
 name LAB_FACULTY_COMMUNITY
 private-vlan community
!
vlan 200
 name LAB_PRIMARY_VLAN
 private-vlan primary
 private-vlan association 201,202
!
! --- Access Port Configuration: Student Lab (Completely Isolated) ---
interface range GigabitEthernet1/0/1 - 24
 description STUDENT_COMPUTER_LAB_ISOLATED_PORTS
 switchport mode private-vlan host
 switchport private-vlan host-association 200 201
 switchport port-security
 switchport port-security maximum 2
 switchport port-security violation restrict
 spanning-tree portfast
 spanning-tree bpduguard enable
!
! --- Promiscuous Uplink to Core Gateway / Firewall ---
interface GigabitEthernet1/0/48
 description PROMISCUOUS_UPLINK_TO_FIREWALL_GATEWAY
 switchport mode private-vlan promiscuous
 switchport private-vlan mapping 200 201,202
!
! --- Layer 3 SVI within VRF ---
interface Vlan200
 description DEFAULT_GATEWAY_ACADEMIC_LABS
 ip vrf forwarding VRF_ACADEMIC_LABS
 ip address 10.20.0.1 255.255.255.0
 private-vlan mapping 201,202
 no shutdown
Problem Diagnosed:

In legacy flat network setups, infected student laptops or compromised municipal service kiosk endpoints could laterally scan, sniff, and attack internal administrative accounting servers and CCTV cameras.

Resolution & Takeaway:

Enforced Private VLAN (PVLAN) isolated ports and Layer 3 VRF-Lite segregation. Host-to-host lateral traffic within the same subnet is blocked in switch ASIC hardware, securing critical assets with zero performance penalty.

CASE STUDY REFERENCE // REAL-WORLD CAMPUS REDESIGN Explore Before & After Transformation Case Study →