{
  "id": "ccna-devops-scope",
  "title": "CCNA trong phạm vi DevOps / SRE / Cloud",
  "version": "1.0.0",
  "updated": "2026-10-29",
  "intent": "Gom kiến thức CCNA còn dùng khi vận hành cloud, Kubernetes và hybrid: địa chỉ, routing, NAT, ACL, chẩn đoán, incident mẫu. Không thay khóa thi CCNA đủ chương.",
  "whatThisIsNot": [
    "Không phải giáo trình thi CCNA 200-301 (switching/STP lab, wireless, full OSPF config…)",
    "Không lab Cisco IOS — dùng Linux, cloud portal, kubectl"
  ],
  "workflow": {
    "design": "Trước deploy: CIDR, gateway, DNS, bảng dải không trùng.",
    "path": "Route, VPN/BGP, NAT, LB/Ingress — packet đi đúng cửa.",
    "debug": "Một lệnh một tầng: dig, ping/traceroute, nc, curl.",
    "harden": "NSG/NACL/NetworkPolicy — mở đủ, không any-any."
  },
  "memoryHooks": [
    {
      "id": "layer-first",
      "cue": "symptom + one test",
      "text": "DNS ok + TCP timeout → nghi firewall/ACL/Security Group, không đổi DNS trước."
    },
    {
      "id": "longest-prefix",
      "cue": "two routes same dest",
      "text": "Route dài hơn (prefix dài hơn) thắng — giống UDR cụ thể hơn system route trên cloud."
    },
    {
      "id": "default-gateway",
      "cue": "host off-subnet",
      "text": "Ra khỏi subnet của mình → packet tới MAC của default gateway, không tới IP đích trực tiếp trên LAN."
    },
    {
      "id": "nat-direction",
      "cue": "who initiates",
      "text": "SNAT đổi source khi đi ra; DNAT đổi destination khi vào — K8s Service kube-proxy/NAT tương tự ý DNAT tới Pod."
    },
    {
      "id": "acl-order",
      "cue": "first match",
      "text": "ACL/stateful rule: dòng khớp đầu tiên quyết định — explicit deny cuối, không rely implicit."
    }
  ],
  "topicsForDevOps": [
    {
      "id": "osi-to-ops",
      "title": "OSI / TCP-IP là khung chẩn đoán",
      "ccnaScope": ["Layer 2–4 mapping", "Encapsulation"],
      "devopsUse": ["Phân tách lỗi DNS vs TLS vs HTTP trong incident", "Đọc curl -v và ss cùng một timeline"],
      "skipForOps": ["Thuộc lòng tên tầng 5–6 cho thi"],
      "roadmapLessonId": "ccna-osi-layers",
      "relatedDevopsTrack": "networking"
    },
    {
      "id": "ipv4-subnet-cidr",
      "title": "IPv4, subnet mask, CIDR",
      "ccnaScope": ["Network/host bits", "VLSM", "Private RFC1918"],
      "devopsUse": ["Thiết kế VPC/VNet + subnet cho node, pod, DB", "Tránh overlap khi peering/VPN"],
      "commands": ["ip route", "ip -4 addr", "Azure: effective routes", "AWS: route table"],
      "roadmapLessonId": "ccna-ip-subnet",
      "relatedDevopsTrack": "networking"
    },
    {
      "id": "arp-gateway",
      "title": "ARP và default gateway",
      "ccnaScope": ["Same subnet vs remote", "Proxy ARP (biết tên)"],
      "devopsUse": ["Hiểu vì sao ping gateway fail = mọi outbound LAN fail", "Bridge/CNI và MAC trên node"],
      "roadmapLessonId": "ccna-routing-gateway",
      "relatedDevopsTrack": "networking"
    },
    {
      "id": "routing-table",
      "title": "Routing table, static route, default route",
      "ccnaScope": ["Administrative distance (khái niệm)", "Longest prefix match"],
      "devopsUse": ["UDR trên Azure", "Custom route on-prem qua VPN", "0.0.0.0/0 qua NAT GW hoặc IGW"],
      "roadmapLessonId": "ccna-routing-gateway",
      "relatedDevopsTrack": "cloud"
    },
    {
      "id": "dynamic-routing-lite",
      "title": "OSPF / BGP (mức vận hành)",
      "ccnaScope": ["Distance vector vs link state (ý)", "BGP path selection (ý)"],
      "devopsUse": ["Hybrid: ExpressRoute + BGP", "Anomaly: route leak, missing advertise"],
      "skipForOps": ["Cấu hình OSPF area trên router Cisco"],
      "roadmapLessonId": "ccna-hybrid-routing",
      "relatedDevopsTrack": "cloud"
    },
    {
      "id": "nat-pat",
      "title": "NAT / PAT (overload)",
      "ccnaScope": ["Inside/outside", "Static NAT"],
      "devopsUse": ["Egress SNAT pool cạn", "Azure NAT Gateway", "DNAT qua LB/Ingress"],
      "roadmapLessonId": "ccna-nat-snat",
      "relatedDevopsTrack": "kubernetes"
    },
    {
      "id": "vlan-segmentation",
      "title": "VLAN & segmentation",
      "ccnaScope": ["802.1Q tag", "Inter-VLAN routing (ý)"],
      "devopsUse": ["Subnet = segment logic trên cloud", "NSG/NACL/NetworkPolicy = ACL phân vùng"],
      "roadmapLessonId": "ccna-acl-segmentation",
      "relatedDevopsTrack": "networking"
    },
    {
      "id": "acl-firewall",
      "title": "ACL và stateful firewall",
      "ccnaScope": ["Standard vs extended (ý)", "Inbound/outbound direction"],
      "devopsUse": ["Security Group stateful vs NACL stateless", "iptables/nft, cloud FW rule priority"],
      "roadmapLessonId": "ccna-acl-segmentation",
      "relatedDevopsTrack": "networking"
    },
    {
      "id": "wan-vpn",
      "title": "WAN, VPN, leased line (legacy context)",
      "ccnaScope": ["Site-to-site VPN", "WAN routing"],
      "devopsUse": ["Site-to-site VPN, IPsec tunnel, MTU/MSS", "Không deploy dial-up modem"],
      "roadmapLessonId": "ccna-hybrid-routing",
      "relatedDevopsTrack": "cloud"
    },
    {
      "id": "troubleshooting",
      "title": "Troubleshooting có hệ thống",
      "ccnaScope": ["Layered approach", "show ip route, ping, traceroute"],
      "devopsUse": ["Runbook incident mạng", "tcpdump trên node, kubectl get endpoints"],
      "commands": ["ping", "traceroute", "mtr", "ss -tlnp", "curl -v", "dig", "tcpdump -i any host"],
      "roadmapLessonId": "ccna-troubleshoot-layers",
      "relatedDevopsTrack": "cases"
    }
  ],
  "realWorldProblems": [
    {
      "id": "case-hybrid-no-route",
      "title": "On-prem ping được gateway VPN nhưng không tới subnet Azure",
      "symptoms": ["Ping 10.0.1.4 timeout từ DC", "Tunnel Up trên portal"],
      "layer": "L3 routing",
      "checks": [
        "Route trên on-prem có prefix Azure qua tunnel không",
        "Effective routes trên VM Azure (UDR có override không)",
        "NSG không chặn ICMP nếu bạn dùng ping làm test"
      ],
      "fixPattern": "Bổ sung/advertise route hai chiều (BGP hoặc static), rồi verify longest match trên cả hai đầu.",
      "lessonId": "case-hybrid-no-route",
      "keywords": "\"tunnel up\" + \"subnet unreachable\" → missing or wrong route / BGP advertise"
    },
    {
      "id": "case-service-unreachable",
      "title": "Pod healthy nhưng user không vào được Service/Ingress",
      "symptoms": ["kubectl exec curl localhost OK", "Browser 504/timeout"],
      "layer": "L4–L7 + DNAT",
      "checks": [
        "Endpoints có Pod IP không",
        "Service type NodePort/LoadBalancer và cloud LB health probe",
        "Security Group / NSG trên port listener",
        "Ingress backend và TLS termination"
      ],
      "fixPattern": "Đi từ trong ra ngoài: Pod → Service ClusterIP → Node/LB → Internet.",
      "lessonId": "case-service-unreachable",
      "keywords": "\"works inside cluster\" + \"timeout outside\" → Service/LB/NSG/Ingress path"
    },
    {
      "id": "case-snat-exhausted",
      "title": "Outbound từ cluster bị chập chờn sau scale-out",
      "symptoms": ["Intermittent API call fail ra Internet", "Nhiều node mới"],
      "layer": "NAT / PAT",
      "checks": [
        "Số IP public / SNAT port per IP",
        "Azure: outbound rule + NAT Gateway",
        "Connection tracking trên firewall"
      ],
      "fixPattern": "Tăng pool SNAT hoặc NAT Gateway dedicated; giảm keep-alive quá dài nếu firewall cạn state.",
      "lessonId": "ccna-nat-snat",
      "keywords": "\"scale out\" + \"egress fail\" → SNAT port exhaustion"
    },
    {
      "id": "case-dns-ok-tcp-fail",
      "title": "dig trả IP đúng nhưng curl treo",
      "symptoms": ["dig +short OK", "curl timeout", "telnet/nc port closed or timeout"],
      "layer": "L4 ACL",
      "checks": [
        "nc -vz host port từ cùng nguồn client",
        "NSG/NACL/ACL direction (inbound trên server vs outbound client)",
        "Route asymmetric (reply không về)"
      ],
      "fixPattern": "Mở đúng port/stateful rule; sửa route symmetric; không đổi DNS.",
      "lessonId": "ccna-acl-segmentation",
      "keywords": "\"DNS resolves\" + \"TCP timeout\" → firewall/ACL/route not DNS"
    },
    {
      "id": "case-vpn-mtu",
      "title": "SSH/API qua VPN chậm hoặc đứt với payload lớn",
      "symptoms": ["Small ping OK", "Large transfer stall", "PMTUD black hole"],
      "layer": "L3 MTU/MSS",
      "checks": [
        "ping -M do -s size qua tunnel",
        "TCP MSS clamp on VPN device",
        "Overlay MTU (VXGeneve/GRE) trên cloud"
      ],
      "fixPattern": "Giảm MSS/MTU trên tunnel interface hoặc enable PMTUD end-to-end.",
      "lessonId": "case-vpn-mtu",
      "keywords": "\"small OK large fail\" + \"VPN\" → MTU/MSS"
    },
    {
      "id": "case-subnet-overlap",
      "title": "Peering/VPN không traffic sau khi ‘đã nối’",
      "symptoms": ["Plan overlap 10.0.0.0/8 both sides", "Route không install"],
      "layer": "IP planning",
      "checks": [
        "ip route get trên VM",
        "Bảng CIDR tất cả site + cloud + pod CIDR",
        "Terraform address space"
      ],
      "fixPattern": "Redesign non-overlapping RFC1918; re-peer; re-advertise BGP.",
      "lessonId": "ccna-ip-subnet",
      "keywords": "\"peering connected\" + \"no flow\" → overlapping CIDR"
    }
  ],
  "studyOrder": [
    "ccna-osi-layers",
    "ccna-scope",
    "ccna-ip-subnet",
    "ccna-routing-gateway",
    "ccna-nat-snat",
    "ccna-acl-segmentation",
    "ccna-hybrid-routing",
    "ccna-troubleshoot-layers",
    "case-hybrid-no-route",
    "case-service-unreachable",
    "case-vpn-mtu"
  ],
  "sources": [
    {
      "title": "DevOps track — Networking",
      "path": "content/devops/lessons/networking/",
      "note": "OSI, DNS, TLS, nginx — học song song."
    }
  ]
}
