Senior Network Engineer Cheat Sheetچیتشیت مهندس ارشد شبکه
Every topic in the job description, compressed: concepts, numbers, vendor CLI, ready configs, troubleshooting playbooks and interview answers.همه موضوعات آگهی شغلی بهصورت فشرده: مفاهیم، اعداد کلیدی، دستورات وندورها، کانفیگ آماده، پلیبوک عیبیابی و جواب سؤالات مصاحبه.
Layer 2 Switchingسوئیچینگ لایه ۲
VLAN & Trunk 802.1Q
- 4-byte tag, 12-bit VID → VLANs 1–4094 usable (0 and 4095 reserved).
- Native VLAN = untagged on a trunk. Must match both ends; use an unused VLAN (e.g. 999) against VLAN hopping.
- Prune trunks: allow only the VLANs you need.
- User ports:
switchport mode access+switchport nonegotiate(DTP off).
- 802.1Qتگ چهار بایتی با شماره VLAN دوازدهبیتی؛ VLANهای ۱ تا ۴۰۹۴ قابل استفادهاند.
- Native VLANروی ترانک بدون تگ ارسال میشود و دو طرف باید یکسان باشند. برای جلوگیری از VLAN hopping یک VLAN بلااستفاده انتخاب کنید.
- allowed VLANروی ترانک فقط VLANهای لازم مجاز باشند.
- switchport nonegotiateروی پورت کاربر حالت access بگذارید و مذاکره DTP را خاموش کنید.
EtherChannel LACP
- LACP (802.3ad / 802.1AX):
active/passive. PAgP (Cisco):desirable/auto.on= static, no negotiation. - Members must match: speed, duplex, access/trunk mode, allowed and native VLANs.
- Load sharing is a per-flow hash — one flow never exceeds one member link. Tune with
port-channel load-balance src-dst-ip.
- LACP · PAgP · onLACP استاندارد است (active و passive)؛ PAgP مخصوص سیسکو است؛ حالت on هیچ مذاکرهای ندارد و پرخطر است.
- شرط عضویتسرعت، duplex، حالت پورت و VLANهای همه اعضا باید یکسان باشد.
- Per-flow hashتقسیم بار بر اساس هر جریان است؛ یک جریان هیچوقت از ظرفیت یک لینک بیشتر نمیشود.
Spanning Tree RSTP · MST
- 802.1D (30–50 s convergence) → RSTP 802.1w (sub-second, proposal/agreement) → MST 802.1s (VLANs mapped to instances). Cisco default flavours: PVST+ / Rapid-PVST+.
- Root bridge = lowest Bridge ID: priority (default 32768, steps of 4096) + VLAN ID + MAC. Pin it:
spanning-tree vlan 10 root primary. - Port roles: Root, Designated, Alternate, Backup. RSTP states: Discarding → Learning → Forwarding.
- PortFast on host ports. BPDU Guard err-disables a port that receives a BPDU. Root Guard blocks a downstream switch from becoming root. Loop Guard (+ UDLD) protects against unidirectional links.
- Align the STP root with the active FHRP gateway and the vPC primary.
- 802.1D → RSTP → MSTاز نسخه کند (۳۰ تا ۵۰ ثانیه) به RSTP با همگرایی زیر یک ثانیه، و MST که چند VLAN را به یک instance نگاشت میکند. پیشفرض سیسکو: Rapid-PVST+.
- Root bridgeسوئیچی با کمترین Bridge ID؛ priority پیشفرض ۳۲۷۶۸ با گام ۴۰۹۶. روت را همیشه دستی تعیین کنید.
- Root · Designated · Alternate · Backupنقشهای پورت.
- PortFast · BPDU Guardروی پورت کاربر؛ با رسیدن BPDU پورت خاموش (err-disable) میشود.
- Root Guard · Loop Guardاولی نمیگذارد سوئیچ پاییندستی روت شود؛ دومی همراه UDLD از لینک یکطرفه محافظت میکند.
- همراستاییروت STP، گیتوی فعال HSRP/VRRP و vPC primary روی یک دستگاه باشند.
vPC Nexus
- Two Nexus switches act as one LACP partner for a downstream device → all links forward, no STP blocking. Two independent control planes.
- Peer-keepalive: L3 heartbeat, ideally in a dedicated VRF (default: management VRF). It must be up before the peer-link forms. Never carry it over the peer-link.
- Peer-link: L2 trunk port-channel (≥ 2 × 10G). Carries CFS sync, orphan and flooded traffic.
- Type-1 mismatch (STP mode, MTU, LACP mode, allowed VLANs…) suspends the vPC; Type-2 only warns. Check
show vpc consistency-parameters. - Recommended:
peer-gateway,auto-recovery,ip arp synchronize,role priority(lower = primary), samevpcnumber on both peers. - Loop-prevention rule: traffic received over the peer-link is not forwarded out a vPC member port (unless the peer's member is down).
- Peer-link down + keepalive up → the secondary suspends its vPC ports to avoid dual-active.
- vPCدو سوئیچ Nexus برای دستگاه پاییندستی مثل یک طرف LACP دیده میشوند؛ همه لینکها فعالاند و STP چیزی را مسدود نمیکند. دو control plane مستقل دارد.
- Peer-keepaliveضربان لایه ۳، ترجیحاً در VRF جدا (پیشفرض VRF مدیریت). باید قبل از peer-link بالا باشد و هرگز از روی peer-link عبور نکند.
- Peer-linkپورتچنل ترانک لایه ۲ که همگامسازی CFS و ترافیک orphan را حمل میکند.
- Type-1 · Type-2ناسازگاری نوع ۱ (حالت STP، MTU، حالت LACP، VLANهای مجاز) vPC را معلق میکند؛ نوع ۲ فقط هشدار میدهد.
- peer-gateway · auto-recovery · ip arp synchronizeتنظیمات توصیهشده؛ role priority کمتر یعنی primary؛ شماره vPC روی دو طرف یکسان.
- Loop preventionترافیکی که از peer-link آمده به پورت عضو vPC فرستاده نمیشود، مگر عضو طرف مقابل قطع باشد.
- قطع peer-linkاگر keepalive سالم باشد، سوئیچ secondary پورتهای vPC خودش را معلق میکند تا هر دو همزمان فعال نمانند.
L2 Security Toolkitابزارهای امنیت لایه ۲
Routing Protocolsپروتکلهای مسیریابی
OSPF IP 89Link-state
- Multicast 224.0.0.5 (all SPF routers), 224.0.0.6 (DR/BDR). Cost = reference BW ÷ interface BW → set
auto-cost reference-bandwidth 100000on every router. - Neighbor states: Down → Init → 2-Way → ExStart → Exchange → Loading → Full.
- Must match to form adjacency: area ID, subnet/mask, hello/dead timers, authentication, area type (stub flag). MTU mismatch = stuck in ExStart/Exchange. Network-type mismatch can form an adjacency but break routes.
- DR/BDR only on broadcast/NBMA segments (highest priority, then highest RID). Use
ip ospf network point-to-pointon /30–/31 links. - LSA types: 1 Router · 2 Network · 3 Summary (ABR) · 4 ASBR-summary · 5 External · 7 NSSA-external.
- Areas: backbone 0, stub (no type 5), totally stubby (no 3/4/5), NSSA (type 7 allowed). Every area must touch area 0 (or use a virtual link).
- Summarise at ABR (
area x range) and ASBR (summary-address). Add BFD for sub-second failure detection.
- 224.0.0.5 · 224.0.0.6آدرس مولتیکست همه روترها و DR/BDR. هزینه = پهنای مرجع تقسیم بر پهنای اینترفیس؛ reference-bandwidth را روی همه روترها یکسان و بزرگ بگذارید.
- Down → … → Fullحالات همسایگی.
- شرط همسایگیarea، subnet، تایمرهای hello و dead، احراز هویت و نوع area باید یکسان باشند. عدم تطابق MTU همسایگی را در ExStart یا Exchange نگه میدارد. عدم تطابق network type ممکن است همسایگی بسازد ولی مسیرها خراب شوند.
- DR / BDRفقط در سگمنتهای broadcast انتخاب میشوند؛ روی لینکهای /30 و /31 نوع شبکه را point-to-point کنید.
- LSA 1 · 2 · 3 · 4 · 5 · 7Router، Network، Summary، ASBR-summary، External و NSSA.
- Stub · Totally stubby · NSSAانواع area؛ همه areaها باید به area 0 متصل باشند.
- Summarization · BFDخلاصهسازی در ABR و ASBR؛ BFD برای تشخیص سریع قطعی.
EIGRP IP 88DUAL
- Multicast 224.0.0.10. Default metric uses bandwidth + delay (K1 = K3 = 1).
- Successor = best path (lowest Feasible Distance). Feasible Successor = backup that satisfies the Feasibility Condition: the neighbour's Reported Distance < current FD → loop-free, installed instantly.
- No FS → route goes Active and sends queries. Stuck-In-Active is prevented with stub routers and summarisation.
- Must match: AS number, K-values, authentication. Unequal-cost load-balancing with
variance. Prefer named mode.
- 224.0.0.10آدرس مولتیکست؛ متریک پیشفرض از پهنای باند و تأخیر ساخته میشود.
- Successor · Feasible Successorاولی بهترین مسیر است؛ دومی مسیر پشتیبانی است که فاصله اعلامشدهاش (RD) از بهترین فاصله فعلی (FD) کمتر است، پس بدون لوپ است و فوراً جایگزین میشود.
- Active · Stuck-in-Activeبدون مسیر پشتیبان، مسیر Active میشود و Query میفرستد؛ stub و خلاصهسازی جلوی گیر کردن را میگیرند.
- AS · K-values · varianceAS، ضریبهای متریک و احراز هویت باید یکسان باشند؛ تقسیم بار نامساوی با variance.
BGP TCP 179Path-vector
- States: Idle → Connect → Active → OpenSent → OpenConfirm → Established. Stuck in Active = TCP session not completing (reachability, ACL, wrong source/peer IP).
- eBGP uses TTL 1 by default; for loopback peering use
update-source+ebgp-multihop. iBGP needs a full mesh or Route Reflectors (iBGP split-horizon rule). - iBGP does not change next-hop →
next-hop-selfon the edge router. - Always filter: prefix-lists in/out,
maximum-prefix, bogons, RPKI where possible, MD5/TCP-AO, GTSM (ttl-security). - Steer outbound traffic: Weight, Local-Preference. Steer inbound traffic: AS-path prepend, MED, provider communities, more-specific prefixes.
- After a policy change use soft reset:
clear ip bgp x.x.x.x soft in|out.
- Idle → … → Establishedگیر کردن در Active یعنی اتصال TCP کامل نمیشود: دسترسی، ACL یا IP اشتباه.
- ebgp-multihop · update-sourceeBGP بهطور پیشفرض TTL یک دارد؛ برای همسایگی با loopback لازماند.
- Route Reflector · next-hop-selfiBGP نیاز به اتصال همهبههمه یا RR دارد؛ iBGP نکستهاپ را عوض نمیکند، پس روی روتر لبه next-hop-self بزنید.
- prefix-list · maximum-prefix · RPKI · MD5همیشه فیلتر کنید؛ bogonها را هم حذف کنید.
- Weight · Local-Pref ↔ prepend · MED · communitiesدسته اول ترافیک خروجی را کنترل میکند و دسته دوم ترافیک ورودی را؛ prefix دقیقتر هم ورودی را تغییر میدهد.
- soft resetبعد از تغییر policy، تا سشن قطع نشود.
VRF · PBR · Redistribution
- VRF = separate routing table per tenant or segment. VRF-lite = no MPLS, one sub-interface per VRF between devices.
- MPLS L3VPN: RD makes prefixes unique (VPNv4); RT controls import/export.
- Inter-VRF traffic: RT import/export, static routes, or — preferred — through a firewall for inspection.
- PBR: route by source/app with route-map +
set ip next-hop; always add tracking. - Mutual redistribution: filter with route-maps and tags to prevent loops; set a seed metric.
- VRF · VRF-liteجدول مسیریابی جدا برای هر مشتری یا بخش؛ نسخه lite بدون MPLS و با ساباینترفیس جدا.
- RD · RTدر MPLS L3VPN، اولی prefixها را یکتا میکند و دومی ورود و خروج مسیرها را کنترل میکند.
- Route leakingبا RT یا مسیر ثابت؛ بهترین روش عبور از فایروال برای بازرسی است.
- PBRمسیریابی بر اساس مبدأ یا اپلیکیشن؛ همیشه همراه track.
- Redistributionدر توزیع دوطرفه با route-map و tag فیلتر کنید تا لوپ ایجاد نشود.
FHRP HSRP · VRRP · GLBP
Always pair FHRP with object tracking (uplink or IP SLA).
FHRP را همیشه با track (وضعیت آپلینک یا IP SLA) ترکیب کنید.
ACL · NAT · QoS · VoIPACL، NAT، QoS و VoIP
ACL
- Top-down, first match wins, implicit deny at the end.
- Standard ACL (source only) near the destination; extended ACL near the source.
- Wildcard = inverse mask (/24 →
0.0.0.255). Use named ACLs with sequence numbers; object-groups on NX-OS/ASA/FTD. - Protect management with
access-classon VTY and the control plane with CoPP.
- First match · implicit denyبررسی از بالا به پایین؛ اولین تطابق اعمال میشود و در انتها همه چیز ممنوع است.
- Standard · Extendedاستاندارد نزدیک مقصد، extended نزدیک مبدأ.
- Wildcardمعکوس mask؛ از ACL نامدار با شماره ترتیب استفاده کنید.
- access-class · CoPPمحافظت از دسترسی مدیریتی و از CPU دستگاه.
NAT
- Static 1:1 (servers) · Dynamic pool · PAT/overload many:1 (internet) · Twice NAT (source + destination) · Port forwarding (DNAT).
- Hairpin / NAT reflection: inside users reaching an inside server by its public IP.
- NAT breaks AH (use ESP + NAT-T), and SIP/FTP without an ALG.
- CGNAT range:
100.64.0.0/10(RFC 6598).
- Static · Dynamic · PATیکبهیک برای سرورها، استخر آدرس، و چند به یک برای اینترنت.
- Twice NAT · Port forwardingترجمه مبدأ و مقصد با هم، و باز کردن پورت به سرور داخلی.
- Hairpin NATکاربران داخلی سرور داخلی را با IP عمومیاش باز میکنند.
- AH · SIP · FTPNAT با اینها مشکل دارد؛ برای IPsec از ESP و NAT-T استفاده کنید.
- 100.64.0.0/10رنج CGNAT.
QoS DiffServ
- Classify & mark at the trust boundary (access switch / IP phone) with DSCP.
- Queue on the congested egress: LLQ (strict priority, implicitly policed) for voice, CBWFQ for the rest.
- Police = drop/remark excess, no buffering. Shape = buffer and smooth to a rate. When the provider's rate is lower than the interface speed, shape to the real rate so the queue builds on your side.
- For TCP-heavy classes use WRED instead of tail-drop.
- 1 · Classify & markدر مرز اعتماد (سوئیچ دسترسی یا تلفن IP) با DSCP علامت بزنید.
- 2 · Queueروی خروجی پرترافیک: LLQ با اولویت مطلق برای صدا و CBWFQ برای بقیه.
- 3 · Police vs Shapepolice اضافه را حذف یا دوباره علامتگذاری میکند؛ shape آن را در صف نگه میدارد. اگر نرخ سرویسدهنده از سرعت اینترفیس کمتر است، حتماً به نرخ واقعی shape کنید تا صف سمت شما شکل بگیرد.
- 4 · WREDبرای کلاسهای TCP به جای حذف ناگهانی انتهای صف.
VoIP ITU-T G.114
- Per-call bandwidth assumes 20 ms packetisation and Ethernet overhead.
- SIP 5060 (UDP/TCP), 5061 (TLS). RTP uses a high UDP range (vendor-specific, e.g. 10000–20000 or 16384–32767).
- Common culprits: SIP ALG on the firewall (disable it), no QoS on WAN egress, duplex mismatch, Wi-Fi roaming. One-way audio = NAT/firewall pinhole problem.
- Measure with IP SLA
udp-jitter, Wireshark RTP stream analysis, SD-WAN SLA probes.
- G.711 ≈ 87 kbps · G.729 ≈ 31 kbpsپهنای باند هر تماس با بستهبندی ۲۰ میلیثانیه و سربار اترنت.
- SIP 5060 / 5061 · RTPسیگنالینگ و نسخه TLS آن؛ صدا روی رنج بالای UDP که به Vendor بستگی دارد.
- SIP ALGمقصر رایج؛ روی فایروال خاموشش کنید. نبود QoS روی WAN، ناهمخوانی duplex و رومینگ وایفای هم رایجاند. صدای یکطرفه تقریباً همیشه مشکل NAT یا فایروال است.
- IP SLA udp-jitter · Wiresharkابزارهای اندازهگیری کیفیت.
Cisco NX-OS · IOS-XE · ASR · Firepowerپلتفرمهای سیسکو
Catalyst 9000 · ISR 4000 · Catalyst 8000 · ASR 1000
Nexus 3K / 5K / 7K / 9K
feature; vPC, VDC (7K), checkpoint/rollback, | json output, Bash shell, VXLAN EVPN.هر قابلیت باید با feature فعال شود؛ vPC، VDC، checkpoint و rollback، خروجی JSON و VXLAN EVPN.ASR 9000 · NCS · 8000
commit, rollback configuration last 1), RPL route-policies. eBGP neither accepts nor advertises routes without a policy.کانفیگ دومرحلهای با commit و امکان rollback؛ route-policy با زبان RPL. بدون policy، eBGP هیچ مسیری نمیگیرد و نمیفرستد.Secure Firewall (ex-Firepower)
FTD packet processing (simplified)ترتیب پردازش بسته در FTD (سادهشده)
- Prefilter policy (fastpath / block / tunnel rules)
- Existing connection lookup
- UN-NAT (destination) and route lookup
- Access Control Policy (L3/L4)
- Snort: Security Intelligence, AppID, URL, IPS, file/malware
- Source NAT → egress
- Prefilter policy
- بررسی اتصال موجود
- UN-NAT مقصد و مسیریابی
- Access Control Policy لایه ۳ و ۴
- Snort: Security Intelligence، AppID، URL، IPS و بدافزار
- NAT مبدأ و خروج
Tools: packet-tracer (synthetic packet), capture … trace (real packet), capture ASP type asp-drop all, show asp drop, show conn long, show failover.
ابزارها: packet-tracer برای بسته مجازی، capture … trace برای بسته واقعی، show asp drop برای دلیل حذف بسته، show conn long و show failover.
Firewalls — FortiGate · MikroTik · pfSense · OPNsenseفایروالها
FortiGate FortiOS
- Policies evaluated top-down per source→destination interface pair; first match; implicit deny.
- NAT: policy NAT (default) or Central NAT; VIPs for destination NAT.
- HA: FGCP active-passive / active-active, heartbeat links, session pickup.
- Segmentation: VDOMs, zones. Also SD-WAN, ZTNA, security profiles, FortiManager / FortiAnalyzer.
- Policiesبرای هر جفت اینترفیس مبدأ و مقصد از بالا به پایین بررسی میشوند؛ اولین تطابق، و در انتها ممنوع.
- Policy NAT · Central NAT · VIPدو حالت NAT؛ برای ترجمه مقصد از VIP استفاده میشود.
- FGCPHA بهصورت active-passive یا active-active، با لینک heartbeat و همگامسازی session.
- VDOM · zone · SD-WAN · ZTNAبخشبندی، بهعلاوه SD-WAN، ZTNA و security profileها.
MikroTik RouterOS v7
- Filter chains:
input(to the router),forward(through),output(from). First match per chain; default accept unless you add drop rules. - NAT:
srcnatmasquerade,dstnatport forwarding. Connection tracking states: established / related / invalid / untracked; FastTrack for speed. - HA: VRRP (no native state sync). Mgmt: Winbox TCP 8291, SSH, API 8728/8729.
- input · forward · outputترافیک به خود روتر، ترافیک عبوری و ترافیک خروجی از روتر. پیشفرض همه چیز مجاز است، مگر خودتان قانون حذف اضافه کنید.
- srcnat · dstnat · FastTrackmasquerade، باز کردن پورت، و شتابدهی اتصالات برقرار.
- VRRP · Winbox 8291HA بدون همگامسازی session؛ مدیریت با Winbox، SSH و API.
pfSense / OPNsense
- Rules live on the ingress interface, top-down, first match; floating rules are evaluated first.
- Outbound NAT modes: automatic / hybrid / manual. Port forwards create linked rules.
- HA: CARP virtual IPs + pfsync (states) + XMLRPC (config sync).
- Dynamic routing via FRR package/plugin. OPNsense = 2015 fork of pfSense: frequent releases, built-in REST API.
- Ingress interfaceقوانین روی اینترفیسی تعریف میشوند که ترافیک از آن وارد میشود؛ از بالا به پایین، اولین تطابق. floating ruleها اول بررسی میشوند.
- Outbound NATحالت خودکار، hybrid یا دستی.
- CARP · pfsync · XMLRPCIP مجازی، همگامسازی session و همگامسازی کانفیگ.
- FRR · OPNsenseمسیریابی پویا با پکیج FRR؛ OPNsense از سال ۲۰۱۵ از pfSense جدا شده، نسخههای مکرر و REST API داخلی دارد.
Design principlesاصول طراحی
- Zones: Outside / DMZ / Inside / Mgmt / Guest / Voice / IoT. Default deny between zones; allow by service.
- Rule hygiene: owner + ticket ID in comments, logging, quarterly review of shadowed/unused rules.
- Management plane: dedicated VLAN/VRF, no admin access from WAN, trusted hosts, MFA.
- Asymmetric routing breaks stateful inspection — keep both directions through the same firewall.
- زونبندیبیرون، DMZ، داخل، مدیریت، مهمان، صدا و IoT؛ بین زونها پیشفرض ممنوع و فقط سرویسهای لازم مجاز.
- بهداشت قوانینمالک و شماره تیکت در توضیح هر قانون، لاگ، و حذف دورهای قوانین بیاستفاده.
- Management planeشبکه مدیریت جدا، بدون دسترسی از WAN و با MFA.
- Asymmetric routingبازرسی stateful را خراب میکند؛ رفت و برگشت باید از یک فایروال عبور کنند.
Wireless — Ruckus · MikroTik · Ubiquitiوایرلس
RF design rules of thumbقواعد طراحی RF
- 2.4 GHz: only channels 1 / 6 / 11 are non-overlapping; 20 MHz only. 5 GHz: 20/40 MHz in dense sites; DFS channels require radar detection.
- Voice/video: RSSI ≥ −67 dBm, SNR ≥ 25 dB, ~15–20 % cell overlap.
- Disable low data rates (1/2/5.5/11 Mbps) to shrink cells; band-steer to 5/6 GHz; keep ≤ 3–4 SSIDs per radio (beacons cost airtime).
- Roaming: 802.11r (fast transition), 802.11k (neighbour reports), 802.11v (BSS transition).
- Security: WPA2/WPA3-Enterprise (802.1X, EAP-TLS/PEAP + RADIUS), WPA3-SAE for PSK networks, PMF (802.11w). Guest: captive portal, client isolation, own VLAN.
- Always site-survey (predictive + post-install) and check the switch PoE budget (802.3at / 802.3bt).
- 2.4 GHz: 1 / 6 / 11فقط این سه کانال همپوشانی ندارند و فقط ۲۰ مگاهرتز. در ۵ گیگاهرتز در محیط شلوغ ۲۰ یا ۴۰ مگاهرتز؛ کانالهای DFS نیاز به تشخیص رادار دارند.
- RSSI ≥ −67 dBm · SNR ≥ 25 dBبرای صدا و تصویر، با همپوشانی ۱۵ تا ۲۰ درصد بین سلولها.
- Data rates · band steering · SSIDsنرخهای پایین را غیرفعال کنید، کاربران را به ۵ و ۶ گیگ هدایت کنید و حداکثر ۳ تا ۴ SSID داشته باشید.
- 802.11r / k / vرومینگ سریع و هدایت کاربر به AP بهتر.
- WPA3 · 802.1X · PMFامنیت سازمانی با RADIUS؛ شبکه مهمان با captive portal، ایزولهسازی و VLAN جدا.
- Site survey · PoEاندازهگیری قبل و بعد از نصب، و بودجه برق سوئیچ.
Ruckus
- Control options: Unleashed (controller built into the APs), SmartZone (physical or virtual on-prem controller, clustering), RUCKUS One (cloud, AI-driven).
- Signature tech: BeamFlex+ adaptive antennas, ChannelFly channel selection, SmartMesh, Dynamic PSK (a unique key per user/device).
- Strong in high-density venues: offices, hotels, halls.
- Unleashed · SmartZone · RUCKUS Oneکنترلر داخل خود AP، کنترلر فیزیکی یا مجازی با کلاستر، و مدیریت ابری مبتنی بر AI.
- BeamFlex+ · ChannelFly · Dynamic PSKآنتن تطبیقی، انتخاب خودکار کانال، و کلید اختصاصی برای هر کاربر.
- کاربردمحیطهای پرتراکم مثل دفتر، هتل و سالن.
Ubiquiti UniFi
- Managed by the UniFi Network application (self-hosted or on a UniFi OS console).
- Adoption: L2 discovery or
set-inform http://CONTROLLER:8080/informover SSH. - Ports: 8080 inform · 3478/UDP STUN · 10001/UDP discovery · 8443 GUI (self-hosted).
- UniFi Networkاپلیکیشن مدیریت؛ روی سرور خودتان یا کنسول UniFi OS.
- set-informمعرفی AP به کنترلر از طریق SSH، یا کشف خودکار در لایه ۲.
- 8080 · 3478 · 10001 · 8443inform، STUN، کشف دستگاه و رابط وب.
MikroTik Wireless
- Central management with CAPsMAN.
- RouterOS v7: newer
/interface wifistack (formerly wifiwave2) vs legacy/interface wireless— which one applies depends on the hardware. - Very common for PtP / PtMP outdoor links (Nv2 protocol on legacy wireless).
- CAPsMANمدیریت مرکزی APهای میکروتیک.
- /interface wifi · /interface wirelessپشته جدید و پشته قدیمی در RouterOS v7؛ بسته به سختافزار.
- PtP · PtMPبرای لینکهای رادیویی بیرونی بسیار رایج است.
VPN & TunnelingVPN و تونلزنی
tun = L3, tap = L2. Can run over TCP 443.کانال کنترل TLS و گواهی PKI؛ tun لایه ۳ و tap لایه ۲. امکان اجرا روی TCP 443.IPsec IKEv2
- Phase 1 / IKE SA: encryption, integrity/PRF, DH group, authentication (PSK/cert), lifetime (~8–24 h), local/peer ID. IKEv1 main mode = 6 messages, aggressive = 3; IKEv2 = 4 messages (IKE_SA_INIT + IKE_AUTH).
- Phase 2 / Child SA: traffic selectors (proxy-IDs), ESP transform, PFS group, lifetime (~1 h).
- Policy-based (crypto ACL) vs route-based (VTI / tunnel interface — supports dynamic routing; preferred).
- DPD detects dead peers. NAT-T moves IKE + ESP into UDP 4500 when NAT is detected.
- Avoid DES/3DES, MD5, SHA-1, DH 1/2/5, aggressive mode with PSK.
- ESP adds ~50–73 bytes → clamp TCP MSS (≈1360) on the tunnel.
- Phase 1الگوریتم رمز، یکپارچگی، گروه DH، روش احراز هویت (PSK یا گواهی)، مدت اعتبار و شناسهها. IKEv2 با ۴ پیام برقرار میشود؛ IKEv1 در main mode شش پیام.
- Phase 2selectorهای ترافیک، الگوریتم ESP، گروه PFS و مدت اعتبار.
- Policy-based · Route-basedدومی اینترفیس تونل دارد، مسیریابی پویا را پشتیبانی میکند و ارجح است.
- DPD · NAT-Tتشخیص قطع شدن طرف مقابل، و عبور از NAT روی UDP 4500.
- DES · MD5 · SHA-1 · DH 1/2/5استفاده نکنید.
- MSS clampسربار ESP حدود ۵۰ تا ۷۳ بایت است؛ MSS را روی تونل محدود کنید.
WireGuard
- Peers are identified by public key; no negotiation of ciphers.
- AllowedIPs = cryptokey routing: outbound, which destinations go to this peer; inbound, which sources are accepted from it.
PersistentKeepalive = 25for peers behind NAT.- No built-in user auth or dynamic IP assignment → for user remote access with MFA, IPsec or OpenVPN is usually a better fit.
- Debug:
wg show→ latest handshake and transfer counters.
- Public keyطرفین با کلید عمومی شناخته میشوند و الگوریتم مذاکره نمیشود.
- AllowedIPsهم تعیین میکند چه مقصدهایی به این طرف بروند و هم چه مبدأهایی از آن پذیرفته شوند.
- PersistentKeepalive = 25برای طرفی که پشت NAT است.
- محدودیتاحراز هویت کاربر و اختصاص IP پویا ندارد؛ برای کاربران راه دور با MFA معمولاً IPsec یا OpenVPN مناسبترند.
- wg showزمان آخرین handshake و شمارندهها.
WAN · SD-WAN · Load Balancing · HAWAN، SD-WAN، توزیع بار و HA
SD-WAN
- Overlay (IPsec hub-spoke or mesh) on top of several underlays: MPLS, fibre/broadband, LTE/5G.
- Central orchestration + zero-touch provisioning; per-application steering driven by SLA probes (latency, jitter, loss).
- FortiGate: SD-WAN members/zones, Performance SLA health checks, SD-WAN rules (best quality / lowest cost / maximise bandwidth), ADVPN for on-demand spoke-to-spoke tunnels.
- Cisco Catalyst SD-WAN (ex-Viptela): Manager (vManage), Controller (vSmart), Validator (vBond), WAN Edge; OMP routing.
- Overlay · Underlayتونلهای IPsec روی چند لینک زیرین مثل MPLS، فیبر، اینترنت و LTE.
- SLA probes · ZTPمدیریت مرکزی و راهاندازی بدون دخالت دستی؛ هدایت هر اپلیکیشن بر اساس تأخیر، jitter و loss.
- FortiGate SD-WANاعضا و zoneها، Performance SLA، قوانین SD-WAN و ADVPN برای تونل مستقیم بین شعب.
- Manager · Controller · Validator · WAN Edgeاجزای Cisco Catalyst SD-WAN، با پروتکل OMP.
check-gateway or PCC load-balancingدو ISP با BGP یا SD-WAN؛ در میکروتیک مسیر recursive با check-gateway یا توزیع بار PCCAccess Control · MFA · Hardeningکنترل دسترسی، MFA و Hardening
Principlesاصول
- Defense in depth, least privilege, Zero Trust — never trust network location; verify user, device and context per request.
- Segmentation: VLAN + VRF + firewall zones; micro-segmentation in the DC (K8s NetworkPolicy, NSX, ACI).
- IDS/IPS (Snort/Suricata), DDoS mitigation (RTBH, scrubbing, rate limiting), uRPF anti-spoofing.
- Defense in depth · least privilege · Zero Trustدفاع چندلایه و حداقل دسترسی؛ به موقعیت شبکه اعتماد نکنید و کاربر، دستگاه و شرایط را در هر درخواست بررسی کنید.
- Segmentationبا VLAN، VRF و زونهای فایروال؛ در دیتاسنتر بخشبندی ریزتر.
- IDS / IPS · DDoS · uRPFتشخیص و جلوگیری از نفوذ، مقابله با DDoS، و جلوگیری از جعل آدرس.
AAA RADIUS · TACACS+
- RADIUS: UDP 1812/1813 · combines authentication + authorisation · encrypts only the password · network access (802.1X, VPN, Wi-Fi).
- TACACS+: TCP 49 · separates the three As · encrypts the whole payload · per-command authorisation and accounting → device administration.
- Always keep a local fallback account.
- RADIUSفقط رمز را رمزنگاری میکند؛ برای دسترسی کاربران به شبکه (802.1X، VPN، وایفای).
- TACACS+TCP 49؛ کل بسته رمز میشود و هر دستور جداگانه مجوز میگیرد؛ مخصوص مدیریت دستگاهها.
- Local fallbackهمیشه یک حساب محلی پشتیبان نگه دارید.
MFA / 2FA
- Factors: something you know · have · are.
- Methods: TOTP (RFC 6238), push (Duo, Microsoft Authenticator), FIDO2/WebAuthn (phishing-resistant), client certificates.
- Integration: RADIUS proxy (e.g. Duo Auth Proxy) or a SAML/OIDC IdP in front of VPN gateways and admin portals.
- عواملچیزی که میدانید، چیزی که دارید و چیزی که هستید.
- TOTP · Push · FIDO2 · certificatesروشها؛ FIDO2 در برابر فیشینگ مقاوم است.
- RADIUS proxy · SAML / OIDCروش اتصال MFA به VPN و پنلهای مدیریت.
NAC & device hardeningNAC و Hardening دستگاه
- NAC: 802.1X / MAB + posture — Cisco ISE, Aruba ClearPass, FortiNAC, PacketFence.
- Hardening: SSHv2 only, no Telnet/HTTP, login banner, NTP with auth, SNMPv3 authPriv, CoPP, config backups, regular patching, unused ports shut and parked in a dead VLAN.
- 802.1X / MAB + postureکنترل ورود به شبکه همراه بررسی وضعیت دستگاه: Cisco ISE، ClearPass، FortiNAC و PacketFence.
- Hardeningفقط SSHv2، بدون Telnet و HTTP، بنر ورود، NTP با احراز هویت، SNMPv3، CoPP، بکاپ کانفیگ، بهروزرسانی منظم و خاموش کردن پورتهای بلااستفاده.
PKI · TLS · EncryptionPKI، TLS و رمزنگاری
Certificates & TLSگواهی و TLS
- Chain: Root CA (offline, in trust store) → Intermediate CA → leaf certificate. The server must send the intermediate.
- X.509 essentials: Subject, SAN (what clients actually validate), validity dates, Key Usage / EKU, issuer. Revocation: CRL or OCSP.
- Workflow: generate key → CSR → CA signs → install certificate + chain.
- Symmetric ciphers (AES, ChaCha20) for bulk data; asymmetric (RSA, ECDSA, ECDH) for key exchange and authentication; hashes (SHA-256+).
- TLS 1.3: 1-RTT handshake, AEAD ciphers only, forward secrecy mandatory. Disable SSLv3, TLS 1.0 and 1.1.
- Network uses: VPN certificates, EAP-TLS, HTTPS management, SSL deep inspection (requires pushing the firewall CA to clients).
- Root CA → Intermediate → Leafزنجیره گواهی؛ Root آفلاین است و سرور باید گواهی میانی را هم بفرستد.
- SAN · CRL / OCSPSAN فیلدی است که کلاینتها واقعاً بررسی میکنند؛ ابطال گواهی با CRL یا OCSP.
- Key → CSR → CA → installروند صدور گواهی.
- AES · ChaCha20 ↔ RSA · ECDSA · ECDHرمزنگاری متقارن برای داده، و نامتقارن برای تبادل کلید و احراز هویت؛ هش SHA-256 به بالا.
- TLS 1.3handshake یکرفتوبرگشتی، فقط الگوریتمهای AEAD و forward secrecy اجباری. نسخههای قدیمی را خاموش کنید.
- VPN · EAP-TLS · HTTPS · SSL inspectionکاربردهای گواهی در شبکه؛ برای SSL inspection باید CA فایروال روی کلاینتها نصب شود.
# key + CSR
openssl req -new -newkey rsa:2048 -nodes -keyout fw.key -out fw.csr -subj "/CN=vpn.example.com"
# inspect a certificate
openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltName
# check what a server presents (chain, SNI)
openssl s_client -connect vpn.example.com:443 -servername vpn.example.com -showcerts </dev/null
# bundle for import into a firewall
openssl pkcs12 -export -in cert.pem -inkey fw.key -certfile chain.pem -out bundle.pfxMonitoring & Observabilityمانیتورینگ و مشاهدهپذیری
UDP 161 poll · 162 trap
ifHCInOctets).نسخه v2c رمز ندارد. همیشه v3 با سطح authPriv. از شمارندههای ۶۴ بیتی مثل ifHCInOctets استفاده کنید.gRPC / gNMI · YANG
UDP 2055 · 4739 · 6343
UDP 514 · TLS 6514
# interface throughput in bit/s (5-minute rate)
rate(ifHCInOctets{instance="core-sw1",ifName="Ethernet1/1"}[5m]) * 8
# egress utilisation % (ifHighSpeed is in Mbit/s)
100 * rate(ifHCOutOctets[5m]) * 8 / (ifHighSpeed * 1e6)Logging & SIEM Integrationلاگ و اتصال به SIEM
- Sources: firewall traffic/threat logs, VPN authentication, AAA accounting, DHCP/DNS, switch syslog, NetFlow.
- Transport: syslog (prefer TCP/TLS), CEF/LEEF formats, agents (Splunk UF, Elastic Agent, Wazuh agent).
- Prerequisites: NTP everywhere, consistent hostnames, parsing/normalisation (sourcetype, CIM), retention policy.
- Use cases: VPN brute force, admin logins out of hours, config change without a ticket, traffic to known-bad IPs, port scans, BGP flaps.
- Platforms: Splunk, IBM QRadar, Elastic Security, Wazuh, Microsoft Sentinel, FortiSIEM, Graylog.
- منابعلاگ ترافیک و تهدید فایروال، احراز هویت VPN، accounting دستگاهها، DHCP و DNS، syslog سوئیچها و NetFlow.
- syslog TCP/TLS · CEF / LEEF · agentروشهای انتقال.
- NTP · normalization · retentionپیشنیازها: ساعت یکسان، نامگذاری یکسان، یکسانسازی فرمت و سیاست نگهداری.
- سناریوهاحمله حدس رمز به VPN، ورود ادمین در ساعت غیرکاری، تغییر کانفیگ بدون تیکت، ارتباط با IPهای مخرب، اسکن پورت و قطع و وصل BGP.
- Splunk · QRadar · Elastic · Wazuh · Sentinel · FortiSIEM · Graylogپلتفرمهای رایج.
# top denied flows on FortiGate in the last hour
index=network sourcetype=fortigate_traffic action=deny earliest=-1h
| stats count by srcip, dstip, dstport
| sort -count | head 20Linux Fundamentalsمبانی لینوکس
ip -br a # interfaces + addresses
ip r ; ip r get 8.8.8.8 # routing table / route actually used
ip neigh # ARP / ND cache
ip link add link eth0 name eth0.10 type vlan id 10
ss -tulpn # listening sockets + process
tcpdump -ni eth0 host 10.1.1.1 and port 443 -w cap.pcap
mtr -rwzc 100 8.8.8.8 # per-hop loss/latency report
dig +short example.com @1.1.1.1
curl -vkI https://host:8443 # HTTP + TLS check
ethtool eth0 ; ethtool -S eth0 # speed/duplex, NIC error counters
nft list ruleset ; iptables -L -n -v ; iptables -t nat -L -n -v
sysctl -w net.ipv4.ip_forward=1
systemctl status sshd ; journalctl -u sshd -f --since "10 min ago"
iperf3 -s / iperf3 -c 10.0.0.10 -P 4 # throughput testAlso expected: file permissions, systemd units, cron, SSH keys, apt/dnf, /var/log, netplan (Ubuntu) / NetworkManager nmcli (RHEL), keepalived (VRRP), FRR (BGP/OSPF on Linux).
موارد لازم دیگر: دسترسی فایلها، systemd، cron، کلید SSH، apt و dnf، مسیر /var/log، netplan و nmcli، keepalived برای VRRP و FRR برای BGP/OSPF روی لینوکس.
Automation · APIs · HTTP/RESTاتوماسیون، API و HTTP/REST
ansible.netcommon.network_cli; collections cisco.ios, cisco.nxos, fortinet.fortios, community.routeros; resource modules; --check --diff.بدون agent، playbook با YAML و idempotent. collectionهای سیسکو، فورتینت و میکروتیک؛ اجرای آزمایشی با --check --diff.plan → apply. Providers: fortios, panos, iosxe, nxos, cloud VPCs. Keep state remote and locked.زیرساخت بهصورت کد با state؛ plan سپس apply. state را راه دور و قفلشده نگه دارید.# inventory.yml
all:
children:
ios:
hosts:
sw1: { ansible_host: 10.0.0.11 }
vars:
ansible_network_os: cisco.ios.ios
ansible_connection: ansible.netcommon.network_cli
ansible_user: netops
# vlans.yml → ansible-playbook -i inventory.yml vlans.yml --check --diff
- hosts: ios
gather_facts: false
tasks:
- name: Ensure standard VLANs
cisco.ios.ios_vlans:
config:
- { vlan_id: 10, name: USERS }
- { vlan_id: 20, name: VOICE }
state: merged
- name: Backup running config
cisco.ios.ios_config:
backup: truefrom netmiko import ConnectHandler
dev = {"device_type": "cisco_ios", "host": "10.0.0.11",
"username": "netops", "password": "CHANGE_ME"}
with ConnectHandler(**dev) as conn:
print(conn.send_command("show ip interface brief"))
conn.send_config_set(["interface Gi1/0/10",
"description AP-LOBBY"])
conn.save_config()terraform {
required_providers {
fortios = { source = "fortinetdev/fortios" }
}
}
provider "fortios" {
hostname = "10.0.0.1"
token = var.api_token
}
resource "fortios_firewall_address" "web01" {
name = "web01"
subnet = "10.20.0.10 255.255.255.255"
}
# terraform init → terraform plan → terraform apply# requires: restconf + ip http secure-server
curl -s -u netops:PASS \
-H "Accept: application/yang-data+json" \
https://10.0.0.11/restconf/data/ietf-interfaces:interfacesHTTP / REST
- Methods: GET (read), POST (create), PUT (replace), PATCH (partial update), DELETE. GET, PUT and DELETE are idempotent.
- Status codes: 200 · 201 Created · 204 No Content · 301/302 redirect · 400 Bad Request · 401 unauthenticated · 403 forbidden · 404 · 429 rate-limited · 500 · 502 bad gateway · 503 unavailable · 504 gateway timeout.
- API auth: API key, Basic, Bearer token (OAuth2 / JWT). JSON payloads, pagination, rate limits.
- HTTP/2 multiplexes over TCP; HTTP/3 runs over QUIC (UDP 443) — firewalls must allow or block it deliberately.
- 502/504 from a reverse proxy or load balancer means the backend is unreachable or slow, not the client.
- GET · POST · PUT · PATCH · DELETEخواندن، ایجاد، جایگزینی، ویرایش جزئی و حذف.
- 401 · 403 · 429 · 502 · 504احراز نشده، بدون مجوز، محدودیت نرخ، و دو خطایی که یعنی مشکل از سرور پشتی است.
- API key · Basic · Bearer tokenروشهای احراز هویت API.
- HTTP/3 · QUIC · UDP 443فایروال باید آگاهانه آن را مجاز یا مسدود کند.
- 502 / 504از پراکسی معکوس یا load balancer یعنی سرور پشتی در دسترس نیست یا کند است.
Container Networkingشبکه کانتینر
Docker
bridge— default; docker0 + NAT via iptables.host— shares the host's network stack.macvlan/ipvlan— container gets its own IP on the LAN.overlay— multi-host via VXLAN (UDP 4789).- Watch out: default 172.17.0.0/16 overlapping corporate or VPN ranges.
- bridgeحالت پیشفرض با NAT.
- hostاستفاده مستقیم از شبکه میزبان.
- macvlan · ipvlanکانتینر مستقیم از LAN آدرس میگیرد.
- overlayارتباط بین چند میزبان با VXLAN.
- 172.17.0.0/16مراقب همپوشانی این رنج پیشفرض با شبکه سازمان یا VPN باشید.
Kubernetes
- Every Pod gets a routable IP on a flat network, implemented by a CNI: Calico (BGP / IPIP / VXLAN), Cilium (eBPF), Flannel (VXLAN).
- Services: ClusterIP (internal VIP) · NodePort (30000–32767) · LoadBalancer (cloud LB or MetalLB in BGP/L2 mode) · Ingress / Gateway API (L7).
- kube-proxy (iptables/IPVS) or eBPF does service load balancing; CoreDNS for discovery; NetworkPolicy = Pod firewall.
- Network engineer's part: BGP peering between Calico/MetalLB and ToR switches, MTU for overlays (VXLAN −50 bytes), egress NAT and firewall rules.
- Pod IP · CNIهر Pod یک آدرس قابل مسیریابی دارد و شبکه تخت است؛ پیادهسازی با Calico، Cilium یا Flannel.
- ClusterIP · NodePort · LoadBalancer · Ingressانواع Service؛ آخری برای لایه ۷.
- kube-proxy · NetworkPolicyتوزیع بار سرویسها، و فایروال بین Podها.
- BGP · MTU · egressنقش مهندس شبکه: همسایگی BGP بین Calico یا MetalLB و سوئیچ، تنظیم MTU برای overlay و قوانین خروجی.
ITIL & DocumentationITIL و مستندسازی
Documentation standardاستاندارد مستندسازی
- Diagrams per layer: physical (racks, cabling), L2 (VLANs, STP root, port-channels), L3 (subnets, VRFs, routing domains, BGP peers).
- IPAM, naming convention, VLAN/IP plan, config templates, hardening baseline.
- Runbooks for common incidents; post-incident reviews; change log — all versioned (Git, Confluence, NetBox).
- دیاگرام برای هر لایه: فیزیکی (رک و کابلکشی)، لایه ۲ (VLAN، روت STP، پورتچنل) و لایه ۳ (subnet، VRF، همسایههای BGP).
- IPAM، قرارداد نامگذاری، طرح IP و VLAN، قالب کانفیگ و baseline امنیتی.
- Runbook برای مشکلات رایج، گزارش بعد از حادثه و تاریخچه تغییرات؛ همه نسخهدار.
Multi-Vendor CLIدستورات Multi-Vendor
Same task, five platforms.
یک کار، پنج پلتفرم.
show interfaces Gi1/0/1 | i rate|error|CRC|drops
show interfaces counters errors
show spanning-tree summary
show spanning-tree vlan 10 detail | i ieee|occur|from
show etherchannel summary ; show lacp neighbor
show vpc ; show vpc brief ; show vpc peer-keepalive
show vpc consistency-parameters global
show vpc consistency-parameters vpc 20 ; show vpc orphan-ports
show ip ospf interface brief ; show ip ospf database
show ip bgp neighbors 203.0.113.1 advertised-routes
show ip bgp neighbors 203.0.113.1 received-routes
show ip route 10.2.2.0 longer-prefixes
show standby brief ; show vrrp brief ; show track
show ip nat translations ; show access-lists
show policy-map interface Gi0/0 output # QoS drops per class
show processes cpu sorted
show logging | i LINK|LINEPROTO|OSPF|BGP|SPANTREE
! debug safely: terminal monitor → scoped debug → undebug all
debug ip ospf adj# debug flow: why is traffic dropped, which policy matches?
diagnose debug reset
diagnose debug flow filter clear
diagnose debug flow filter addr 10.1.1.10
diagnose debug flow filter proto 1
diagnose debug flow show function-name enable
diagnose debug console timestamp enable
diagnose debug flow trace start 50
diagnose debug enable
# … reproduce the traffic, then:
diagnose debug disable
# sniffer — verbosity 4 shows interface names; count 20; 'a' = absolute time
diagnose sniffer packet any 'host 10.1.1.10 and icmp' 4 20 a
# sessions
diagnose sys session filter dst 10.2.2.20
diagnose sys session list
# IPsec
get vpn ipsec tunnel summary
diagnose vpn ike gateway list name to-HQ
diagnose vpn tunnel list name to-HQ
diagnose vpn ike log filter rem-addr4 203.0.113.10
diagnose debug application ike -1
diagnose debug enable
# routing · SD-WAN · HA · resources
get router info routing-table all
diagnose sys sdwan health-check
diagnose sys sdwan service
get system ha status ; diagnose sys ha checksum cluster
get system performance status ; diagnose sys top 2 20debug flow does not see traffic offloaded to NP6/NP7 processors — test with ICMP or temporarily disable offload on the policy.debug flow ترافیکی را که روی پردازنده NP6/NP7 offload شده نمیبیند؛ با ICMP تست کنید یا offload را موقتاً روی policy غیرفعال کنید./system resource print ; /system routerboard print
/interface print stats ; /interface ethernet monitor ether1
/ip address print ; /ip route print where active
/routing ospf neighbor print ; /routing bgp session print
/ip firewall filter print stats
/ip firewall connection print where dst-address~"10.2.2.20"
/interface wireguard peers print
/tool traceroute 8.8.8.8
/tool torch interface=ether1 # live top talkers
/tool bandwidth-test address=10.0.0.2
/log print where topics~"ospf|bgp|error"
/export file=backup ; /system backup save name=full-bkpfctl -sr # loaded rules
pfctl -ss | grep 10.1.1.10 # state table
pfctl -si # counters
pfctl -d # disable pf — emergency lock-out recovery (pfctl -e to enable)
tcpdump -ni igb0 host 10.1.1.10
tail -f /var/log/filter.log # firewall log (older pfSense: clog)
ifconfig | grep carp ; netstat -rn ; sockstat -4l
swanctl --list-sas # IPsec (strongSwan)
wg showConfig Snippetsنمونه کانفیگهای آماده
vlan 10
name USERS
vlan 999
name NATIVE-UNUSED
!
interface GigabitEthernet1/0/5
description USER-PORT
switchport mode access
switchport access vlan 10
switchport voice vlan 20
switchport nonegotiate
spanning-tree portfast
spanning-tree bpduguard enable
storm-control broadcast level 5.00
!
interface range GigabitEthernet1/0/47 - 48
channel-group 1 mode active
interface Port-channel1
switchport mode trunk
switchport trunk native vlan 999
switchport trunk allowed vlan 10,20,30
!
spanning-tree mode rapid-pvst
spanning-tree vlan 10,20,30 root primary
port-channel load-balance src-dst-ip
!
ip dhcp snooping
ip dhcp snooping vlan 10,20
ip arp inspection vlan 10,20
interface Port-channel1
ip dhcp snooping trust
ip arp inspection trust
!
track 1 interface GigabitEthernet1/0/1 line-protocol
interface Vlan10
ip address 10.10.10.2 255.255.255.0
standby version 2
standby 10 ip 10.10.10.1
standby 10 priority 110
standby 10 preempt
standby 10 track 1 decrement 20router ospf 1
router-id 1.1.1.1
auto-cost reference-bandwidth 100000
passive-interface default
no passive-interface GigabitEthernet0/0/1
network 10.0.0.0 0.0.255.255 area 0
bfd all-interfaces ! also needs "bfd interval" on the interface
interface GigabitEthernet0/0/1
ip ospf network point-to-point
!
ip prefix-list OUR-PREFIX seq 5 permit 198.51.100.0/24
ip prefix-list DEFAULT-ONLY seq 5 permit 0.0.0.0/0
route-map ISP1-OUT permit 10
match ip address prefix-list OUR-PREFIX
route-map ISP1-IN permit 10
match ip address prefix-list DEFAULT-ONLY
set local-preference 200
!
router bgp 65001
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor 203.0.113.1 remote-as 65000
neighbor 203.0.113.1 password BGP_SECRET
neighbor 203.0.113.1 ttl-security hops 1
address-family ipv4
network 198.51.100.0 mask 255.255.255.0
neighbor 203.0.113.1 activate
neighbor 203.0.113.1 route-map ISP1-IN in
neighbor 203.0.113.1 route-map ISP1-OUT out
neighbor 203.0.113.1 maximum-prefix 1000 90
ip route 198.51.100.0 255.255.255.0 Null0 ! RIB anchor for "network"
!
vrf definition GUEST
rd 65001:20
address-family ipv4
interface GigabitEthernet0/0/2.20
encapsulation dot1Q 20
vrf forwarding GUEST
ip address 172.16.20.1 255.255.255.0
!
ip access-list extended NAT-ACL
permit ip 10.10.0.0 0.0.255.255 any
interface GigabitEthernet0/0/0
ip nat outside
interface Vlan10
ip nat inside
ip nat inside source list NAT-ACL interface GigabitEthernet0/0/0 overload
!
! QoS: LLQ for voice inside a shaper set to the real circuit rate (50 Mb/s)
class-map match-any VOICE
match dscp ef
class-map match-any SIGNALING
match dscp cs3
policy-map WAN-QUEUE
class VOICE
priority percent 20
class SIGNALING
bandwidth percent 5
class class-default
fair-queue
policy-map WAN-SHAPE
class class-default
shape average 50000000
service-policy WAN-QUEUE
interface GigabitEthernet0/0/0
service-policy output WAN-SHAPE
!
snmp-server group NMS v3 priv
snmp-server user zabbix NMS v3 auth sha AUTH_PASS priv aes 128 PRIV_PASS
snmp-server host 10.0.0.50 version 3 priv zabbixfeature vpc
feature lacp
feature interface-vlan
!
vrf context VPC-KA
interface Ethernet1/48
no switchport
vrf member VPC-KA
ip address 10.255.255.1/30
no shutdown
!
vpc domain 10
role priority 100 ! lower = primary
peer-keepalive destination 10.255.255.2 source 10.255.255.1 vrf VPC-KA
peer-gateway
auto-recovery
ip arp synchronize
delay restore 150
!
interface port-channel1
description vPC-PEER-LINK
switchport mode trunk
spanning-tree port type network
vpc peer-link
interface Ethernet1/49-50
channel-group 1 mode active
!
interface port-channel20
description TO-ACCESS-SW
switchport mode trunk
switchport trunk allowed vlan 10,20,30
vpc 20
interface Ethernet1/20
channel-group 20 mode active
! verify: show vpc · show vpc consistency-parameters vpc 20 · show port-channel summaryprefix-set OUR-PREFIX
198.51.100.0/24
end-set
!
route-policy ISP-OUT
if destination in OUR-PREFIX then
pass
else
drop
endif
end-policy
!
route-policy ISP-IN
set local-preference 200
pass
end-policy
!
router bgp 65001
bgp router-id 1.1.1.1
address-family ipv4 unicast
network 198.51.100.0/24
neighbor 203.0.113.1
remote-as 65000
address-family ipv4 unicast
route-policy ISP-IN in
route-policy ISP-OUT out
!
commit
! show configuration commit list · rollback configuration last 1# site-to-site IPsec (IKEv2)
config vpn ipsec phase1-interface
edit "to-HQ"
set interface "wan1"
set ike-version 2
set peertype any
set net-device disable
set proposal aes256gcm-prfsha384
set dhgrp 20
set remote-gw 203.0.113.10
set psksecret PSK_HERE
set dpd on-idle
next
end
config vpn ipsec phase2-interface
edit "to-HQ-p2"
set phase1name "to-HQ"
set proposal aes256gcm
set dhgrp 20
set src-subnet 10.1.0.0 255.255.0.0
set dst-subnet 10.2.0.0 255.255.0.0
next
end
config router static
edit 0
set dst 10.2.0.0 255.255.0.0
set device "to-HQ"
next
end
config firewall policy
edit 0
set name "LAN-to-HQ"
set srcintf "internal"
set dstintf "to-HQ"
set srcaddr "LAN-10.1"
set dstaddr "HQ-10.2"
set action accept
set schedule "always"
set service "ALL"
set logtraffic all
next
end
# SD-WAN with VoIP-grade SLA
config system sdwan
set status enable
config members
edit 1
set interface "wan1"
set gateway 198.51.100.1
next
edit 2
set interface "wan2"
set gateway 192.0.2.1
next
end
config health-check
edit "Internet"
set server "1.1.1.1" "8.8.8.8"
set members 1 2
config sla
edit 1
set latency-threshold 150
set jitter-threshold 30
set packetloss-threshold 1
next
end
next
end
end
# HA active-passive
config system ha
set group-name "FGT-HA"
set mode a-p
set hbdev "port9" 50 "port10" 50
set session-pickup enable
set priority 200
end# baseline firewall (input = to router, forward = through it)
/interface list add name=WAN
/interface list add name=LAN
/ip firewall filter
add chain=input connection-state=established,related,untracked action=accept
add chain=input connection-state=invalid action=drop
add chain=input protocol=icmp action=accept
add chain=input protocol=udp dst-port=51820 action=accept comment="WireGuard"
add chain=input in-interface-list=!LAN action=drop comment="drop all not from LAN"
add chain=forward action=fasttrack-connection connection-state=established,related hw-offload=yes
add chain=forward connection-state=established,related,untracked action=accept
add chain=forward connection-state=invalid action=drop
add chain=forward connection-nat-state=!dstnat in-interface-list=WAN action=drop
/ip firewall nat add chain=srcnat out-interface-list=WAN action=masquerade
/ip service disable telnet,ftp,www,api
/ip service set winbox address=10.0.0.0/24
# WireGuard
/interface wireguard add name=wg0 listen-port=51820
/ip address add address=10.99.0.1/24 interface=wg0
/interface wireguard peers add interface=wg0 public-key="PEER_PUBLIC_KEY" allowed-address=10.99.0.2/32,10.50.0.0/24 endpoint-address=203.0.113.20 endpoint-port=51820 persistent-keepalive=25s
# OSPF
/routing ospf instance add name=default router-id=1.1.1.1
/routing ospf area add name=backbone area-id=0.0.0.0 instance=default
/routing ospf interface-template add area=backbone interfaces=ether2 type=ptp
/routing ospf interface-template add area=backbone networks=10.10.0.0/24 passive
# BGP (newer 7.x syntax with /routing bgp instance)
/ip firewall address-list add list=OUR-PREFIXES address=198.51.100.0/24
/routing bgp instance add name=i1 as=65001 router-id=1.1.1.1
/routing bgp connection add name=toISP instance=i1 remote.address=203.0.113.1 remote.as=65000 local.role=ebgp output.network=OUR-PREFIXES
# dual-WAN failover with recursive next-hop check
/ip route add dst-address=8.8.8.8/32 gateway=198.51.100.1 scope=10
/ip route add dst-address=0.0.0.0/0 gateway=8.8.8.8 target-scope=11 check-gateway=ping distance=1
/ip route add dst-address=0.0.0.0/0 gateway=192.0.2.1 distance=2# keys: wg genkey | tee priv | wg pubkey > pub
[Interface]
Address = 10.99.0.2/24
PrivateKey = CLIENT_PRIVATE_KEY
ListenPort = 51820
# MTU = 1420 (lower it behind PPPoE or another tunnel)
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = 203.0.113.10:51820
AllowedIPs = 10.99.0.0/24, 10.1.0.0/16
PersistentKeepalive = 25
# wg-quick up wg0 ; systemctl enable wg-quick@wg0 ; wg showTroubleshooting Playbooksپلیبوکهای عیبیابی
P1OSPF neighbour not reaching Fullهمسایگی OSPF به Full نمیرسد
- L1/L2 up?
show interface; ping the neighbour's IP. - Stuck in Init → hellos one-way: ACL, multicast blocked, wrong VLAN.
- No neighbour at all → mismatched area, subnet/mask, hello/dead, auth, area type, or passive interface.
- Stuck in ExStart/Exchange → MTU mismatch (
ip ospf mtu-ignoreonly as a temporary workaround). - 2-Way between DROTHERs is normal on broadcast segments.
- Duplicate router-ID → flapping and odd LSAs.
show ip ospf interface,debug ip ospf adj.
- L1 / L2اینترفیس سالم است و IP همسایه پینگ میشود؟
- Stuck in Inithello فقط یکطرفه میرسد: ACL، مسدود شدن multicast یا VLAN اشتباه.
- همسایه دیده نمیشودیکی از اینها یکسان نیست: area، subnet، تایمرها، احراز هویت، نوع area؛ یا اینترفیس passive است.
- ExStart / Exchangeعدم تطابق MTU.
- 2-Wayبین روترهای غیر DR طبیعی است.
- Duplicate Router-IDباعث ناپایداری و LSAهای عجیب میشود.
- show ip ospf interface · debug ip ospf adjابزارهای بررسی.
P2BGP session not Establishedسشن BGP برقرار نمیشود
- Reachability to the peer from the correct source (
ping x source y); TCP 179 allowed by ACL / CoPP / firewall? - Idle → no route to peer, admin shutdown, or max-prefix exceeded. Active → TCP attempts failing.
- Check remote-as, neighbour IP,
update-source,ebgp-multihop, MD5 password (log shows MD5 mismatch). - Established but no routes → filters/route-maps,
networkstatement without a matching RIB route, missing IOS-XR policy, next-hop unreachable (use next-hop-self on iBGP). - Flapping → MTU/PMTUD (session drops when large UPDATEs arrive), hold/BFD timers, interface errors.
- ping x source y · TCP 179دسترسی به همسایه از مبدأ درست؛ پورت ۱۷۹ در ACL، CoPP یا فایروال باز است؟
- Idleمسیری به همسایه نیست، دستی خاموش شده یا سقف prefix رد شده.
- Activeتلاش برای اتصال TCP ناموفق است.
- remote-as · update-source · multihop · MD5این تنظیمات را با طرف مقابل تطبیق دهید.
- برقرار ولی بدون مسیرفیلترها، نبود مسیر متناظر برای network، نبود route-policy در IOS-XR یا نکستهاپ غیرقابلدسترس.
- Flappingمشکل MTU، تایمرها یا خطای اینترفیس.
P3vPC down or suspendedvPC قطع یا معلق است
show vpc: peer status, keepalive status, consistency status.- Keepalive down → VRF/IP reachability (management switch?). Never via the peer-link.
- Peer-link down + keepalive up → secondary suspends its vPC ports (by design).
- Type-1 inconsistency →
show vpc consistency-parameters global/vpc N: MTU, STP mode, allowed VLANs, LACP mode. - VLAN missing on one peer → only that VLAN is suspended.
- After both peers reboot one stays down → enable
auto-recovery.
- show vpcوضعیت همسایه، keepalive و سازگاری.
- Keepalive downدسترسی VRF و IP را بررسی کنید؛ هرگز از روی peer-link نباشد.
- Peer-link downاگر keepalive سالم باشد، سوئیچ secondary پورتهای vPC را معلق میکند؛ این رفتار طبق طراحی است.
- Type-1 inconsistencyMTU، حالت STP، VLANهای مجاز یا حالت LACP یکسان نیست.
- VLAN فقط روی یک طرففقط همان VLAN معلق میشود.
- auto-recoveryاگر بعد از ریبوت هر دو سوئیچ یکی بالا نیاید.
P4IPsec tunnel won't come up / passes no trafficتونل IPsec بالا نمیآید یا ترافیک عبور نمیدهد
- Underlay: ping the peer's public IP; UDP 500/4500 and ESP allowed end-to-end (ISP, upstream NAT/firewall).
- Phase 1 fails → proposal mismatch (encryption/hash/DH), PSK mismatch, IKE version, local/peer ID, certificate chain or clock (NTP!).
- Phase 1 OK, phase 2 fails → traffic selectors / proxy-IDs don't mirror exactly, PFS group mismatch.
- Tunnel up, no traffic → missing route into the tunnel, firewall policy, NAT exemption (traffic NATed before encryption), overlapping subnets.
- Only small packets pass → MTU/MSS clamp.
- Drops every N hours → lifetime/rekey mismatch, DPD.
- Compare encaps/decaps counters on both sides: FortiGate
diagnose vpn tunnel list, Ciscoshow crypto ipsec sa.
- Underlay · UDP 500/4500 · ESPIP عمومی طرف مقابل پینگ میشود و این پورتها در کل مسیر باز است؟
- Phase 1 failsالگوریتمها، PSK، نسخه IKE یا شناسهها یکسان نیست؛ یا گواهی و ساعت مشکل دارد.
- Phase 2 failsselectorهای ترافیک دقیقاً قرینه نیستند یا گروه PFS متفاوت است.
- تونل بالا، بدون ترافیکمسیر به تونل، policy فایروال، NAT شدن قبل از رمزنگاری یا subnetهای تکراری.
- MTU / MSSاگر فقط بستههای کوچک رد میشوند.
- Lifetime · DPDاگر هر چند ساعت یک بار قطع میشود.
- encaps / decapsشمارندههای دو طرف را مقایسه کنید.
P5"The network is slow" / poor call quality«شبکه کند است» / کیفیت پایین تماس
- Scope: one user, one site, one app, everyone? Wired or Wi-Fi? Time pattern?
- Compare with the monitoring baseline: utilisation (95th pct), drops, CRC errors, CPU.
- Path:
mtr/traceroute — where do latency/loss start? Ignore ICMP-rate-limited hops if later hops are clean. - Interface: CRC/input errors → cabling/optics; late collisions → duplex mismatch; output drops → congestion → QoS/shaping.
- VoIP: DSCP preserved end-to-end? LLQ drops (
show policy-map interface), jitter/loss via IP SLA, SIP ALG disabled? One-way audio → NAT. - Application side: DNS latency, TCP retransmissions/window in Wireshark, server response time vs network RTT.
- دامنه مشکلیک کاربر، یک سایت یا همه؟ سیمی یا وایرلس؟ الگوی زمانی دارد؟
- Baselineمقایسه با حالت عادی در مانیتورینگ: مصرف، دراپ، خطای CRC و CPU.
- mtrتأخیر یا loss از کدام هاپ شروع میشود؟
- CRC · late collision · output dropsبه ترتیب: کابل یا ماژول، ناهمخوانی duplex، و تراکمی که QoS لازم دارد.
- VoIPDSCP در کل مسیر حفظ شده؟ دراپ صف اولویت، jitter و loss، و خاموش بودن SIP ALG. صدای یکطرفه یعنی NAT.
- سمت اپلیکیشنتأخیر DNS، ارسال مجدد TCP در Wireshark و زمان پاسخ سرور.
P6L2 loop / broadcast stormلوپ لایه ۲ / طوفان broadcast
- Symptoms: switch CPU pegged, MAC-flap logs (
MACFLAP_NOTIF), all port LEDs blinking, site-wide outage. show spanning-tree detail | i occur|from→ follow the topology-change source hop by hop.- Shut the suspect port / remove the rogue switch, then fix the root cause (missing BPDU Guard, looped cable, unmanaged switch).
- Prevent: BPDU Guard on edge ports, pinned root, storm-control, Loop Guard / UDLD.
- علائمCPU سوئیچها بالا، لاگ MAC flapping، چشمک زدن همه چراغها و قطعی کل سایت.
- Topology change sourceمنبع تغییرات را پیدا کنید و سوئیچ به سوئیچ دنبال کنید.
- shutdownپورت مشکوک را خاموش کنید، بعد علت را رفع کنید: نبود BPDU Guard، کابل حلقهشده یا سوئیچ بدون مدیریت.
- پیشگیریBPDU Guard روی پورتهای کاربر، تعیین روت، storm-control و Loop Guard.
P7Firewall drops traffic that should passفایروال ترافیک مجاز را drop میکند
- Does the traffic arrive? Capture on the ingress interface (FortiGate sniffer, FTD capture, tcpdump).
- Which rule matches? FortiGate
debug flow, FTDpacket-tracer, pfSense log on the ingress interface. - Usual causes: wrong interface pair/zone, NAT changes the address you match on, rule order/shadowing, asymmetric routing (SYN through one firewall, SYN-ACK through another), RPF check, IPS/security profile block.
- Stale session after a routing change → clear that session.
- Captureآیا ترافیک به اینترفیس ورودی فایروال میرسد؟
- debug flow · packet-tracerکدام قانون اعمال میشود؟
- علل رایجzone اشتباه، تغییر آدرس توسط NAT، ترتیب قوانین، مسیریابی نامتقارن، شکست RPF یا مسدود شدن توسط IPS.
- Stale sessionبعد از تغییر مسیر، session قدیمی را پاک کنید.
P8Wi-Fi drops, slowness, can't connectوایفای: قطعی، کندی، عدم اتصال
- One client or all? Which band/SSID? Check RSSI, SNR, retries and data rate in the controller.
- Can't associate → authentication (RADIUS reachability, expired certificate, wrong PSK), DHCP scope exhausted, VLAN not trunked to the AP.
- Slow → co-channel interference, overly wide channels, low data rates enabled, sticky clients, too many SSIDs, AP uplink.
- Drops while moving → roaming (11r/k/v support, coverage holes) or DFS radar events changing channel.
- Confirm with a survey/spectrum tool (Ekahau, controller RF views).
- RSSI · SNR · retriesیک کاربر یا همه؟ کدام باند؟ این شاخصها را در کنترلر ببینید.
- عدم اتصالاحراز هویت (RADIUS، گواهی منقضی، رمز اشتباه)، تمام شدن آدرس DHCP یا نبودن VLAN روی پورت AP.
- کندیتداخل همکانال، کانال خیلی پهن، نرخهای پایین فعال، کلاینتی که به AP دور چسبیده یا تعداد زیاد SSID.
- قطعی هنگام حرکتمشکل رومینگ یا تغییر کانال به خاطر رادار (DFS).
- Site surveyبا ابزار اندازهگیری تأیید کنید.
P9MTU / fragmentation black holeمشکل MTU و fragmentation
- Symptoms: ping and SSH work, but HTTPS / file transfers hang; some sites fail through VPN or PPPoE.
- Test:
ping -M do -s 1472 x(Linux) orping x size 1500 df-bit(Cisco); reduce until it passes. - Cause: tunnel overhead (GRE 24, IPsec ~50–73, VXLAN 50, PPPoE 8 bytes) + ICMP "fragmentation needed" blocked → PMTUD fails.
- Fix:
ip tcp adjust-mss 1360, allow ICMP type 3 code 4, correct tunnel MTU, jumbo frames end-to-end in the DC.
- علائمپینگ و SSH کار میکنند ولی HTTPS یا انتقال فایل گیر میکند؛ بعضی سایتها پشت VPN باز نمیشوند.
- ping -M do -s 1472پینگ با بیت DF و کم کردن تدریجی اندازه.
- علتسربار تونل (GRE، IPsec، VXLAN، PPPoE) بهعلاوه مسدود بودن پیام ICMP «fragmentation needed».
- ip tcp adjust-mss 1360راهحل اصلی؛ بهعلاوه اجازه دادن ICMP نوع ۳ کد ۴ و تنظیم درست MTU تونل.
Interview Q&Aسؤالات مصاحبه
01What happens when a host pings a server in another subnet?وقتی هاست سروری در subnet دیگر را پینگ میکند چه اتفاقی میافتد؟
The host sees the destination is off-subnet → ARPs for the default gateway's MAC → sends the frame to the gateway (switches forward by MAC table) → the router strips L2, does a longest-prefix lookup, decrements TTL, ARPs for the next hop, rewrites the L2 header (IP unchanged unless NAT) → the reply may take a different path (asymmetry).
- Subnet maskهاست میفهمد مقصد خارج از شبکه خودش است.
- ARPMAC گیتوی را پیدا میکند و فریم را به گیتوی میفرستد.
- Routerهدر لایه ۲ را برمیدارد، طولانیترین prefix را پیدا میکند، TTL را یکی کم میکند، MAC هاپ بعدی را پیدا میکند و هدر لایه ۲ جدید میسازد. آدرس IP عوض نمیشود مگر NAT باشد.
- مسیر برگشتپاسخ ممکن است از مسیر دیگری برگردد؛ یعنی مسیر نامتقارن.
02vPC vs stacking / VSS — when to use which?vPC یا Stack/VSS — کدام و کی؟
Stack/VSS = one control plane: single config, simpler, but one software failure domain. vPC = two independent control planes sharing port-channel state: upgrade one peer at a time, higher resilience, but configuration consistency must be maintained. DC Nexus → vPC; campus access → stacking.
- Stack / VSSیک control plane: کانفیگ واحد و سادهتر، ولی یک خطای نرمافزاری هر دو را از کار میاندازد.
- vPCدو control plane مستقل: ارتقای جداگانه و تابآوری بیشتر، ولی کانفیگ دو طرف باید یکسان نگه داشته شود.
- انتخابدیتاسنتر با Nexus ← vPC؛ لایه دسترسی کمپوس ← استک.
03Why do OSPF neighbours get stuck in ExStart?چرا OSPF در ExStart گیر میکند؟
Almost always an MTU mismatch: DBD packets larger than the neighbour's MTU are dropped, so the master/slave exchange never completes. Less often: duplicate router-IDs. Fix the MTU on both sides; mtu-ignore is a band-aid.
- MTU mismatchتقریباً همیشه علت همین است: بستههای DBD بزرگتر از MTU همسایه دور ریخته میشوند و تبادل کامل نمیشود.
- Duplicate Router-IDعلت کمتر رایج.
- mtu-ignoreفقط مسکّن است؛ MTU دو طرف را یکسان کنید.
04Two ISPs: how do you control inbound and outbound traffic with BGP?با دو ISP، ترافیک ورودی و خروجی را چطور با BGP کنترل میکنید؟
Outbound: Local-Preference (higher = preferred exit), or Weight on a single router. Inbound: AS-path prepending toward the backup ISP, ISP communities, MED (only between links to the same ISP), or more-specific prefixes on the preferred link. Always filter outbound to your own prefixes (never become transit) and set maximum-prefix inbound.
- Outbound · Local-Preferenceعدد بیشتر یعنی خروجی ترجیحی؛ روی یک روتر Weight هم کافی است.
- Inbound · AS-path prependبه سمت ISP پشتیبان.
- Inbound · communities / MEDcommunity تعریفشده سرویسدهنده؛ MED فقط بین لینکهای یک ISP.
- Inbound · more-specificprefix دقیقتر روی لینک اصلی.
- prefix-list out · maximum-prefixفقط prefixهای خودتان را اعلام کنید تا AS شما مسیر عبوری نشود.
05Explain EIGRP's feasibility condition.شرط Feasibility در EIGRP را توضیح دهید.
A neighbour qualifies as Feasible Successor when its Reported Distance < the current Feasible Distance. That guarantees the neighbour isn't routing through us, so the backup is loop-free and installed instantly without queries.
- Feasibility Conditionهمسایه وقتی جایگزین آماده (feasible successor) است که فاصله اعلامشدهاش (RD) از بهترین فاصله فعلی (FD) کمتر باشد.
- Loop-freeاین شرط تضمین میکند مسیر همسایه از خود ما عبور نمیکند؛ پس بدون Query و فوراً جایگزین میشود.
06Policy-based vs route-based VPN?VPN مبتنی بر Policy یا Route؟
Policy-based: a crypto ACL decides what is encrypted; one SA per subnet pair; no dynamic routing; selector mismatches between vendors are common. Route-based: a tunnel interface (VTI); whatever is routed into it is encrypted; supports OSPF/BGP over the tunnel and clean failover/SD-WAN. Prefer route-based.
- Policy-basedیک ACL تعیین میکند چه ترافیکی رمز شود؛ مسیریابی پویا ندارد و ناهماهنگی selectorها بین Vendorها رایج است.
- Route-based (VTI)هر چه به اینترفیس تونل مسیریابی شود رمز میشود؛ OSPF، BGP و failover را پشتیبانی میکند. انتخاب ارجح.
07WireGuard, OpenVPN or IPsec — which do you choose?WireGuard، OpenVPN یا IPsec — کدام را انتخاب میکنید؟
Site-to-site between enterprise firewalls → IPsec IKEv2 (interoperability, hardware offload). Linux/MikroTik links where speed and simplicity matter → WireGuard. Remote users needing MFA, per-user policy and a TCP 443 fallback → IPsec dial-up client (e.g. FortiClient) or OpenVPN. Never PPTP; L2TP only with IPsec and only for legacy clients.
- IPsec IKEv2Site-to-Site بین فایروالهای سازمانی؛ سازگاری بین Vendorها و شتاب سختافزاری.
- WireGuardلینکهای لینوکس و میکروتیک که سرعت و سادگی مهم است.
- IPsec client · OpenVPNکاربران راه دور با MFA، policy کاربری و امکان کار روی TCP 443.
- PPTP · L2TPPPTP هرگز؛ L2TP فقط همراه IPsec و فقط برای کلاینتهای قدیمی.
08Policing vs shaping — and where do you apply QoS for VoIP?Policing یا Shaping — و QoS برای VoIP کجا اعمال میشود؟
Policing drops or remarks excess instantly (no delay, causes TCP retransmits) — used inbound and by providers. Shaping buffers excess and sends at the contracted rate (adds delay, smooths bursts). For VoIP: mark EF at the trust boundary, LLQ on WAN egress, inside a shaper set to the real circuit rate so congestion happens in your queue, not the provider's.
- Policingاضافه را فوراً حذف یا دوباره علامتگذاری میکند؛ تأخیر ندارد ولی TCP را به ارسال مجدد میاندازد.
- Shapingاضافه را در صف نگه میدارد و با نرخ قرارداد میفرستد؛ تأخیر اضافه میکند ولی ترافیک را نرم میکند.
- EF + LLQبرای VoIP: علامت EF در لبه شبکه و صف اولویت روی خروجی WAN.
- Shape to real rateداخل یک shaper با نرخ واقعی مدار، تا تراکم در صف شما رخ دهد نه در شبکه سرویسدهنده.
09"The internet is down" — your first five steps?«اینترنت قطع است» — پنج قدم اول شما؟
- Scope: one user, a site, everyone? Which apps?
- Client: IP/DHCP, gateway ping, DNS (
nslookup) vs raw IP reachability (ping 1.1.1.1). - Monitoring: ISP link, BGP/SD-WAN health, firewall CPU and session count.
- Path: traceroute from the edge; check recent changes and tickets.
- Communicate status + ETA, open the incident, escalate to the ISP with evidence.
- دامنه مشکلیک کاربر، یک سایت یا همه؟ کدام برنامهها؟
- Client · DHCP · DNSآدرس IP، پینگ گیتوی و جدا کردن مشکل DNS از دسترسی IP؛ مثلاً پینگ 1.1.1.1.
- Monitoringلینک ISP، وضعیت BGP یا SD-WAN و منابع فایروال.
- traceroute · recent changesمسیر از لبه شبکه و تغییرات اخیر.
- Incidentاطلاعرسانی وضعیت و زمان تخمینی، ثبت حادثه و پیگیری با ISP همراه مدرک.
10RADIUS vs TACACS+?تفاوت RADIUS و TACACS+؟
RADIUS: UDP 1812/1813, combines authentication and authorisation, encrypts only the password — standard for network access. TACACS+: TCP 49, separates AAA, encrypts the whole body, per-command authorisation and accounting — device administration.
- RADIUSUDP 1812/1813؛ فقط رمز را رمزنگاری میکند؛ استاندارد دسترسی کاربران به شبکه، مثل 802.1X، VPN و وایفای.
- TACACS+TCP 49؛ کل بسته رمز میشود و هر دستور جداگانه مجوز میگیرد و ثبت میشود؛ مخصوص مدیریت دستگاه.
11How do you design guest Wi-Fi securely?وایفای مهمان را چطور امن طراحی میکنید؟
Separate SSID → dedicated VLAN/VRF → firewall zone allowing only internet (deny RFC 1918), client isolation, captive portal with voucher/OTP, per-client rate limit, short DHCP lease, logging for legal compliance, WPA3-SAE or OWE.
- SSID · VLAN / VRFشبکه جدا برای مهمان.
- Firewall zoneفقط اینترنت؛ رنجهای خصوصی ممنوع.
- Client isolationمهمانها همدیگر را نبینند.
- Captive portal · OTPورود با کد یا پیامک.
- Rate limit · short lease · loggingمحدودیت پهنای باند هر کاربر، lease کوتاه و لاگ برای الزامات قانونی.
12SNMP polling vs streaming telemetry?SNMP polling یا Streaming Telemetry؟
SNMP: pull, minute-level resolution, OID-based, CPU-heavy at scale, misses micro-bursts. Telemetry: push, structured YANG data over gRPC/gNMI, sub-second or on-change, scales well. In practice: SNMPv3 for broad coverage plus telemetry on core devices, visualised in Grafana or Zabbix.
- SNMPمدل pull با دقت دقیقهای؛ در مقیاس بالا CPU مصرف میکند و جهشهای کوتاه ترافیک را نمیبیند.
- Streaming telemetryمدل push با داده ساختاریافته (YANG روی gRPC یا gNMI)، دقت زیر ثانیه و مقیاسپذیر.
- SNMPv3 + telemetryدر عمل ترکیب هر دو: SNMPv3 برای پوشش کامل و telemetry برای دستگاههای هسته.
13What is asymmetric routing and why does it hurt firewalls?مسیریابی نامتقارن چیست و چرا به فایروال آسیب میزند؟
Forward and return traffic take different paths. A stateful firewall that sees only the SYN-ACK (never the SYN) drops it as invalid. Fixes: symmetric design (align FHRP and routing), firewall clustering with state sync, or source NAT to pin the return path.
رفت و برگشت ترافیک از مسیرهای مختلف عبور میکند. فایروال stateful که فقط SYN-ACK را ببیند و SYN را ندیده باشد، بسته را نامعتبر میداند و حذف میکند.
- Symmetric designهمراستا کردن FHRP و مسیریابی.
- Cluster + state syncکلاستر فایروال با همگامسازی session.
- Source NATثابت کردن مسیر برگشت.
14How do you make a production change safely?یک تغییر را چطور امن در production اعمال میکنید؟
Change ticket with risk/impact → peer review → lab test (EVE-NG / CML) → backup → pre-checks (capture routes, neighbours, ARP) → maintenance window → out-of-band access → rollback timer (reload in, NX-OS checkpoint, XR commit confirmed, MikroTik Safe Mode) → post-check diff → update documentation.
- Change ticket · peer reviewتحلیل ریسک و بازبینی همکار.
- Lab testدر EVE-NG یا CML.
- Backup · pre-checksبکاپ و ثبت وضعیت قبل: مسیرها، همسایهها و ARP.
- Maintenance window · OOBپنجره نگهداری و دسترسی out-of-band.
- reload in · checkpoint · commit confirmed · Safe Modeتایمر بازگشت خودکار در صورت قطع دسترسی.
- Post-checks · documentationمقایسه با قبل و بهروزرسانی مستندات.
15HSRP vs VRRP, and why preempt matters?تفاوت HSRP و VRRP و اهمیت preempt؟
HSRP: Cisco, active/standby, preempt off by default. VRRP: open standard, master/backup, preempt on by default, can use a real interface IP as the VIP. Without preempt, a recovered higher-priority router doesn't take the role back, so the gateway drifts away from the STP root / vPC primary. Combine with tracking.
- HSRPسیسکو؛ preempt بهطور پیشفرض خاموش.
- VRRPاستاندارد؛ preempt بهطور پیشفرض روشن؛ میتواند IP واقعی اینترفیس را بهعنوان IP مجازی استفاده کند.
- preemptبدون آن، روتر اصلی بعد از برگشتن نقشش را پس نمیگیرد و گیتوی از روت STP جدا میماند. همیشه همراه track.
16What is a VRF? Give real use cases.VRF چیست؟ چند کاربرد واقعی بگویید.
Multiple isolated routing tables on one device. Uses: management VRF, guest vs corporate isolation, overlapping customer address space in MPLS L3VPN, the vPC keepalive VRF, a PCI segment whose inter-VRF traffic is forced through a firewall.
چند جدول مسیریابی جدا و ایزوله روی یک دستگاه. کاربردها:
- Management VRFجدا کردن ترافیک مدیریت.
- Guest / IoTجدا کردن مهمان و دستگاههای IoT از شبکه سازمان.
- MPLS L3VPNمشتریهایی با آدرسهای تکراری.
- vPC keepaliveVRF مخصوص heartbeat.
- PCI segmentترافیک بین VRFها اجباراً از فایروال عبور کند.
17How does SD-WAN choose a path for VoIP?SD-WAN چطور مسیر VoIP را انتخاب میکند؟
Health probes (ICMP/HTTP/TWAMP) measure latency, jitter and loss per underlay. An SD-WAN rule matches VoIP (DSCP EF, application signature or SIP ports) and picks the member that meets the SLA (e.g. 150 ms / 30 ms / 1 %), failing over when thresholds are breached; FEC or packet duplication can help on lossy links.
- Health probesبا ICMP، HTTP یا TWAMP، تأخیر، jitter و loss هر لینک اندازهگیری میشود.
- SD-WAN ruleترافیک VoIP با DSCP EF، شناسایی اپلیکیشن یا پورتهای SIP تشخیص داده میشود.
- SLA 150 ms / 30 ms / 1%لینکی انتخاب میشود که این آستانهها را رعایت کند؛ با نقض آستانه جابهجا میشود.
- FEC · packet duplicationدر لینکهای پرخطا کمک میکند.
18What would you automate first in a new network?در یک شبکه جدید اول چه چیزی را خودکار میکنید؟
Read-only wins first: nightly config backups to Git, inventory/facts collection, compliance checks (NTP, SNMPv3, AAA, banners). Then templated changes (VLANs, user ports, firewall objects) with dry-run/diff, and finally a source of truth (NetBox) driving configuration.
- اول فقطخواندنیبکاپ شبانه کانفیگ در Git، جمعآوری inventory و بررسی انطباق؛ مثل NTP، SNMPv3 و AAA.
- بعد تغییرات قالبدارVLAN، پورت کاربر و آبجکت فایروال، با اجرای آزمایشی.
- Source of truthدر نهایت NetBox که کانفیگها را تولید کند.
19Users reach sites by IP but not by name — what do you check?کاربران با IP به سایت میرسند ولی با نام نه — چه چیزی را بررسی میکنید؟
DNS: resolver handed out by DHCP (option 6), reachability of UDP/TCP 53, DNS filtering on the firewall, internal forwarders, clock/DNSSEC issues, split-DNS for VPN users; test with dig @server name from both client and server.
- DHCP option 6سرور DNS که به کاربر داده شده درست است؟
- UDP/TCP 53دسترسی به سرور DNS باز است؟
- DNS filteringفایروال جلوی DNS را نگرفته؟
- Forwarders · split-DNSforwarderهای داخلی، و DNS جداگانه برای کاربران VPN.
- dig @server nameتست از سمت کاربر و از سمت سرور.
20How do you secure an internet-facing MikroTik?یک میکروتیک متصل به اینترنت را چطور امن میکنید؟
Latest stable RouterOS; replace the default admin; disable unused services (telnet, ftp, www, api); restrict Winbox/SSH to the management subnet; drop input from WAN except established/related/VPN; disable MAC server and neighbour discovery on WAN; turn off DNS allow-remote-requests on WAN (open resolver); log to syslog; keep backups.
- RouterOS stableآخرین نسخه پایدار.
- adminتغییر کاربر پیشفرض.
- /ip serviceخاموش کردن سرویسهای بلااستفاده (telnet، ftp، www، api) و محدود کردن Winbox و SSH به شبکه مدیریت.
- Firewall inputحذف ترافیک ورودی از WAN، بهجز اتصالات برقرار و VPN.
- MAC server · neighbor discoveryروی WAN خاموش شوند.
- allow-remote-requestsDNS روی WAN باز نباشد تا resolver عمومی نشوید.
- syslog · backupارسال لاگ و بکاپ منظم.
21What is NAT-T and why does IPsec need it?NAT-T چیست و چرا IPsec به آن نیاز دارد؟
ESP is IP protocol 50 — no ports, so PAT can't multiplex it; AH breaks completely because NAT alters the header it authenticates. IKE detects NAT (NAT-D payloads) and moves IKE + ESP into UDP 4500, giving PAT a port to track; keepalives hold the mapping open.
- ESPپروتکل شماره ۵۰ است و پورت ندارد، پس PAT نمیتواند آن را تفکیک کند.
- AHکاملاً خراب میشود، چون NAT هدری را عوض میکند که AH از آن محافظت میکند.
- NAT-TIKE وجود NAT را تشخیص میدهد و IKE و ESP را داخل UDP 4500 میبرد تا PAT پورتی برای دنبال کردن داشته باشد؛ keepalive هم ترجمه را باز نگه میدارد.
22How do you document a network?شبکه را چطور مستند میکنید؟
Physical, L2 and L3 diagrams; IPAM; standards (naming, VLAN/IP plan, config templates, hardening baseline); runbooks per common incident; change log — all versioned and updated after every change.
- دیاگرامهافیزیکی، لایه ۲ و لایه ۳.
- IPAMمدیریت آدرسها.
- استانداردهانامگذاری، طرح IP و VLAN، قالب کانفیگ و baseline امنیتی.
- Runbooksراهنمای قدمبهقدم برای مشکلات رایج.
- Change log · Gitهمه نسخهدار و بعد از هر تغییر بهروز.
23A Docker container has no network but the host does — why?کانتینر داکر شبکه ندارد ولی میزبان دارد — چرا؟
Check: ip_forward disabled; Docker's NAT rules flushed by another firewall tool; the bridge subnet (172.17.0.0/16) overlapping a corporate/VPN range; DNS inside the container; MTU on the host uplink (VPN) lower than docker0.
- ip_forwardغیرفعال است؟
- iptables / nftablesابزار فایروال دیگری قوانین NAT داکر را پاک کرده؟
- 172.17.0.0/16رنج پیشفرض داکر با شبکه سازمان یا VPN همپوشانی دارد؟
- DNS · MTUDNS داخل کانتینر، و MTU کمتر روی لینک VPN میزبان.
24Tell me about a major outage you handled.از یک قطعی بزرگ که مدیریت کردهاید بگویید.
Use STAR: Situation (scale, impact) → Task (your role) → Action (isolation steps, tools, communication, decisions under pressure) → Result (MTTR, RCA, permanent fix, new alert, process change). Quantify. Prepare 2–3 stories: an outage, a design project, an escalation or conflict.
- Situationمقیاس و تأثیر.
- Taskنقش شما.
- Actionمراحل ایزولهسازی، ابزارها، ارتباطات و تصمیمها زیر فشار.
- Resultزمان رفع، تحلیل علت، راهحل دائمی و هشدار جدید. عدد بدهید.
دو یا سه داستان آماده داشته باشید: یک قطعی، یک پروژه طراحی و یک موقعیت پرتنش.
25Incident vs problem in ITIL?تفاوت Incident و Problem در ITIL؟
Incident = an unplanned interruption; goal: restore service fast (workarounds allowed). Problem = the underlying cause of one or more incidents; goal: RCA and a permanent fix, tracked as a known error until resolved through a change.
- Incidentاختلال برنامهریزینشده؛ هدف برگرداندن سریع سرویس است، حتی با راهحل موقت.
- Problemعلت ریشهای یک یا چند حادثه؛ هدف رفع دائمی از طریق Change است.
Local Market Notesنکات بازار ایران
MikroTik
- Everywhere: branch routers, ISP edge, PtP/PtMP radio, hotspot.
- Know v6 → v7: new routing/OSPF/BGP menus, routing tables, WireGuard, new wifi stack.
- Winbox, CHR (virtual router), Netinstall, licence levels, CAPsMAN, The Dude.
- همهجا هست: روتر شعب، لبه ISP، لینکهای رادیویی و هاتاسپات.
- تفاوتهای v6 و v7 را بدانید: منوهای جدید مسیریابی، جداول مسیریابی، WireGuard و پشته جدید وایفای.
- Winbox، CHR، Netinstall، سطوح لایسنس، CAPsMAN و The Dude.
FortiGate
- The most common enterprise NGFW in the market.
- Expect: policies, SD-WAN, IPsec, HA, VDOMs, upgrade paths — and the 7.6.3 SSL-VPN tunnel-mode removal.
- رایجترین فایروال سازمانی در بازار.
- سؤال درباره policy، SD-WAN، IPsec، HA، VDOM، مسیر ارتقا و حذف SSL-VPN tunnel mode در نسخه 7.6.3 محتمل است.
Cisco
- Catalyst/Nexus in data centres and large enterprises.
- Licensing, support contracts and software downloads from US vendors are often restricted — be ready to talk about lifecycle, spares strategy, config backups and careful upgrade planning.
- Catalyst و Nexus در دیتاسنترها و سازمانهای بزرگ.
- لایسنس، قرارداد پشتیبانی و دانلود نرمافزار Vendorهای آمریکایی معمولاً محدود است؛ آماده صحبت درباره چرخه عمر تجهیزات، قطعات یدکی، بکاپ کانفیگ و برنامهریزی دقیق ارتقا باشید.
Connectivity & toolingاتصال و ابزارها
- International connectivity can be unstable → multi-ISP redundancy, tunnelling skills and external-reachability monitoring are valued (always within company policy and the law).
- Open-source monitoring dominates: Zabbix + Grafana, Prometheus, Wazuh/ELK; PRTG in smaller organisations.
- Lab: EVE-NG, GNS3, Cisco CML, MikroTik CHR, FortiGate VM, pfSense/OPNsense VMs.
- اتصال بینالملل ممکن است ناپایدار باشد؛ افزونگی چند ISP، مهارت تونلزنی و پایش دسترسی خارجی ارزشمند است (همیشه در چارچوب سیاست سازمان و قانون).
- مانیتورینگ متنباز رایج است: Zabbix و Grafana، Prometheus و Wazuh/ELK؛ PRTG در سازمانهای کوچکتر.
- محیط تمرین: EVE-NG، GNS3، Cisco CML، MikroTik CHR، FortiGate VM و pfSense/OPNsense.
Ports & Numbersپورتها و اعداد کلیدی
Blueprint & Exam Factsبلوپرینت و مشخصات آزمون
- 120 minutes · multiple choice, drag-and-drop, performance-based (lab) items · US$400.
- Core exam for CCNP Enterprise and CCIE Enterprise Infrastructure/Wireless; passing alone earns Cisco Certified Specialist – Enterprise Core.
- v1.2 is dual-stack (IPv4 + IPv6) throughout. Compared with v1.0/1.1, the separate wireless domain is gone, and PTP, multicast detail, EEM, Catalyst Center AI workflows and SD-WAN Manager APIs are explicit.
- Blueprint verbs matter: Describe/Explain = theory, Interpret = read configs/outputs, Configure/Verify/Troubleshoot = hands-on CLI.
- 120 min · US$400سؤالات چندگزینهای، drag-and-drop و آزمایشگاهی.
- CCNP · CCIE Enterpriseآزمون اصلی این مدرکهاست؛ قبولی بهتنهایی مدرک Specialist – Enterprise Core میدهد.
- v1.2در همه بخشها dual-stack است؛ حوزه جداگانه وایرلس حذف شده و PTP، جزئیات multicast، EEM، قابلیتهای AI در Catalyst Center و API مربوط به SD-WAN Manager اضافه شدهاند.
- Describe · Interpret · Configureفعلهای بلوپرینت: تئوری، خواندن کانفیگ و خروجی، و کار عملی با CLI.
1.0 Architecture — Design · HA · SD-WAN · SD-Access · QoS۱٫۰ معماری — طراحی، HA، SD-WAN، SD-Access و QoS
Enterprise designطراحی شبکه سازمانی
- 3-tier: access → distribution → core. Scales for large campuses; distribution is the L2/L3 boundary and aggregation point.
- 2-tier (collapsed core): distribution + core merged. Cheaper for small/medium sites.
- Fabric: leaf-spine or SD-Access overlay; every leaf is equidistant, routed underlay, VXLAN overlay.
- Cloud: IaaS / SaaS / hybrid connectivity (IPsec, direct interconnects, SD-WAN cloud on-ramp).
- Prefer routed access (L3 to the access switch) to remove STP from the uplinks, or L2 access with a single STP root at distribution.
- 3-tieraccess، distribution و core؛ برای کمپوس بزرگ. لایه distribution مرز لایه ۲ و ۳ است.
- 2-tier (collapsed core)distribution و core یکی میشوند؛ ارزانتر برای سایت کوچک و متوسط.
- Fabricleaf-spine یا SD-Access؛ زیرساخت مسیریابیشده و overlay با VXLAN.
- Cloudاتصال به IaaS، SaaS و هیبرید با IPsec، اتصال مستقیم یا SD-WAN.
- Routed accessلایه ۳ تا سوئیچ دسترسی؛ STP از آپلینکها حذف میشود.
High availabilityدسترسپذیری بالا
- Redundancy: dual links, dual devices, dual PSUs/supervisors.
- FHRP: HSRP / VRRP / GLBP give hosts a virtual gateway.
- SSO (Stateful Switchover): standby supervisor (or StackWise Virtual peer) has synchronised state and takes over without dropping L2 sessions.
- NSF (Non-Stop Forwarding): data plane keeps forwarding during a control-plane switchover; routing neighbours help via graceful restart. Paired as SSO/NSF.
- NSR (Non-Stop Routing): routing state is synced too, so neighbours don't even notice.
- StackWise / StackWise Virtual: multiple chassis = one logical switch, multichassis EtherChannel to neighbours.
- Redundancyلینک، دستگاه، منبع تغذیه و سوپروایزر دوتایی.
- FHRPگیتوی مجازی برای هاستها.
- SSOسوپروایزر پشتیبان وضعیت همگام دارد و بدون قطع sessionهای لایه ۲ جایگزین میشود.
- NSF · graceful restartلایه داده در زمان تعویض control plane به ارسال ادامه میدهد و همسایهها کمک میکنند؛ معمولاً با هم: SSO/NSF.
- NSRوضعیت مسیریابی هم همگام است و همسایهها متوجه تعویض نمیشوند.
- StackWise · StackWise Virtualچند شاسی بهصورت یک سوئیچ منطقی، با Multi-chassis EtherChannel.
Interpreting QoS configsتفسیر کانفیگ QoS
- MQC = class-map (classify) → policy-map (action) → service-policy (attach, input/output).
- Marking fields: DSCP (6 bits of the ToS byte) and ECN (2 bits); legacy IP Precedence (3 bits); CoS / PCP (3 bits in the 802.1Q tag) — only exists on trunks.
- Classification tools: ACLs, DSCP/CoS, NBAR2 (application recognition).
- Token bucket:
CIR = Bc / Tc. Single-rate two-colour (conform/exceed), single-rate three-colour (adds Be → violate), two-rate three-colour (CIR + PIR). priority= LLQ (strict, policed under congestion).bandwidth= CBWFQ guarantee.shape average= buffer to rate.police= drop/remark.fair-queue,random-detect(WRED).- Read
show policy-map interface: offered rate, drops per class, queue depth.
- class-map → policy-map → service-policyدستهبندی، تعیین عمل، و اعمال روی اینترفیس در جهت ورودی یا خروجی.
- DSCP · ECN · CoSشش بیت از بایت ToS بههمراه دو بیت ECN؛ CoS سه بیت در تگ 802.1Q است و فقط روی ترانک وجود دارد.
- ACL · DSCP · NBAR2ابزارهای دستهبندی؛ NBAR2 اپلیکیشن را تشخیص میدهد.
- CIR = Bc / Tctoken bucket؛ مدلهای single-rate two-color، single-rate three-color (با Be) و two-rate three-color (با CIR و PIR).
- priority · bandwidth · shape · policeصف اولویت، تضمین پهنای باند، نگه داشتن در صف تا نرخ مشخص، و حذف یا علامتگذاری مجدد.
- show policy-map interfaceنرخ ورودی و دراپ هر کلاس را اینجا بخوانید.
2.0 Virtualization — VRF · GRE · IPsec · LISP · VXLAN۲٫۰ مجازیسازی — VRF، GRE، IPsec، LISP و VXLAN
Device virtualizationمجازیسازی دستگاه
- Type 1 (bare-metal) hypervisor runs on hardware: VMware ESXi, Microsoft Hyper-V, Xen, KVM (kernel-integrated). Type 2 (hosted) runs on an OS: VirtualBox, VMware Workstation/Fusion.
- VM = full guest OS with virtual CPU/RAM/NIC/disk; isolated, portable (vMotion). Containers share the host kernel — lighter but less isolation.
- Virtual switching: vSwitch / vSphere Distributed Switch, Open vSwitch; VLAN tagging toward the physical trunk. NFV examples: Catalyst 8000V, NFVIS.
- Type 1 · Type 2اولی مستقیم روی سختافزار (ESXi، Hyper-V، Xen، KVM)؛ دومی روی یک سیستمعامل (VirtualBox، VMware Workstation).
- VM ↔ containerماشین مجازی سیستمعامل کامل دارد؛ کانتینر کرنل میزبان را مشترک استفاده میکند، سبکتر ولی با جداسازی کمتر.
- vSwitch · Distributed Switch · Open vSwitchسوئیچ مجازی با تگ VLAN به سمت ترانک فیزیکی؛ نمونه NFV: Catalyst 8000V.
VRF-lite
- Each VRF = own RIB/FIB; interfaces belong to exactly one VRF. Overlapping addresses allowed.
- Adding an interface to a VRF removes its IP address — re-enter it.
- Routing protocols run per VRF (
router ospf 10 vrf GUEST,address-family ipv4 vrf Xunder BGP). - Verify:
show vrf,show ip route vrf X,ping vrf X 10.1.1.1,show ip arp vrf X.
- RIB / FIB per VRFهر VRF جدول مستقل دارد و هر اینترفیس فقط عضو یک VRF است؛ آدرس تکراری مجاز است.
- vrf forwardingآدرس IP اینترفیس را پاک میکند؛ دوباره وارد کنید.
- router ospf 10 vrf Xپروتکلهای مسیریابی برای هر VRF جداگانه اجرا میشوند.
- show vrf · ping vrf Xابزارهای بررسی.
vrf definition GUEST
rd 65001:20 ! optional for VRF-lite
address-family ipv4
address-family ipv6
!
interface GigabitEthernet0/0/1.20
encapsulation dot1Q 20
vrf forwarding GUEST ! wipes the IP — configure address after this
ip address 172.16.20.1 255.255.255.0
ipv6 address 2001:db8:20::1/64
!
router ospf 20 vrf GUEST
network 172.16.20.0 0.0.0.255 area 0
!
ip route vrf GUEST 0.0.0.0 0.0.0.0 172.16.99.1
! show vrf · show ip route vrf GUEST · ping vrf GUEST 172.16.20.10interface Tunnel0
ip address 172.16.0.1 255.255.255.252
ipv6 address 2001:db8:ff::1/64
tunnel source GigabitEthernet0/0/0
tunnel destination 203.0.113.2
keepalive 5 3
ip mtu 1400 ! GRE adds 24 bytes (20 IP + 4 GRE)
ip tcp adjust-mss 1360
!
router ospf 1
network 172.16.0.0 0.0.0.3 area 0
! TRAP: if the route to the tunnel destination is learned THROUGH the tunnel →
! "%TUN-5-RECURDOWN: Tunnel0 temporarily disabled due to recursive routing"
! fix: static/IGP route to 203.0.113.2 via the physical interface, never via Tunnel0
! verify: show interface tunnel0 · show ip ospf neighborcrypto ikev2 proposal PROP
encryption aes-cbc-256
integrity sha256
group 19
crypto ikev2 policy POL
proposal PROP
crypto ikev2 keyring KR
peer R2
address 203.0.113.2
pre-shared-key STRONG_PSK
crypto ikev2 profile IKEV2-PROF
match identity remote address 203.0.113.2 255.255.255.255
authentication remote pre-share
authentication local pre-share
keyring local KR
!
crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmac
mode tunnel
crypto ipsec profile IPSEC-PROF
set transform-set TS
set ikev2-profile IKEV2-PROF
!
interface Tunnel1
ip address 172.16.1.1 255.255.255.252
tunnel source GigabitEthernet0/0/0
tunnel mode ipsec ipv4
tunnel destination 203.0.113.2
tunnel protection ipsec profile IPSEC-PROF
! GRE over IPsec instead: keep "tunnel mode gre ip" + tunnel protection
! verify: show crypto ikev2 sa · show crypto ipsec sa (encaps/decaps) · show crypto sessionLISP UDP 4342 / 4341
- Splits identity from location: EID (endpoint identifier — who) and RLOC (routing locator — where).
- ETR registers its EID prefixes with the Map-Server (Map-Register). ITR asks the Map-Resolver (Map-Request) → forwarded to the ETR (or proxied by MS) → Map-Reply → cached.
- xTR = ITR + ETR. PITR/PETR connect LISP to non-LISP sites.
- Control messages UDP 4342; data encapsulation UDP 4341. In SD-Access, data uses VXLAN instead.
- EID · RLOCهویت را از مکان جدا میکند: اولی یعنی چه کسی، دومی یعنی کجا.
- ETR → Map-Server · ITR → Map-ResolverETR پیشوندهای خود را ثبت میکند؛ ITR سؤال میکند و پاسخ را در حافظه نگه میدارد.
- xTR · PITR / PETRاولی هر دو نقش را دارد؛ دومی برای ارتباط با سایتهای بدون LISP.
- UDP 4342 · 4341پیامهای کنترلی و داده؛ در SD-Access داده با VXLAN منتقل میشود.
VXLAN UDP 4789
- L2 frames tunnelled over an L3 underlay. VNI is 24 bits → ~16 million segments (vs 4094 VLANs).
- VTEP encapsulates/decapsulates; overhead 50 bytes → raise underlay MTU.
- BUM traffic: underlay multicast or ingress (head-end) replication.
- Control plane: flood-and-learn, or BGP EVPN (type 2 MAC/IP, type 3 inclusive multicast, type 5 IP prefix). SD-Access uses LISP + VXLAN-GPO.
- VNI 24-bitفریم لایه ۲ روی شبکه لایه ۳ تونل میشود؛ حدود ۱۶ میلیون بخش.
- VTEP · 50 bytesنقطه پایانی تونل؛ سربار ۵۰ بایت است، پس MTU زیرساخت را بالا ببرید.
- BUMترافیک broadcast و ناشناخته با multicast در زیرساخت یا تکثیر در مبدأ.
- Flood-and-learn · BGP EVPNدو روش control plane؛ SD-Access از LISP و VXLAN-GPO استفاده میکند.
3.1 Layer 2 — Trunking · EtherChannel · STP / RSTP / MST۳٫۱ لایه ۲ — ترانک، EtherChannel و STP/RSTP/MST
Trunking & VTPترانک و VTP
- Troubleshoot trunks:
show interfaces trunk(mode, native VLAN, allowed / active / forwarding VLANs),show interfaces Gi1/0/1 switchport, CDP "native VLAN mismatch". - A VLAN must exist in the database and be allowed on the trunk, and not be pruned or STP-blocked.
- VTP: server / client / transparent / off; v3 adds a primary server and protects against accidental overwrites. A switch with a higher revision number joining the domain can wipe VLANs (v1/v2). Many designs use transparent or off.
- show interfaces trunkحالت، native VLAN و VLANهای مجاز، فعال و در حال ارسال؛ CDP ناهمخوانی native VLAN را گزارش میکند.
- شرط عبور VLANدر دیتابیس تعریف شده، روی ترانک مجاز و توسط STP مسدود نشده باشد.
- VTPحالتهای server، client، transparent و off؛ نسخه ۳ primary server دارد و جلوی بازنویسی تصادفی را میگیرد. در نسخه ۱ و ۲ سوئیچی با revision بالاتر میتواند VLANها را پاک کند؛ بیشتر طراحیها transparent یا off هستند.
EtherChannel detailsجزئیات EtherChannel
- LACP: up to 16 configured ports, 8 active + 8 hot-standby.
lacp system-priority(lower wins, decides which ports are active),lacp port-priority,lacp rate fast(1 s PDUs),port-channel min-links. - Mismatched members → suspended (
s) or err-disabled (EtherChannel misconfig guard). - L3 EtherChannel:
no switchporton the port-channel and members; IP on the port-channel. - Verify:
show etherchannel summary(P = bundled, s = suspended, I = stand-alone, D = down),show lacp neighbor,show etherchannel load-balance.
- 16 ports · 8 activeLACP تا ۱۶ پورت را میپذیرد: ۸ فعال و ۸ پشتیبان.
- lacp system-priority · port-priority · rate fastعدد کمتر برنده است و تعیین میکند کدام پورتها فعال باشند؛ rate fast یعنی ارسال PDU هر ثانیه.
- عضو ناهمخوانمعلق (s) یا خاموش (err-disable) میشود.
- no switchportبرای EtherChannel لایه ۳ روی پورتچنل و اعضا؛ IP روی پورتچنل.
- show etherchannel summaryP یعنی عضو، s یعنی معلق، I یعنی مستقل و D یعنی قطع.
spanning-tree pathcost method long): 1G = 20 000 · 10G = 2 000.روش short: ده مگ = ۱۰۰، صد مگ = ۱۹، گیگ = ۴، ده گیگ = ۲. روش long: گیگ = ۲۰٬۰۰۰ و ده گیگ = ۲٬۰۰۰.shut/no shut or errdisable recovery cause bpduguard.با دریافت BPDU پورت err-disable میشود؛ بازگردانی با shut/no shut یا errdisable recovery.spanning-tree mode rapid-pvst
spanning-tree vlan 10,20 root primary ! sets 24576 (or lower than current root)
spanning-tree vlan 30,40 root secondary ! 28672
spanning-tree portfast default ! all access ports
spanning-tree portfast bpduguard default
spanning-tree loopguard default
!
! MST alternative
spanning-tree mode mst
spanning-tree mst configuration
name CAMPUS
revision 1
instance 1 vlan 10-19
instance 2 vlan 20-29
spanning-tree mst 1 priority 24576
spanning-tree mst 2 priority 28672
!
interface GigabitEthernet1/0/48
spanning-tree guard root ! distribution port facing access
! show spanning-tree vlan 10 · show spanning-tree mst configuration · show spanning-tree inconsistentports3.2 Layer 3 — EIGRP · OSPFv2/v3 · eBGP · PBR · IPv6۳٫۲ لایه ۳ — EIGRP، OSPFv2/v3، eBGP، PBR و IPv6
variance (only feasible successors). OSPF equal-cost only.هر دو ECMP دارند. EIGRP با variance توزیع بار نامساوی هم دارد (فقط روی feasible successorها).EIGRP exam depth
- Packets: Hello, Update, Query, Reply, Ack (reliable via RTP).
- Classic metric:
256 × (10^7 / min-BW-kbps + Σdelay-µs / 10). Wide metrics (named mode) scale for >10G links. - FD = total metric to destination; RD/AD = neighbour's metric. Feasibility condition: RD < FD of successor → feasible successor (loop-free backup).
- Neighbours need: same AS, K-values, subnet, authentication.
eigrp stubstops spokes being queried → prevents SIA.ip summary-address eigrpper interface.- Verify:
show ip eigrp neighbors,show ip eigrp topology [all-links],show ip protocols.
- Hello · Update · Query · Reply · Ackانواع بسته؛ ارسال مطمئن با RTP.
- 256 × (10^7 / BW + delay / 10)متریک کلاسیک؛ wide metric در named mode برای لینکهای بالای ۱۰ گیگ.
- FD · RDمتریک کل تا مقصد، و متریکی که همسایه اعلام کرده. اگر RD کمتر از FD باشد، آن همسایه feasible successor است.
- شرط همسایگیAS، ضریبهای متریک، subnet و احراز هویت یکسان.
- eigrp stubاز Query گرفتن شعب جلوگیری میکند.
- show ip eigrp neighbors · topologyابزارهای بررسی.
neighbor).همسایهها دستی تعریف میشوند.OSPFv2 exam depth
- Packets: 1 Hello · 2 DBD · 3 LSR · 4 LSU · 5 LSAck.
- Router-ID: manual → highest loopback IP → highest active interface IP. Change needs
clear ip ospf process. - DR election: highest priority (default 1; 0 = never DR), then highest RID. Not pre-emptive.
- LSAs: 1 Router · 2 Network (DR) · 3 Summary (ABR) · 4 ASBR-Summary · 5 External (E2 default, metric fixed; E1 adds internal cost) · 7 NSSA.
- Areas: stub (no 5) · totally stubby (no 3/4/5, default route) · NSSA (7 instead of 5) · totally NSSA.
- Summarisation:
area 1 range 10.1.0.0 255.255.0.0on ABR (inter-area);summary-addresson ASBR (external). - Filtering:
distribute-list … inremoves routes from the local RIB only (LSAs still flood);area 1 filter-list prefix X in|outfilters type-3 LSAs on the ABR;area range … not-advertise. passive-interface default+no passive-interfaceon links that need neighbours.- Path preference: intra-area (O) > inter-area (O IA) > E1 > E2.
- Hello · DBD · LSR · LSU · LSAckپنج نوع بسته.
- Router-IDدستی، سپس بالاترین IP روی loopback، سپس بالاترین IP اینترفیس فعال؛ تغییرش با clear ip ospf process اعمال میشود.
- DR electionبالاترین priority (پیشفرض ۱؛ صفر یعنی هرگز)، سپس بالاترین Router-ID. بعد از انتخاب، با آمدن روتر بهتر عوض نمیشود.
- LSA 1 · 2 · 3 · 4 · 5 · 7مسیرهای خارجی E2 پیشفرضاند و متریک ثابت دارند؛ E1 هزینه داخلی را هم اضافه میکند.
- Stub · Totally stubby · NSSA · Totally NSSAانواع area.
- area range · summary-addressخلاصهسازی روی ABR و ASBR.
- distribute-list in · area filter-listاولی فقط مسیر را از جدول محلی حذف میکند و LSA همچنان پخش میشود؛ دومی روی ABR جلوی LSA نوع ۳ را میگیرد.
- passive-interface defaultهمه اینترفیسها passive و فقط لینکهای لازم فعال.
- O > O IA > E1 > E2ترتیب ترجیح مسیرها.
OSPFv3 IPv6
- Enabled per interface:
ipv6 ospf 1 area 0(orospfv3 1 ipv6 area 0with address families). Needsipv6 unicast-routing. - Neighbours form over link-local addresses; runs per link, not per subnet.
- Router-ID is still 32-bit — set it manually on IPv6-only routers.
- Multicast FF02::5 (all routers), FF02::6 (DR/BDR).
- LSA changes: type 3 = Inter-Area-Prefix, type 4 = Inter-Area-Router, new type 8 Link and type 9 Intra-Area-Prefix; types 1/2 no longer carry prefixes.
- Authentication via IPsec (or the newer auth trailer).
- Verify:
show ospfv3 neighbor,show ipv6 route ospf.
- ipv6 ospf 1 area 0روی اینترفیس فعال میشود؛ نیاز به ipv6 unicast-routing دارد.
- Link-localهمسایگی روی آدرس link-local و برای هر لینک تشکیل میشود، نه برای هر subnet.
- Router-IDهمچنان ۳۲ بیتی است؛ روی روترهای فقط IPv6 دستی تنظیم کنید.
- FF02::5 · FF02::6آدرسهای مولتیکست.
- LSA 8 · LSA 9نوع Link و Intra-Area-Prefix اضافه شدهاند؛ LSA نوع ۱ و ۲ دیگر prefix حمل نمیکنند.
- IPsecروش احراز هویت.
- show ospfv3 neighborابزار بررسی.
ipv6 unicast-routing
router ospf 1
router-id 2.2.2.2
auto-cost reference-bandwidth 100000
passive-interface default
no passive-interface GigabitEthernet0/0/0
no passive-interface GigabitEthernet0/0/1
area 1 range 10.1.0.0 255.255.0.0 ! ABR summary for area 1
area 2 stub no-summary ! totally stubby (ABR side)
area 1 filter-list prefix BLOCK-10-1-99 out ! type-3 filter leaving area 1
!
interface GigabitEthernet0/0/0
ip ospf 1 area 0
ip ospf network point-to-point
ipv6 ospf 1 area 0
interface GigabitEthernet0/0/1
ip ospf 1 area 1
ip ospf priority 0 ! never DR
ipv6 ospf 1 area 1
!
ipv6 router ospf 1
router-id 2.2.2.2
!
ip prefix-list BLOCK-10-1-99 deny 10.1.99.0/24
ip prefix-list BLOCK-10-1-99 permit 0.0.0.0/0 le 32
! show ip ospf neighbor · show ip ospf interface brief · show ip ospf database
! show ip route ospf · show ospfv3 neighboreBGP exam depth
- Messages: OPEN, UPDATE, KEEPALIVE, NOTIFICATION, ROUTE-REFRESH. Cisco timers: keepalive 60 s, hold 180 s.
- States: Idle → Connect → Active → OpenSent → OpenConfirm → Established.
- Neighbour requirements: TCP 179 reachability, correct
remote-as, peering from the expected source IP (directly connected eBGP: TTL 1), matching password, unique router IDs. - Attributes: well-known mandatory — AS_PATH, NEXT_HOP, ORIGIN · well-known discretionary — LOCAL_PREF, ATOMIC_AGGREGATE · optional transitive — COMMUNITY, AGGREGATOR · optional non-transitive — MED.
- eBGP loop prevention: a route whose AS_PATH contains your own AS is dropped. eBGP sets next-hop to itself.
networkadvertises only an exact match already in the RIB (add a Null0 static for aggregates).- IPv6:
address-family ipv6+neighbor x activate; IPv4 unicast is active by default unlessno bgp default ipv4-unicast. - Verify:
show ip bgp summary(state/PfxRcd),show ip bgp(*valid,>best,iinternal; origin i/e/?),show ip bgp neighbors x advertised-routes.
- OPEN · UPDATE · KEEPALIVE · NOTIFICATION · ROUTE-REFRESHپیامها؛ تایمرهای سیسکو ۶۰ و ۱۸۰ ثانیه.
- Idle → … → Establishedحالات سشن.
- شرط همسایگیدسترسی TCP 179، remote-as درست، آدرس مبدأ مورد انتظار (در eBGP مستقیم TTL یک)، رمز یکسان و Router-ID یکتا.
- AS_PATH · NEXT_HOP · ORIGINattributeهای اجباری؛ LOCAL_PREF و ATOMIC_AGGREGATE اختیاری شناختهشده؛ COMMUNITY اختیاری و قابل انتقال؛ MED اختیاری و غیرقابل انتقال.
- eBGP loop preventionمسیری که AS خودتان در مسیرش باشد دور ریخته میشود.
- networkفقط prefixی را اعلام میکند که دقیقاً در جدول مسیریابی باشد.
- address-family ipv6برای IPv6 همراه activate لازم است.
- * · >در show ip bgp، ستاره یعنی معتبر و علامت بزرگتر یعنی بهترین مسیر.
router bgp 65001
bgp router-id 1.1.1.1
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 65002
neighbor 2001:db8:12::2 remote-as 65002
!
address-family ipv4
network 198.51.100.0 mask 255.255.255.0
neighbor 192.0.2.2 activate
address-family ipv6
network 2001:db8:100::/48
neighbor 2001:db8:12::2 activate
!
ip route 198.51.100.0 255.255.255.0 Null0
ipv6 route 2001:db8:100::/48 Null0
! show bgp ipv4 unicast summary · show bgp ipv6 unicast · show ip bgp 198.51.100.0Policy-Based Routingمسیریابی مبتنی بر Policy
- Overrides the routing table for matched traffic (source, protocol, port, packet length).
- Applied inbound on the ingress interface:
ip policy route-map X. Locally generated traffic needsip local policy route-map X. - Unmatched traffic (or a
denysequence) is routed normally. set ip next-hop verify-availabilityor tracking prevents black-holing.- Verify:
show route-map,show ip policy,debug ip policy.
- PBRبرای ترافیک منطبق، جدول مسیریابی را نادیده میگیرد؛ بر اساس مبدأ، پروتکل، پورت یا طول بسته.
- ip policy · ip local policyروی اینترفیس ورودی؛ ترافیکی که خود روتر تولید میکند دستور دوم را لازم دارد.
- ترافیک منطبقنشدهبهصورت عادی مسیریابی میشود.
- verify-availability · trackجلوگیری از گم شدن ترافیک وقتی نکستهاپ قطع است.
- show route-map · show ip policyابزارهای بررسی.
IPv6 essentials (dual-stack)مبانی IPv6 (dual-stack)
- Global unicast 2000::/3 · link-local FE80::/10 (every interface, used as next-hop by IGPs) · unique local FC00::/7 · multicast FF00::/8 (FF02::1 all nodes, FF02::2 all routers).
- NDP (ICMPv6) replaces ARP: RS/RA (router discovery), NS/NA (address resolution, DAD), redirect.
- Addressing: static, EUI-64 (MAC split + FFFE, 7th bit flipped), SLAAC from RA prefix, stateless or stateful DHCPv6.
- IPv6 ACLs end with implicit permit for ND (NA/NS) before the implicit deny.
- 2000::/3 · FE80::/10 · FC00::/7 · FF00::/8global unicast، link-local (روی همه اینترفیسها و نکستهاپ پروتکلهای مسیریابی)، unique local و multicast.
- NDPجایگزین ARP: RS و RA برای کشف روتر، NS و NA برای پیدا کردن آدرس و تشخیص تکراری بودن.
- EUI-64 · SLAAC · DHCPv6روشهای آدرسدهی.
- IPv6 ACLقبل از ممنوعیت ضمنی انتهایی، پیامهای ND بهطور ضمنی مجازند.
ip access-list extended GUEST-WEB
permit tcp 10.20.0.0 0.0.0.255 any eq 443
route-map PBR-GUEST permit 10
match ip address GUEST-WEB
set ip next-hop 192.0.2.1
interface Vlan20
ip policy route-map PBR-GUEST
! show route-map PBR-GUEST (match counters) · show ip policy3.3 IP Services — NTP/PTP · NAT · FHRP · Multicast۳٫۳ سرویسهای IP — NTP/PTP، NAT، FHRP و Multicast
NTP UDP 123
- Stratum 0 = reference clock (GPS/atomic); stratum 1 directly attached; up to 15; 16 = unsynchronised.
- Modes: client/server (
ntp server), symmetric peer (ntp peer), authoritative source (ntp master [stratum]), broadcast. - Authentication: key + trusted-key +
ntp authenticate; the server reference must use the key. - Verify:
show ntp status(synchronized, stratum),show ntp associations(*= sys.peer).
- Stratum 0 → 15 · 16صفر ساعت مرجع است و یک مستقیماً به آن وصل است؛ ۱۶ یعنی همگام نیست.
- server · peer · master · broadcastحالتهای کار.
- ntp authenticate · trusted-keyاحراز هویت.
- show ntp status · associationsستاره کنار یک سرور یعنی منبع انتخابشده.
PTP IEEE 1588
- Sub-microsecond accuracy with hardware timestamping (vs milliseconds for NTP). Used for industrial, finance, audio/video (AVB), 5G.
- BMCA (Best Master Clock Algorithm) elects the grandmaster.
- Clock roles: ordinary (master or slave), boundary clock (slave on one port, master on others), transparent clock (corrects residence time without terminating PTP).
- Messages: Sync, Follow_Up, Delay_Req, Delay_Resp, Announce (UDP 319 event / 320 general).
- Hardware timestampingدقت زیر میکروثانیه، در برابر میلیثانیه در NTP؛ برای صنعت، بورس، صوت و تصویر و 5G.
- BMCA → grandmasterالگوریتم انتخاب ساعت اصلی.
- Ordinary · Boundary · Transparentنقشهای ساعت: boundary روی یک پورت slave و روی بقیه master است؛ transparent فقط زمان عبور را اصلاح میکند.
- Sync · Follow_Up · Delay_Req · Delay_Resp · Announceپیامها.
interface GigabitEthernet0/0/0
ip nat outside
interface GigabitEthernet0/0/1
ip nat inside
!
ip nat inside source static 10.1.1.10 198.51.100.10 ! static 1:1
ip nat inside source static tcp 10.1.1.20 443 198.51.100.11 443 ! port forward
ip access-list standard NAT-IN
permit 10.1.0.0 0.0.255.255
ip nat pool POOL 198.51.100.32 198.51.100.62 netmask 255.255.255.224
ip nat inside source list NAT-IN pool POOL ! dynamic
ip nat inside source list NAT-IN interface GigabitEthernet0/0/0 overload ! PAT
! show ip nat translations · show ip nat statistics · clear ip nat translation *
!
ntp authentication-key 1 hmac-sha2-256 NTP_KEY ! older IOS: md5
ntp authenticate
ntp trusted-key 1
ntp server 10.0.0.1 key 1 prefer
ntp source Loopback0track 10 interface GigabitEthernet0/0/0 line-protocol
interface Vlan10
ip address 10.10.10.2 255.255.255.0
ipv6 address 2001:db8:10::2/64
standby version 2
standby 10 ip 10.10.10.1
standby 10 priority 110
standby 10 preempt delay minimum 30
standby 10 track 10 decrement 20
standby 10 authentication md5 key-string HSRP_KEY
standby 16 ipv6 autoconfig ! IPv6 group needs its own group number
!
fhrp version vrrp v3
interface Vlan20
ip address 10.20.20.2 255.255.255.0
vrrp 20 address-family ipv4
address 10.20.20.1 primary
priority 110
! show standby brief · show vrrp brief · show trackMulticast PIM · IGMP
- Ranges: 224.0.0.0/24 link-local (never routed) · 232.0.0.0/8 SSM · 239.0.0.0/8 administratively scoped. MAC:
01:00:5E+ low 23 bits of the group (32:1 overlap). - IGMPv2: join/leave, querier election, (*,G). IGMPv3: source filtering (INCLUDE/EXCLUDE) → required for SSM. IGMP snooping keeps multicast off ports without receivers. IPv6 equivalent: MLD.
- RPF check: a multicast packet is accepted only on the interface the router would use to reach the source (or RP on the shared tree) — prevents loops. Failures show as RPF drops.
- PIM-SM: receivers' DRs join toward the RP → shared tree (*,G). Source DR registers (unicast) to the RP. Last-hop router switches to the shortest-path tree (S,G) after the first packet (
spt-threshold 0default). - RP discovery: static, Auto-RP (Cisco, 224.0.1.39/40), BSR (standard). PIM-DM (flood-and-prune) is legacy.
- SSM: no RP; receivers specify (S,G) via IGMPv3 — simplest and most secure for one-to-many (IPTV).
- Bidir-PIM: only shared trees, traffic flows both ways via the RP — scales for many-to-many (trading, conferencing).
- MSDP (TCP 639): RPs exchange Source-Active messages — inter-domain multicast and Anycast-RP redundancy.
- 224.0.0.0/24 · 232/8 · 239/8link-local که مسیریابی نمیشود، SSM، و محدوده داخلی سازمان. MAC با پیشوند 01:00:5E و ۲۳ بیت پایین آدرس گروه.
- IGMPv2 · IGMPv3 · snooping · MLDپیوستن و ترک گروه؛ فیلتر بر اساس مبدأ که برای SSM لازم است؛ دور نگه داشتن ترافیک از پورتهای بدون گیرنده؛ معادل IPv6.
- RPF checkبسته فقط از اینترفیسی پذیرفته میشود که روتر برای رسیدن به مبدأ استفاده میکند؛ جلوی لوپ را میگیرد.
- PIM-SM · RPگیرندهها به سمت RP درخت مشترک (*,G) میسازند؛ مبدأ با Register به RP اطلاع میدهد؛ روتر آخر بعد از اولین بسته به درخت کوتاهترین مسیر (S,G) میرود.
- Static · Auto-RP · BSRروشهای پیدا کردن RP؛ PIM-DM قدیمی است.
- SSMبدون RP؛ گیرنده مبدأ را با IGMPv3 مشخص میکند؛ سادهترین و امنترین گزینه برای one-to-many مثل IPTV.
- Bidir-PIMفقط درخت مشترک و دوطرفه؛ برای حالت many-to-many.
- MSDP · TCP 639RPها اطلاعات مبدأهای فعال را مبادله میکنند؛ برای multicast بین دامنهها و Anycast-RP.
ip multicast-routing ! IOS-XE: "ip multicast-routing distributed" on some platforms
interface GigabitEthernet0/0/0
ip pim sparse-mode
interface Vlan10
ip pim sparse-mode
ip igmp version 3
ip pim rp-address 10.255.0.1
ip pim ssm default ! enable SSM for 232/8
! show ip mroute · show ip pim neighbor · show ip pim rp mapping · show ip igmp groups · show ip rpf 10.1.1.104.0 Network Assurance۴٫۰ Network Assurance
Diagnosticsابزارهای تشخیص
- Extended ping: source, size, DF bit, repeat, sweep —
ping 10.2.2.2 source Lo0 size 1500 df-bit. - Traceroute uses increasing TTL;
*= no reply (often ICMP filtered or rate-limited, not necessarily loss). - Conditional debug limits output:
debug condition interface Gi0/0/0ordebug condition ip 10.1.1.1; on IOS-XE data plane:debug platform condition ipv4 10.1.1.1/32 both→debug platform condition start. - Always:
terminal monitor(SSH),logging buffered,undebug all. Prefer buffer over console during debugs. - SNMP v3 authPriv; syslog levels 0–7 (lower = more severe);
logging trap informationalsends 0–6.
- Extended pingبا مبدأ، اندازه، بیت DF و تعداد.
- Tracerouteبا افزایش TTL؛ ستاره یعنی پاسخی نیامده، معمولاً فیلتر ICMP، نه لزوماً loss.
- debug condition · debug platform conditionمحدود کردن خروجی debug بر اساس اینترفیس یا IP؛ دومی برای لایه داده در IOS-XE.
- terminal monitor · logging buffered · undebug allهمیشه.
- SNMPv3 authPriv · syslog 0–7عدد کمتر یعنی جدیتر.
Catalyst Center ex-DNA Center
- Intent-based controller for campus/branch: Design (sites, IP pools, settings) → Policy (VNs, SGT policies) → Provision (PnP zero-touch, templates, SWIM image management) → Assurance (health scores, telemetry, issues with suggested fixes).
- Traditional workflows: CLI templates, inventory, config compliance. AI workflows: AI Network Analytics (baselines, anomaly detection), Machine Reasoning Engine (automated root-cause), AI assistant.
- Northbound Intent API (REST); southbound SSH/NETCONF/SNMP/telemetry to devices.
- Design → Policy → Provision → Assuranceسایت و استخر IP، سیاستها و SGT، راهاندازی خودکار (PnP، قالب، SWIM)، و امتیاز سلامت با پیشنهاد رفع مشکل.
- روش سنتی و AIقالب CLI، فهرست دستگاهها و انطباق کانفیگ؛ در کنار تحلیل مبتنی بر baseline، تشخیص ناهنجاری، تحلیل خودکار علت و دستیار AI.
- Intent APIAPI شمالی از نوع REST؛ ارتباط با دستگاهها با SSH، NETCONF، SNMP و telemetry.
flow record REC-V4
match ipv4 source address
match ipv4 destination address
match ipv4 protocol
match transport source-port
match transport destination-port
match interface input
collect counter bytes long
collect counter packets long
collect timestamp absolute first
!
flow exporter EXP-COLLECTOR
destination 10.0.0.50
source Loopback0
transport udp 2055
export-protocol netflow-v9 ! or ipfix
!
flow monitor MON-V4
record REC-V4
exporter EXP-COLLECTOR
cache timeout active 60
!
interface GigabitEthernet0/0/1
ip flow monitor MON-V4 input
! match = key fields (define a flow) · collect = non-key fields (counters)
! show flow monitor MON-V4 cache · show flow exporter statistics! Local SPAN (same switch)
monitor session 1 source interface Gi1/0/1 both
monitor session 1 destination interface Gi1/0/24
! RSPAN — VLAN must be remote-span and trunked end to end
vlan 999
remote-span
! source switch
monitor session 2 source vlan 10 rx
monitor session 2 destination remote vlan 999
! destination switch
monitor session 2 source remote vlan 999
monitor session 2 destination interface Gi1/0/24
! ERSPAN (routed, GRE) — source side
monitor session 3 type erspan-source
source interface Gi1/0/1 both
no shutdown
destination
erspan-id 10
ip address 10.2.2.2 ! analyser / destination switch
origin ip address 10.1.1.1
! ERSPAN destination side (switch decapsulates)
monitor session 4 type erspan-destination
destination interface Gi1/0/24
no shutdown
source
erspan-id 10
ip address 10.2.2.2
! show monitor session allip sla 1
icmp-echo 8.8.8.8 source-interface GigabitEthernet0/0/0
frequency 10
threshold 500
timeout 1000
ip sla schedule 1 life forever start-time now
!
track 1 ip sla 1 reachability
delay down 10 up 30
!
ip route 0.0.0.0 0.0.0.0 198.51.100.1 track 1 ! primary ISP
ip route 0.0.0.0 0.0.0.0 192.0.2.1 10 ! floating backup (AD 10)
!
! VoIP quality probe (needs "ip sla responder" on the far end)
ip sla 2
udp-jitter 10.9.9.9 16384 codec g711alaw
ip sla schedule 2 life forever start-time now
! show ip sla statistics · show ip sla configuration · show track! enable on IOS-XE
username netops privilege 15 secret STRONG_PASS
aaa new-model
aaa authentication login default local
aaa authorization exec default local
netconf-yang ! NETCONF over SSH, TCP 830
restconf ! RESTCONF over HTTPS
ip http secure-server
! show netconf-yang sessions · show platform software yang-management process
# NETCONF: XML-encoded RPCs over SSH (TCP 830)
# operations: get · get-config · edit-config · copy-config · delete-config · lock · unlock · close-session
# datastores: running · candidate · startup
# RESTCONF: HTTPS, JSON or XML (application/yang-data+json)
# GET=read · POST=create · PUT=create/replace · PATCH=merge · DELETE=remove
curl -s -u netops:STRONG_PASS -H "Accept: application/yang-data+json" \
"https://10.0.0.11/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1"remote-span VLAN.از طریق ترانکهای لایه ۲ در یک VLAN مخصوص remote-span.erspan-id.داخل GRE قرار گرفته (encapsulate) و در لایه ۳ تا هر آنالایزر قابلدسترس مسیریابی میشود.5.0 Security — Device Access · AAA · ACL · CoPP · Design۵٫۰ امنیت — دسترسی دستگاه، AAA، ACL، CoPP و طراحی
hostname R1
ip domain name corp.example
crypto key generate rsa modulus 3072
ip ssh version 2
!
enable algorithm-type scrypt secret ENABLE_PASS ! type 9 hash
username admin privilege 15 algorithm-type scrypt secret ADMIN_PASS
service password-encryption ! type 7 — weak, only obscures
security passwords min-length 12
login block-for 120 attempts 5 within 60
!
line console 0
login local
exec-timeout 10 0
line vty 0 15
login local
transport input ssh
access-class MGMT-ONLY in
exec-timeout 10 0
ip access-list standard MGMT-ONLY
permit 10.0.0.0 0.0.0.255
! privilege levels: 0 · 1 user EXEC · 15 privileged EXEC
! password types: 0 plain · 5 MD5 · 7 reversible · 8 PBKDF2 · 9 scryptaaa new-model ! enables AAA (vty switches to AAA immediately)
!
tacacs server ISE-1
address ipv4 10.0.0.20
key TACACS_KEY
aaa group server tacacs+ TAC-GRP
server name ISE-1
ip tacacs source-interface Loopback0
!
aaa authentication login default group TAC-GRP local
aaa authentication login CONSOLE local
aaa authorization exec default group TAC-GRP local if-authenticated
aaa authorization commands 15 default group TAC-GRP local if-authenticated
aaa accounting exec default start-stop group TAC-GRP
aaa accounting commands 15 default start-stop group TAC-GRP
!
line console 0
login authentication CONSOLE
! "local" is used ONLY if the server is unreachable — not if it rejects the user
! test aaa group TAC-GRP admin PASS new-code · debug aaa authentication · show tacacsip access-list extended WEB-IN
10 permit tcp any host 198.51.100.10 eq 443
20 permit icmp any any echo-reply
30 deny ip any any log
interface GigabitEthernet0/0/0
ip access-group WEB-IN in
!
ip access-list extended WEB-IN
15 permit tcp any host 198.51.100.10 eq 80 ! insert by sequence number
!
ipv6 access-list V6-IN
permit tcp any host 2001:db8:100::10 eq 443
permit icmp any any nd-na
permit icmp any any nd-ns
deny ipv6 any any log
interface GigabitEthernet0/0/0
ipv6 traffic-filter V6-IN in
! implicit end: IPv4 deny ip any any · IPv6 permit nd-na/nd-ns, then deny ipv6 any any
! (an explicit "deny ipv6 any any" removes the implicit ND permits — add them back)
! show access-lists (hit counters) · show ip interface Gi0/0/0! Routers (ISR/ASR/Catalyst 8000): custom MQC policy on the control plane
ip access-list extended COPP-MGMT
permit tcp 10.0.0.0 0.0.0.255 any eq 22
permit udp host 10.0.0.50 any eq snmp
ip access-list extended COPP-ROUTING
permit tcp any any eq bgp
permit ospf any any
class-map match-all CM-MGMT
match access-group name COPP-MGMT
class-map match-all CM-ROUTING
match access-group name COPP-ROUTING
policy-map PM-COPP
class CM-ROUTING
police 512000 conform-action transmit exceed-action transmit
class CM-MGMT
police 128000 conform-action transmit exceed-action drop
class class-default
police 64000 conform-action transmit exceed-action drop
control-plane
service-policy input PM-COPP
! show policy-map control-plane
! Catalyst 9000: only the system-defined policy is allowed — tune its pps rates
policy-map system-cpp-policy
class system-cpp-police-protocol-snooping
police rate 200 pps
control-plane
service-policy input system-cpp-policy
! show policy-map control-plane · cpp system-default (restore defaults)ACL rules for the examقواعد ACL برای آزمون
- Standard (1–99, 1300–1999): source only → place near destination. Extended (100–199, 2000–2699): src/dst/protocol/port → near source.
- One ACL per interface, per direction, per protocol.
- Wildcard:
0.0.0.0=host,255.255.255.255=any. Ports:eq lt gt neq range;establishedmatches TCP ACK/RST. - ACLs don't filter traffic generated by the router itself (outbound).
- Standard · Extendedاولی فقط مبدأ را بررسی میکند و نزدیک مقصد قرار میگیرد؛ دومی مبدأ، مقصد، پروتکل و پورت را بررسی میکند و نزدیک مبدأ.
- یک ACLبرای هر اینترفیس، هر جهت و هر پروتکل فقط یکی.
- host · any · establishedwildcard صفر و تمام ۲۵۵؛ آخری بستههای TCP با ACK یا RST را میگیرد.
- ترافیک خود روترACL خروجی آن را فیلتر نمیکند.
REST API securityامنیت REST API
- Transport: HTTPS/TLS only; validate certificates.
- Authentication: Basic (only over TLS), API keys, token-based (e.g. Catalyst Center
X-Auth-Token), OAuth 2.0 bearer tokens; short token lifetime. - Authorization: RBAC / least privilege per API user.
- Protect the API: rate limiting, input validation, logging/auditing, no secrets in URLs or code.
- HTTPSفقط با TLS و اعتبارسنجی گواهی.
- Basic · API key · token · OAuth 2.0Basic فقط روی TLS؛ توکن مثل X-Auth-Token در Catalyst Center؛ عمر توکن کوتاه.
- RBACمجوز بر اساس نقش و حداقل دسترسی.
- Rate limiting · validation · loggingمحدودیت نرخ، بررسی ورودی، ثبت رویداد، و نگذاشتن رمز در URL یا کد.
6.0 Automation & AI — Python · JSON · YANG · APIs · EEM۶٫۰ اتوماسیون و AI — Python، JSON، YANG، API و EEM
Python you must readپایتون در حد خواندن
- Types:
str,int,float,bool,list [ ](ordered, mutable),dict { }(key/value),tuple ( )(immutable). - Indentation defines blocks;
for,while,if/elif/else,def,try/except,import. json.loads()string → dict;json.dumps()dict → string.requests.get/post(url, headers=, json=, verify=);r.status_code,r.json().- Indexing nested data:
data["response"][0]["hostname"].
- str · int · float · bool · list · dict · tupleانواع داده؛ list ترتیبدار و قابل تغییر، dict کلید و مقدار، tuple غیرقابل تغییر.
- تورفتگیبلوکها را مشخص میکند؛ for، while، if، def و try/except.
- json.loads · json.dumps · requestsتبدیل رشته به dict و برعکس، و فراخوانی API.
- data["response"][0]["hostname"]دسترسی به داده تودرتو.
Valid JSON rulesقواعد JSON معتبر
- Keys and strings in double quotes only.
- Values: string, number,
true/false,null, object{ }, array[ ]— lowercase literals. - No trailing commas, no comments, no single quotes.
- Commas between pairs/elements, colon between key and value.
- "double quotes"کلیدها و رشتهها فقط با کوتیشن دوتایی.
- true · false · nullبا حروف کوچک؛ مقادیر دیگر: رشته، عدد، شیء و آرایه.
- ممنوعکامای اضافه در انتها، توضیح، و کوتیشن تکی.
- , :کاما بین عناصر و دونقطه بین کلید و مقدار.
{
"hostname": "core-sw1",
"managed": true,
"uptime_days": 412,
"location": null,
"interfaces": [
{ "name": "Ethernet1/1", "vlan": 10, "enabled": true },
{ "name": "Ethernet1/2", "vlan": 20, "enabled": false }
]
}import requests
from requests.auth import HTTPBasicAuth
BASE = "https://catalyst-center.example"
tok = requests.post(f"{BASE}/dna/system/api/v1/auth/token",
auth=HTTPBasicAuth("apiuser", "PASS"), verify=True)
token = tok.json()["Token"] # 200 OK → {"Token": "..."}
r = requests.get(f"{BASE}/dna/intent/api/v1/network-device",
headers={"X-Auth-Token": token, "Accept": "application/json"})
for dev in r.json()["response"]:
print(dev["hostname"], dev["managementIpAddress"], dev["softwareVersion"])import requests
BASE = "https://sdwan-manager.example"
s = requests.Session()
s.post(f"{BASE}/j_security_check", # form login → JSESSIONID cookie
data={"j_username": "apiuser", "j_password": "PASS"})
xsrf = s.get(f"{BASE}/dataservice/client/token").text
s.headers.update({"X-XSRF-TOKEN": xsrf}) # required for POST/PUT/DELETE
devices = s.get(f"{BASE}/dataservice/device").json()["data"]
for d in devices:
print(d["host-name"], d["system-ip"], d["reachability"])module example-interfaces {
namespace "urn:example:interfaces";
prefix exif;
container interfaces { // groups related nodes
list interface { // repeated entries, identified by a key
key "name";
leaf name { type string; } // single value
leaf enabled { type boolean; default true; }
leaf-list vlan { type uint16; } // list of single values
}
}
}
// Model families: IETF (standard) · OpenConfig (vendor-neutral, operator-driven) · native (vendor-specific)
// YANG = data model · NETCONF/RESTCONF/gNMI = transport · XML/JSON = encoding! 1) Collect data when an uplink goes down
event manager applet UPLINK-DOWN
event syslog pattern "Interface GigabitEthernet1/0/49, changed state to down"
action 1.0 cli command "enable"
action 2.0 cli command "show interface Gi1/0/49 | append flash:uplink-down.txt"
action 3.0 cli command "show logging | append flash:uplink-down.txt"
action 4.0 syslog priority critical msg "Gi1/0/49 down - diagnostics saved"
! 2) Nightly config backup
event manager applet NIGHTLY-BACKUP
event timer cron cron-entry "0 2 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "copy running-config flash:nightly.cfg" pattern "filename"
action 3.0 cli command ""
! 3) Block accidental reloads
event manager applet NO-RELOAD
event cli pattern "^reload" sync no skip yes
action 1.0 puts "reload is blocked by EEM - use the change process"
! 4) React to an IP SLA track
event manager applet ISP1-FAIL
event track 1 state down
action 1.0 syslog msg "ISP1 probe failed - traffic moved to backup"
! show event manager policy registered · show event manager history eventsENCOR Exam Traps & Rapid Reviewتلههای آزمون ENCOR و مرور سریع
- DTP auto + auto = access; LACP passive + passive and PAgP auto + auto never form.
- OSPF DR election is not pre-emptive; priority 0 = never DR/BDR.
- OSPF stuck in ExStart/Exchange = MTU; stuck in Init = one-way hellos; stuck in 2-Way between DROTHERs = normal.
distribute-list inin OSPF filters the local RIB only — LSAs still propagate.- OSPF summarisation only on ABR (
area range) / ASBR (summary-address). - E2 routes keep the same metric everywhere; E1 adds internal cost. Intra > inter > E1 > E2.
- EIGRP unequal-cost load-balancing only over feasible successors within
variance. - BGP
networkneeds an exact RIB match. Weight is Cisco-only and local; Local-Pref is AS-wide; MED is compared only between paths from the same neighbouring AS. - BGP stuck in Active = TCP not established (not "active and working").
- HSRP preempt is off by default, VRRP on. HSRPv2 needed for IPv6 and groups > 255.
- STP root guard → root-inconsistent; loop guard → loop-inconsistent; BPDU guard → err-disabled.
- MST region = same name + revision + VLAN mapping; otherwise the switch is a different region.
- GRE recursive routing = tunnel destination learned through the tunnel itself.
- VRF:
vrf forwardingremoves the interface IP. - VXLAN: 24-bit VNI, UDP 4789, 50-byte overhead. LISP: UDP 4342 control / 4341 data.
- SD-Access: LISP control · VXLAN data · TrustSec policy. SD-WAN: OMP control · IPsec data · BFD measures path quality.
- NTP stratum 16 = unsynchronised. PTP = IEEE 1588, BMCA elects the grandmaster.
- Multicast RPF check uses the unicast route back to the source. SSM = 232/8 + IGMPv3, no RP.
- Flexible NetFlow:
match= key fields,collect= non-key fields; order record → exporter → monitor → interface. - RSPAN needs a
remote-spanVLAN; ERSPAN uses GRE across L3. - AAA
localfallback is used only when the server is unreachable, not when it rejects credentials. - IPv6 ACLs implicitly permit ND before the implicit deny.
- Catalyst 9000 CoPP: only
system-cpp-policy, rates in pps. - NETCONF = SSH 830 + XML; RESTCONF = HTTPS + JSON/XML; PUT replaces, PATCH merges.
- Catalyst Center auth: POST
/dna/system/api/v1/auth/token→ headerX-Auth-Token. 401 = bad/missing credentials, 403 = authenticated but not allowed.
- DTP auto + autoنتیجه access است. LACP با passive + passive و PAgP با auto + auto هرگز تشکیل نمیشوند.
- OSPF DRبا آمدن روتر بهتر عوض نمیشود؛ priority صفر یعنی هرگز DR یا BDR.
- ExStart · Init · 2-Wayاولی یعنی MTU، دومی یعنی hello یکطرفه، سومی بین روترهای غیر DR طبیعی است.
- OSPF distribute-list inفقط جدول محلی را فیلتر میکند و LSA همچنان پخش میشود.
- area range · summary-addressخلاصهسازی OSPF فقط روی ABR و ASBR.
- E1 · E2E2 همهجا متریک ثابت دارد و E1 هزینه داخلی را اضافه میکند. ترتیب: intra، inter، E1، E2.
- EIGRP varianceتقسیم بار نامساوی فقط روی feasible successorها.
- BGP network · Weight · Local-Pref · MEDnetwork تطابق دقیق میخواهد؛ Weight محلی و سیسکویی است؛ Local-Pref در کل AS؛ MED فقط بین مسیرهای یک AS همسایه.
- BGP Activeیعنی اتصال TCP برقرار نشده، نه اینکه سالم است.
- HSRP · VRRP preemptدر HSRP پیشفرض خاموش و در VRRP روشن است. HSRPv2 برای IPv6 و گروههای بالای ۲۵۵ لازم است.
- Root · Loop · BPDU Guardبه ترتیب root-inconsistent، loop-inconsistent و err-disable.
- MST regionنام، revision و نگاشت VLAN باید یکسان باشد.
- GRE recursive routingمقصد تونل از طریق خود تونل یاد گرفته شده.
- vrf forwardingآدرس IP اینترفیس را پاک میکند.
- VXLAN · LISPVNI بیستوچهار بیتی، UDP 4789 و سربار ۵۰ بایت؛ LISP کنترل روی 4342 و داده روی 4341.
- SD-Access · SD-WANاولی: LISP، VXLAN و TrustSec. دومی: OMP، IPsec، و BFD برای سنجش کیفیت.
- NTP 16 · PTPstratum ۱۶ یعنی همگام نیست؛ PTP همان IEEE 1588 است و BMCA ساعت اصلی را انتخاب میکند.
- RPF · SSMRPF از مسیر unicast به سمت مبدأ استفاده میکند؛ SSM یعنی رنج 232/8 با IGMPv3 و بدون RP.
- NetFlow match · collectmatch فیلدهای کلیدی و collect شمارندههاست؛ ترتیب: record، exporter، monitor، اینترفیس.
- RSPAN · ERSPANاولی VLAN از نوع remote-span لازم دارد؛ دومی با GRE در لایه ۳ منتقل میشود.
- AAA localفقط وقتی سرور در دسترس نیست استفاده میشود، نه وقتی کاربر را رد میکند.
- IPv6 ACLقبل از ممنوعیت ضمنی، پیامهای ND مجازند.
- Catalyst 9000 CoPPفقط system-cpp-policy، با نرخ بر حسب بسته در ثانیه.
- NETCONF · RESTCONFاولی SSH روی ۸۳۰ و XML؛ دومی HTTPS با JSON یا XML. PUT جایگزین میکند و PATCH ادغام.
- X-Auth-Token · 401 · 403احراز هویت Catalyst Center با POST به آدرس توکن؛ 401 یعنی اعتبارنامه غلط یا خالی و 403 یعنی احراز شده ولی مجوز ندارد.
How to Answer Technical Questionsروش جواب دادن به سؤالات فنی
Answer frameworkچارچوب جواب
- Clarify scope — size, vendors, constraints ("Is this campus or WAN? How many sites?").
- State assumptions out loud.
- Explain the mechanism briefly — show you know why, not just what.
- Trade-offs — what you'd choose and what you'd give up.
- Verification — name the show commands / metrics you'd check.
- Real example from your own work, with a number (users, sites, minutes of outage).
- شفافسازی دامنه: اندازه، Vendorها و محدودیتها («کمپوس است یا WAN؟ چند سایت؟»).
- فرضهایتان را بلند بگویید.
- مکانیزم را کوتاه توضیح دهید؛ نشان دهید چرا را میدانید نه فقط چه را.
- Trade-offها: چه چیزی انتخاب میکنید و چه چیزی از دست میدهید.
- Verification: دستورات show یا شاخصهایی که چک میکنید را نام ببرید.
- مثال واقعی از تجربه خودتان، همراه با عدد (تعداد کاربر، سایت یا دقیقه قطعی).
What interviewers really scoreچیزی که واقعاً امتیاز میگیرد
- Structured thinking under ambiguity beats perfect recall.
- Saying "I don't know the exact command, but I'd check X and Y" is fine; guessing confidently is not.
- Operational maturity: change control, rollback, pre/post checks, documentation.
- Communication: explain the same thing to a manager and to an engineer.
- Bridge your background: ISP/carrier experience maps directly — MPLS L3VPN ⇄ VRF-lite / SD-WAN segments, E-Line/E-LAN ⇄ L2 extension / VXLAN, customer BGP ⇄ dual-ISP enterprise edge, NOC incident handling ⇄ ITIL.
- فکر ساختاریافته در شرایط مبهم از حفظ بودن کامل مهمتر است.
- گفتن «دستور دقیقش یادم نیست، ولی X و Y را چک میکنم» قابل قبول است؛ حدس زدن با اطمینان نه.
- بلوغ عملیاتی: change control، rollback، چک قبل و بعد از تغییر و مستندسازی.
- ارتباط: یک موضوع را هم برای مدیر و هم برای مهندس توضیح دهید.
- پل زدن از سابقه خودتان: تجربه ISP و Carrier مستقیماً قابل انتقال است — MPLS L3VPN معادل VRF-lite و segmentهای SD-WAN، E-Line/E-LAN معادل L2 extension و VXLAN، BGP مشتری معادل لبه dual-ISP سازمانی و مدیریت incident در NOC معادل ITIL.
★Whiteboard scenario: design HQ (600 users, 3 floors) + 10 branches + server roomسناریوی وایتبرد: طراحی HQ (۶۰۰ کاربر، ۳ طبقه) + ۱۰ شعبه + اتاق سرور
- Clarify: growth, critical apps (VoIP? ERP?), budget, existing vendors, internet/WAN links, compliance.
- Campus: collapsed core (2-tier) is enough at 600 users — two core/distribution switches in StackWise Virtual (or vPC), access stacks per floor with dual uplinks as one EtherChannel → no STP blocking. PoE+ for phones/APs.
- L2/L3 boundary: SVIs on the core; Rapid-PVST or MST as a safety net; PortFast + BPDU Guard on access; root guard toward access.
- Segmentation: VLANs per function (users, voice, Wi-Fi corp, guest, printers/IoT, mgmt); VRFs for guest and IoT, inter-VRF via firewall.
- Server room: dedicated server VLANs behind the firewall; dual-homed servers with LACP.
- Edge: FortiGate (or FTD) HA pair, dual ISP with SD-WAN or BGP, DMZ zone.
- Branches: SD-WAN (internet + LTE backup), local breakout for SaaS, IPsec overlay to HQ, OSPF/BGP over the overlay.
- Services: DHCP/DNS redundancy, NTP hierarchy, RADIUS/TACACS+ (ISE/ClearPass/FreeRADIUS), 802.1X/MAB.
- QoS: EF for voice end to end, shaping on WAN.
- Operations: SNMPv3 + Zabbix/Prometheus + Grafana, syslog to SIEM, NetFlow, config backups in Git, documentation.
- Close with trade-offs: cost vs redundancy, what you'd phase in later (NAC, automation).
- شفافسازی: رشد آینده، اپلیکیشنهای حیاتی (VoIP؟ ERP؟)، بودجه، Vendorهای موجود، لینکهای اینترنت و WAN و الزامات قانونی.
- کمپوس: برای ۶۰۰ کاربر collapsed core (دولایه) کافی است — دو سوئیچ core در StackWise Virtual یا vPC و استک access در هر طبقه با دو آپلینک بهصورت یک EtherChannel، پس STP چیزی را block نمیکند. PoE+ برای تلفنها و APها.
- مرز لایه ۲ و ۳: SVIها روی core؛ Rapid-PVST یا MST بهعنوان تور ایمنی؛ PortFast و BPDU Guard روی access و root guard به سمت access.
- سگمنتبندی: VLAN برای هر کاربرد (کاربران، صدا، Wi-Fi سازمانی، مهمان، پرینتر/IoT، مدیریت)؛ VRF برای مهمان و IoT و عبور ترافیک بین VRFها از فایروال.
- اتاق سرور: VLANهای سرور پشت فایروال و سرورهای dual-homed با LACP.
- لبه شبکه: جفت HA از FortiGate یا FTD، دو ISP با SD-WAN یا BGP و زون DMZ.
- شعب: SD-WAN با اینترنت و LTE پشتیبان، local breakout برای SaaS، overlay از نوع IPsec به HQ و OSPF/BGP روی overlay.
- سرویسها: DHCP/DNS افزونه، سلسلهمراتب NTP، RADIUS/TACACS+ و 802.1X/MAB.
- QoS: EF برای صدا در کل مسیر و shaping روی WAN.
- عملیات: SNMPv3 با Zabbix/Prometheus و Grafana، syslog به SIEM، NetFlow، بکاپ کانفیگ در Git و مستندسازی.
- با trade-offها جمعبندی کنید: هزینه در برابر افزونگی و اینکه چه چیزهایی را در فاز بعد اضافه میکنید (NAC، اتوماسیون).
Layer 2 — Interview Questionsلایه ۲ — سؤالات مصاحبه
I01How would you design STP in a campus with two distribution switches?STP را در کمپوسی با دو سوئیچ distribution چطور طراحی میکنید؟
Strong answerجواب قوی
Best design is one where STP has nothing to block: routed access, or the two distribution switches as one logical switch (StackWise Virtual / vPC) with multichassis EtherChannel to each access switch. If classic L2 remains: Rapid-PVST+ (or MST at scale), root primary/secondary set manually and aligned with the HSRP/VRRP active gateway per VLAN group, PortFast + BPDU Guard on edge ports, root guard on distribution downlinks, loop guard/UDLD on fibre.
بهترین طراحی آن است که STP اصلاً چیزی برای مسدود کردن نداشته باشد:
- Routed accessلایه ۳ تا خود سوئیچ دسترسی؛ آپلینکها بدون STP کار میکنند.
- StackWise Virtual / vPCدو سوئیچ distribution یک سوئیچ منطقی میشوند و با یک EtherChannel به هر سوئیچ دسترسی وصلاند؛ همه لینکها فعالاند.
اگر لایه ۲ کلاسیک بماند:
- Rapid-PVST+ / MSTبرای تعداد زیاد VLAN، MST مناسبتر است.
- root primary / secondaryدستی تعیین شود و با گیتوی فعال HSRP یا VRRP هر گروه VLAN روی یک سوئیچ باشد.
- PortFast + BPDU Guardروی همه پورتهای کاربر.
- Root Guardروی پورتهای distribution که به سمت لایه دسترسی میروند.
- Loop Guard / UDLDروی لینکهای فیبر.
Expect follow-upsسؤالات تکمیلی محتمل
- Why align the STP root with the active gateway? (Otherwise traffic crosses the inter-distribution link — suboptimal path.)
- MST vs Rapid-PVST+ — when does the difference matter? (Hundreds of VLANs: CPU and BPDU load; multi-vendor interop.)
- What happens if a user plugs in a home switch?
- چرا روت STP را با گیتوی فعال همراستا میکنید؟ (وگرنه ترافیک از لینک بین دو distribution عبور میکند و مسیر بهینه نیست.)
- تفاوت MST و Rapid-PVST+ کی مهم میشود؟ (با صدها VLAN: بار CPU و BPDU؛ سازگاری با Vendorهای دیگر.)
- اگر کاربر یک سوئیچ خانگی وصل کند چه میشود؟
They're checkingچه چیزی را میسنجند
Design reasoning, not timers.
منطق طراحی، نه حفظ تایمرها.
I02A port is err-disabled. What exactly do you do?یک پورت err-disable شده. دقیقاً چه کار میکنید؟
Strong answerجواب قوی
Find the reason first: show interfaces status err-disabled and the log (bpduguard, psecure-violation, udld, link-flap, channel-misconfig, loopback). Fix the cause — remove the rogue switch, correct the port-channel config, replace the fibre — then shutdown/no shutdown. Automatic errdisable recovery only for causes where it's safe, with a sensible interval; never as a substitute for root cause.
- show interfaces status err-disabledاول دلیل را پیدا کنید؛ لاگ هم علت را نشان میدهد.
- bpduguard · psecure-violation · udld · link-flap · channel-misconfigعلتهای رایج.
- رفع علتسوئیچ ناشناس را جدا کنید، کانفیگ port-channel را درست کنید یا فیبر را عوض کنید. بعد پورت را خاموش و دوباره روشن کنید.
- errdisable recoveryفقط برای علتهایی که امن است و با فاصله زمانی معقول؛ هیچوقت جایگزین رفع علت نیست.
They're checkingچه چیزی را میسنجند
Root-cause discipline vs "bounce it and move on".
پایبندی به رفع علت ریشهای در برابر «ریست کن و برو».
I03One VLAN can't reach its gateway across a trunk; other VLANs can. Walk me through it.یک VLAN از روی ترانک به گیتوی نمیرسد ولی بقیه میرسند. قدمبهقدم توضیح دهید.
Strong answerجواب قوی
show vlan briefon both switches — does the VLAN exist (not deleted by VTP)?show interfaces trunk— allowed? active in management domain? forwarding (not STP-blocked or pruned)?- Native VLAN mismatch (CDP warning) if the VLAN is the native one.
- SVI state on the gateway (
show ip interface brief) — autostate brings it down if no port in the VLAN is up. - MAC learned in the right place:
show mac address-table vlan X.
- show vlan briefروی هر دو سوئیچ: VLAN وجود دارد و VTP پاکش نکرده؟
- show interfaces trunkVLAN روی ترانک مجاز و فعال است و STP مسدودش نکرده؟
- Native VLANاگر این VLAN همان native است، یکسان بودن دو طرف را چک کنید؛ CDP هشدار میدهد.
- SVI / autostateاگر هیچ پورتی از آن VLAN روی گیتوی فعال نباشد، SVI خاموش میماند.
- show mac address-table vlan XMAC در جای درست یاد گرفته شده؟
They're checkingچه چیزی را میسنجند
A systematic L2 path walk.
بررسی سیستماتیک مسیر لایه ۲.
I04One member of a 4×10G port-channel is saturated while the others are idle. Why?یکی از اعضای یک port-channel چهار تا دهگیگ اشباع شده و بقیه بیکارند. چرا؟
Strong answerجواب قوی
EtherChannel hashes per flow, not per packet. A few large flows (backups, replication — "elephant flows") between the same two IPs always hash to the same link. Fix: include L4 ports in the hash (src-dst-mixed-ip-port / src-dst-ip-l4port, platform-dependent), check that both sides hash sensibly (each direction is decided independently), use member counts that distribute evenly (2/4/8 on older platforms). A single flow can never exceed one member — then you need a bigger link.
- Per-flow hashEtherChannel ترافیک را بر اساس هر جریان تقسیم میکند، نه هر بسته. چند جریان بزرگ بین دو IP ثابت، مثل بکاپ یا replication، همیشه روی یک لینک میافتند.
- Hash with L4 portsپورتهای لایه ۴ را هم وارد هش کنید؛ نام دقیق دستور به پلتفرم بستگی دارد.
- هر دو طرفهر طرف جهت خودش را مستقل هش میکند؛ تنظیم باید روی هر دو طرف باشد.
- 2 / 4 / 8 linksدر پلتفرمهای قدیمیتر این تعدادها یکنواختتر توزیع میشوند.
یک جریان هیچوقت از ظرفیت یک لینک بیشتر نمیشود؛ در آن صورت لینک بزرگتر لازم است.
They're checkingچه چیزی را میسنجند
Production experience — candidates who only read books say "LACP balances load".
تجربه عملی — کسی که فقط کتاب خوانده میگوید «LACP بار را تقسیم میکند».
I05Why can STP topology changes hurt the network even without a loop?چرا topology change در STP حتی بدون لوپ به شبکه آسیب میزند؟
Strong answerجواب قوی
Every TC makes switches flush (RSTP) or age out quickly (802.1D, forward-delay) their MAC tables → temporary unicast flooding everywhere in that VLAN. A host port without PortFast that flaps (PC reboot, dock) generates TCs repeatedly — flooding, CPU spikes, slow apps. Find the source with show spanning-tree detail | include occur|from and follow it; fix with PortFast on all edge ports.
- Topology Changeهر TC باعث میشود سوئیچها جدول MAC را پاک کنند یا زود منقضی کنند؛ نتیجه، پخش موقت ترافیک unicast در کل VLAN است.
- پورت بدون PortFastپورتی که مدام قطع و وصل میشود (ریبوت کامپیوتر، داک لپتاپ) پشت سر هم TC میسازد: ترافیک اضافه، بالا رفتن CPU و کندی.
- show spanning-tree detail | include occur|fromمنبع TC را پیدا کنید و سوئیچ به سوئیچ دنبالش بروید.
- PortFastراهحل: روی همه پورتهای کاربر فعال شود.
I06How do you prevent a VTP disaster?چطور از فاجعه VTP جلوگیری میکنید؟
Strong answerجواب قوی
The classic incident: a lab switch with the same domain and a higher revision number is connected and wipes the VLAN database (VTPv1/v2). Prevent with VTP transparent/off (VLANs managed by automation), or VTPv3 with a designated primary server and a password; reset the revision (change domain or mode) before connecting any used switch.
حادثه کلاسیک: یک سوئیچ آزمایشی با همان domain و شماره revision بالاتر وصل میشود و همه VLANها را پاک میکند. این در VTP نسخه ۱ و ۲ اتفاق میافتد.
- VTP transparent / offVLANها با اتوماسیون مدیریت شوند.
- VTPv3با primary server مشخص و رمز؛ هر سوئیچی نمیتواند تغییر بدهد.
- Reset revisionقبل از وصل کردن سوئیچ دستدوم، با عوض کردن domain یا mode شماره revision را صفر کنید.
They're checkingچه چیزی را میسنجند
Whether you've lived through (or learned from) real outages.
اینکه قطعی واقعی را تجربه کردهاید یا از آن درس گرفتهاید.
Routing — OSPF · EIGRP · BGP Interview Questionsمسیریابی — سؤالات مصاحبه OSPF، EIGRP و BGP
I07Design OSPF for an HQ, a data centre and 40 branches. Single area or multi-area?OSPF را برای HQ، دیتاسنتر و ۴۰ شعبه طراحی کنید. Single area یا Multi-area؟
Strong answerجواب قوی
Modern routers handle a few hundred routers in one area, so size alone doesn't force multi-area. I'd still use area 0 for core/DC and put branches (or regions) in separate areas for fault isolation and summarisation: a flapping branch link then doesn't trigger SPF everywhere. Branches as stub/totally stubby (default route only); NSSA if a branch redistributes something (local internet, static). Summarise at ABRs, point-to-point network types on links, passive-interface default, BFD for fast detection. Over an SD-WAN/IPsec overlay, BGP is often the better choice.
روترهای امروزی چند صد روتر را در یک area تحمل میکنند، پس فقط تعداد دلیل تقسیم نیست. تقسیم میکنم تا خرابی یک شعبه همهجا محاسبه مجدد ایجاد نکند و بشود مسیرها را خلاصه کرد:
- Area 0هسته شبکه و دیتاسنتر.
- Stub / Totally stubbyبرای شعب؛ فقط یک مسیر پیشفرض دریافت میکنند.
- NSSAبرای شعبهای که چیزی را redistribute میکند، مثل اینترنت محلی یا مسیر ثابت.
- ABR summarizationخلاصهسازی در مرز areaها.
- point-to-point · passive · BFDنوع شبکه روی لینکها point-to-point، همه اینترفیسها passive بهجز لینکهای همسایگی، و BFD برای تشخیص سریع قطعی.
روی overlay از نوع SD-WAN یا IPsec معمولاً BGP انتخاب بهتری است.
Expect follow-upsسؤالات تکمیلی محتمل
- What does a totally stubby branch's routing table look like? (Intra-area routes + one default.)
- What breaks if an area isn't connected to area 0?
- جدول مسیریابی یک شعبه totally stubby چه شکلی است؟ (مسیرهای داخل area بهعلاوه یک default route)
- اگر یک area به area 0 وصل نباشد چه چیزی خراب میشود؟
I08A prefix is in the OSPF database but not in the routing table. Why?یک prefix در دیتابیس OSPF هست ولی در جدول مسیریابی نیست. چرا؟
Strong answerجواب قوی
- A better route exists from a source with lower AD (static, EIGRP, eBGP).
- A
distribute-list infilters it from the RIB (LSA still present — exactly this symptom). - Type 5/7 forwarding address not reachable via OSPF.
- The ABR/ASBR advertising it isn't reachable — e.g. an area not attached to area 0, or a duplicate router-ID.
- Lower ADمسیر بهتری از منبع دیگری با AD کمتر وجود دارد، مثل static، EIGRP یا eBGP.
- distribute-list inمسیر را فقط از جدول مسیریابی حذف میکند و LSA سر جایش میماند؛ دقیقاً همین علامت.
- Forwarding addressآدرس مقصد در LSA نوع ۵ یا ۷ از طریق OSPF در دسترس نیست.
- ABR / ASBR unreachableاعلامکننده در دسترس نیست؛ مثلاً area به area 0 وصل نیست یا Router-ID تکراری است.
They're checkingچه چیزی را میسنجند
Whether you understand LSDB vs RIB vs FIB.
درک تفاوت LSDB، RIB و FIB.
I09How do you make OSPF converge faster?چطور OSPF را سریعتر همگرا میکنید؟
Strong answerجواب قوی
Detection first: BFD (sub-second) instead of shorter hello/dead. Point-to-point network type on links (no DR election or wait timer). Tune SPF and LSA throttling timers (fast initial run, back-off under churn). Keep areas small with summarisation; prefix-suppression for transit links. Pre-compute backups with LFA / IP FRR where the platform supports it. Measure before and after.
اول خرابی را سریع تشخیص بده، بعد همگرایی را سریع کن:
- BFDقطعی را در کمتر از یک ثانیه تشخیص میدهد؛ بهتر از کم کردن تایمرهای hello و dead.
- Network type: point-to-pointروی لینکهای دوطرفه؛ انتخاب DR و زمان انتظار حذف میشود.
- SPF / LSA throttlingاولین محاسبه فوری انجام شود، ولی در زمان ناپایداری فاصلهها بیشتر شود.
- Summarization · prefix-suppressionareaها کوچک بمانند و لینکهای عبوری اعلام نشوند تا تغییرات کمتری پخش شود.
- LFA / IP FRRمسیر پشتیبان از قبل آماده است و جایگزینی فوری انجام میشود.
در پایان: زمان همگرایی را قبل و بعد از تغییر اندازه بگیرید.
I10Would you choose EIGRP for a new network today?آیا امروز برای یک شبکه جدید EIGRP را انتخاب میکنید؟
Strong answerجواب قوی
Probably not for a new multi-vendor network: EIGRP is published as an informational RFC (7868), but in practice it's Cisco-centric, and FortiGate/MikroTik/Linux environments speak OSPF and BGP. It still makes sense in an all-Cisco estate: simple config, fast convergence via feasible successors, good hub-and-spoke behaviour with stub. I'd keep existing EIGRP if it works and plan migration only with a business reason.
- Multi-Vendorاحتمالاً نه. EIGRP بهصورت یک RFC اطلاعاتی منتشر شده، ولی در عمل سیسکومحور است و FortiGate، MikroTik و لینوکس با OSPF و BGP کار میکنند.
- All-Ciscoهنوز منطقی است: کانفیگ ساده، جایگزینی فوری با feasible successor و رفتار خوب در hub-and-spoke با stub.
- EIGRP موجوداگر درست کار میکند نگهش میدارم و فقط با دلیل کاری مهاجرت میکنم.
They're checkingچه چیزی را میسنجند
An opinion backed by reasoning — not dogma.
نظر مستدل، نه تعصب.
I11What causes EIGRP Stuck-in-Active and how do you prevent it?علت Stuck-in-Active در EIGRP چیست و چطور جلویش را میگیرید؟
Strong answerجواب قوی
A route goes Active with no feasible successor; queries propagate and some router doesn't reply in time (lossy link, CPU, huge query domain), so the neighbour is reset. Prevention is about bounding the query domain: eigrp stub on spokes, summarisation at distribution/hub, healthy links. Find it with show ip eigrp topology active and SIA logs.
مسیری که feasible successor ندارد به حالت Active میرود و Query پخش میشود. اگر روتری بهموقع جواب ندهد، به خاطر لینک پرخطا، CPU بالا یا دامنه Query خیلی بزرگ، همسایگی ریست میشود.
- eigrp stubشعب Query دریافت نمیکنند.
- Summarizationدر distribution یا hub، تا Query جلوتر نرود.
- show ip eigrp topology activeبههمراه لاگهای SIA برای پیدا کردن مسیر گیرکرده.
I12Walk me through bringing up a new eBGP session with an ISP.راهاندازی یک سشن eBGP جدید با ISP را قدمبهقدم توضیح دهید.
Strong answerجواب قوی
- Agree on ASNs, peering addresses, MD5 password, what they send (default / partial / full table) and what we announce; make sure IRR objects and RPKI ROAs exist for our prefixes.
- Configure: outbound prefix-list with only our prefixes, inbound filter (bogons, our own space, too-specific),
maximum-prefix, Null0 anchor route, TTL security. - Verify: session Established,
advertised-routes/received-routes, then check from outside with a looking glass that the prefix is visible with the right AS path. - Document and add monitoring (session state, prefix counts).
- ASN · peering IP · MD5هماهنگی با ISP، و اینکه آنها چه میفرستند (default، partial یا full table) و ما چه اعلام میکنیم.
- IRR · RPKI ROAبرای prefixهای ما ثبت شده باشند.
- prefix-list outفقط prefixهای خودمان.
- prefix-list in · maximum-prefixفیلتر bogon، فضای خودمان و prefixهای خیلی ریز، بهعلاوه سقف تعداد.
- Null0 · ttl-securityمسیر ثابت برای اعلام aggregate، و محافظت از سشن.
- advertised-routes · received-routesبررسی بعد از برقراری سشن؛ بعد با looking glass از بیرون ببینید prefix با AS path درست دیده میشود.
- Monitoringوضعیت سشن و تعداد prefixها پایش و مستند شود.
They're checkingچه چیزی را میسنجند
That you won't accidentally become a transit AS or leak routes.
اینکه بهاشتباه AS شما transit نشود یا route leak ایجاد نکنید.
I13Two ISPs, but all inbound traffic arrives via ISP-A. How do you fix it?دو ISP داریم ولی همه ترافیک ورودی از ISP-A میآید. چطور درستش میکنید؟
Strong answerجواب قوی
First confirm both ISPs actually receive and propagate the prefix (looking glasses). Then influence the internet's choice: AS-path prepend toward A, ISP-A's communities to lower local-preference inside their network (the most effective lever), or announce more-specifics via B while keeping the aggregate on both — but not longer than /24 (IPv4) / /48 (IPv6), which are filtered. MED only works between links to the same ISP. Be clear that inbound control is influence, not a guarantee.
اول مطمئن شوید هر دو ISP واقعاً prefix را دریافت و منتشر میکنند؛ با looking glass. بعد روی انتخاب اینترنت اثر بگذارید:
- ISP communitiesکم کردن local-preference داخل شبکه ISP-A؛ مؤثرترین ابزار.
- AS-path prependطولانی کردن مسیر از طرف A.
- More-specific prefixesاعلام prefix دقیقتر از طریق B و نگه داشتن aggregate روی هر دو؛ ولی نه ریزتر از /24 در IPv4 و /48 در IPv6، چون فیلتر میشوند.
- MEDفقط بین لینکهایی که به یک ISP وصلاند کار میکند.
صادق باشید: کنترل ترافیک ورودی فقط اثرگذاری است، نه تضمین.
I14BGP is Established, but the prefix you expect isn't used. Troubleshoot it.BGP برقرار است ولی prefix مورد انتظار استفاده نمیشود. عیبیابی کنید.
Strong answerجواب قوی
- Is it being sent? On the peer:
advertised-routes—networkneeds an exact RIB match; outbound route-map/prefix-list. - Is it received?
received-routes(needs soft-reconfiguration inbound) vsroutes— inbound filter dropping it? - Is it valid?
show ip bgp <prefix>— next-hop reachable (iBGP without next-hop-self is the classic), AS-path loop. - Is it best? Compare attributes along the best-path order.
- Is it installed? "RIB-failure" = a lower-AD route already exists.
- advertised-routesآیا ارسال میشود؟ دستور network تطابق دقیق با جدول مسیریابی لازم دارد؛ فیلتر خروجی را هم ببینید.
- received-routes · routesآیا دریافت میشود؟ اگر در اولی هست و در دومی نیست، فیلتر ورودی حذفش کرده.
- show ip bgp <prefix>آیا معتبر است؟ نکستهاپ باید در دسترس باشد؛ iBGP بدون next-hop-self مورد کلاسیک است.
- Best pathآیا بهترین مسیر است؟ attributeها را به ترتیب best-path مقایسه کنید.
- RIB-failureآیا نصب شده؟ این پیام یعنی مسیری با AD کمتر از قبل وجود دارد.
They're checkingچه چیزی را میسنجند
A clean pipeline: sent → received → valid → best → installed.
یک زنجیره منظم: ارسال ← دریافت ← معتبر ← بهترین ← نصبشده.
I15Why does iBGP need a full mesh, and what are the alternatives?چرا iBGP به full mesh نیاز دارد و جایگزینها چیست؟
Strong answerجواب قوی
AS_PATH doesn't change inside an AS, so it can't prevent loops there; BGP therefore never re-advertises an iBGP-learned route to another iBGP peer (iBGP split horizon) — every router must peer with every other. Alternatives: route reflectors (clients only peer with the RR; ORIGINATOR_ID and CLUSTER_LIST prevent loops; deploy redundant RRs, usually out of the forwarding path) or confederations (sub-ASes). In an enterprise, a pair of RRs is the normal answer.
داخل یک AS، مقدار AS_PATH تغییر نمیکند و نمیتواند جلوی لوپ را بگیرد. برای همین BGP مسیری را که از یک همسایه iBGP یاد گرفته به همسایه iBGP دیگر نمیدهد و همه روترها باید مستقیم با هم همسایه باشند. دو جایگزین:
- Route Reflectorکلاینتها فقط با RR همسایهاند؛ ORIGINATOR_ID و CLUSTER_LIST جلوی لوپ را میگیرند. دو RR برای افزونگی، معمولاً خارج از مسیر ترافیک.
- Confederationتقسیم AS به چند sub-AS؛ در سازمان کمتر رایج است.
I16How do you protect your internet-edge routing?از مسیریابی لبه اینترنت چطور محافظت میکنید؟
Strong answerجواب قوی
Prefix filters in both directions, maximum-prefix, RPKI route-origin validation, TTL security (GTSM) and MD5/TCP-AO, CoPP protecting BGP and management, bogon/martian and uRPF anti-spoofing, RTBH or provider scrubbing for DDoS, and never providing transit by accident. Monitoring of session flaps and prefix count changes.
- Prefix filters · maximum-prefixفیلتر در هر دو جهت و سقف تعداد.
- RPKI ROVاعتبارسنجی مبدأ مسیرها.
- GTSM · MD5 / TCP-AOمحافظت از سشن.
- CoPPمحافظت از BGP و دسترسی مدیریتی روی CPU.
- Bogon · uRPFجلوگیری از جعل آدرس.
- RTBH · scrubbingمقابله با DDoS.
- No transitAS شما هرگز ناخواسته مسیر عبوری بین دو ISP نشود؛ قطع و وصل سشن و تغییر تعداد prefixها هم پایش شود.
Services & Overlays — FHRP · NAT · Multicast · VRF · SD-WANسرویسها و Overlayها — FHRP، NAT، Multicast، VRF و SD-WAN
I17HSRP or VRRP? And how do you stop the gateway from flapping after a reboot?HSRP یا VRRP؟ و چطور جلوی flap شدن گیتوی بعد از ریبوت را میگیرید؟
Strong answerجواب قوی
VRRP in a multi-vendor network (FortiGate, MikroTik, Linux keepalived all speak it); HSRP is fine in an all-Cisco campus. The real issue is pre-emption: a rebooted primary pre-empts as soon as the interface is up, before routing has converged, and black-holes traffic. Use preempt delay minimum (e.g. 60–180 s), track uplinks or an IP SLA so the role follows real reachability, align with the STP root / vPC primary, authenticate, and prefer BFD over aggressive hello timers.
- VRRPدر شبکه Multi-Vendor؛ FortiGate، MikroTik و keepalived لینوکس همه پشتیبانی میکنند.
- HSRPدر کمپوس کاملاً سیسکو هم خوب است.
- preempt delay minimumمشکل اصلی همینجاست: روتر اصلی بعد از ریبوت به محض بالا آمدن اینترفیس نقش را پس میگیرد، قبل از اینکه مسیریابی آماده باشد، و ترافیک گم میشود. ۶۰ تا ۱۸۰ ثانیه تأخیر بدهید.
- trackآپلینک یا IP SLA را دنبال کنید تا نقش با دسترسی واقعی جابهجا شود.
- STP root · vPC primaryگیتوی فعال روی همان سوئیچ باشد.
- BFD · authenticationبه جای تایمرهای hello خیلی کوتاه؛ احراز هویت هم فعال شود.
They're checkingچه چیزی را میسنجند
Knowledge of failure behaviour, not just defaults.
شناخت رفتار در زمان خرابی، نه فقط مقادیر پیشفرض.
I18NAT isn't working for a new subnet. How do you troubleshoot?NAT برای یک subnet جدید کار نمیکند. چطور عیبیابی میکنید؟
Strong answerجواب قوی
ip nat inside/outsideon the right interfaces (new SVI often forgotten).- NAT ACL/object includes the new subnet.
- Return route to the new subnet exists internally.
show ip nat translations/ FortiGate session list — is a translation created?- Traffic that must NOT be NATed (VPN) has an exemption.
- PAT pool or port exhaustion on large sites.
- ip nat inside / outsideروی اینترفیسهای درست؛ SVI جدید معمولاً فراموش میشود.
- NAT ACLsubnet جدید در لیست NAT باشد.
- مسیر برگشتمسیر برگشت به subnet جدید در شبکه داخلی وجود داشته باشد.
- show ip nat translationsیا لیست session در FortiGate: آیا ترجمه ساخته میشود؟
- NAT exemptionترافیک VPN نباید NAT شود.
- PAT exhaustionتمام شدن پورتها در سایتهای بزرگ.
I19Why does accurate time matter on network devices?چرا زمان دقیق روی تجهیزات شبکه مهم است؟
Strong answerجواب قوی
Correlating logs across devices and in the SIEM during an incident, certificate validation (IPsec, 802.1X EAP-TLS, HTTPS — wrong time = "certificate not yet valid"), AAA/Kerberos, telemetry and forensics. Design: two or three internal NTP servers fed from reliable upstreams, authentication, ACLs, devices sourcing NTP from a loopback/management interface. PTP only where microseconds matter (industrial, trading, broadcast).
- Logs · SIEMکنار هم گذاشتن لاگ دستگاهها هنگام بررسی حادثه.
- Certificatesدر IPsec، EAP-TLS و HTTPS؛ ساعت اشتباه یعنی خطای «گواهی هنوز معتبر نیست».
- AAA · Kerberos · telemetryهمه به زمان درست وابستهاند.
- NTP designدو یا سه سرور داخلی با منبع بالادستی معتبر، احراز هویت و ACL؛ دستگاهها از loopback یا اینترفیس مدیریت درخواست بدهند.
- PTPفقط جایی که دقت میکروثانیه لازم است: صنعت، بورس و پخش تصویر.
I20A multicast video stream works in its own VLAN but not across routers. Why?یک استریم ویدیوی multicast در VLAN خودش کار میکند ولی از روترها عبور نمیکند. چرا؟
Strong answerجواب قوی
- The source sends with TTL 1 — extremely common with cameras and encoders; check the capture.
ip multicast-routingand PIM missing on some interface in the path.- RP unknown or inconsistent (
show ip pim rp mapping) for PIM-SM. - RPF failure: unicast path back to the source uses a different interface (asymmetric routing, or the firewall in between) —
show ip rpf <source>,show ip mroutecounters. - No IGMP querier in the receiver VLAN with snooping enabled; firewalls dropping PIM/multicast.
- TTL = 1مبدأ با TTL یک ارسال میکند؛ در دوربینها و encoderها بسیار رایج است. capture را ببینید.
- ip multicast-routing · PIMروی همه اینترفیسهای مسیر فعال باشد.
- show ip pim rp mappingدر PIM-SM همه روترها باید RP یکسان را بشناسند.
- RPF failureمسیر unicast به سمت مبدأ از اینترفیس دیگری است؛ مسیر نامتقارن یا فایروال بین راه. بررسی با show ip rpf و شمارندههای show ip mroute.
- IGMP querierبا snooping فعال و بدون querier، گیرندهها ترافیک را نمیگیرند. فایروال هم ممکن است PIM را حذف کند.
They're checkingچه چیزی را میسنجند
Practical gotchas (TTL, querier) — the difference between theory and field experience.
نکات عملی (TTL و querier) — تفاوت تئوری با تجربه میدانی.
I21VRF-lite, MPLS L3VPN, SD-WAN segments or SD-Access VNs — when do you use which?VRF-lite، MPLS L3VPN، segmentهای SD-WAN یا VNهای SD-Access — هر کدام کی؟
Strong answerجواب قوی
- VRF-lite: a handful of VRFs over a few hops — simple, but every hop needs per-VRF sub-interfaces and routing, so it doesn't scale.
- MPLS L3VPN: many sites and VRFs over a provider or large WAN core — RD/RT, MP-BGP, one control plane.
- SD-WAN segments (VPNs): segmentation across the WAN overlay, managed centrally.
- SD-Access VNs: campus segmentation with automated provisioning plus SGT micro-segmentation.
- VRF-liteچند VRF روی چند هاپ؛ ساده است ولی هر هاپ ساباینترفیس و مسیریابی جدا برای هر VRF میخواهد و بزرگ نمیشود.
- MPLS L3VPNسایتها و VRFهای زیاد روی شبکه سرویسدهنده یا هسته بزرگ WAN؛ با RD، RT و MP-BGP.
- SD-WAN segmentsجداسازی روی overlay در WAN با مدیریت مرکزی.
- SD-Access VNجداسازی کمپوس با راهاندازی خودکار، بهعلاوه micro-segmentation با SGT.
They're checkingچه چیزی را میسنجند
That you pick tools by scale and operations cost.
اینکه ابزار را بر اساس مقیاس و هزینه عملیاتی انتخاب میکنید.
I22GRE, IPsec, GRE-over-IPsec, DMVPN — explain when you'd use each.GRE، IPsec، GRE-over-IPsec و DMVPN — هر کدام را کی استفاده میکنید؟
Strong answerجواب قوی
GRE carries multicast and routing protocols but has no encryption. Policy-based IPsec encrypts but can't carry routing protocols. GRE-over-IPsec or an IPsec VTI gives both — the normal choice for a few sites with dynamic routing. DMVPN (mGRE + NHRP + IPsec) adds dynamic spoke-to-spoke tunnels for many branches. SD-WAN is today's managed successor, with central policy and application-aware routing.
- GREmulticast و پروتکل مسیریابی را عبور میدهد، ولی رمزنگاری ندارد.
- IPsec (policy-based)رمز میکند، ولی پروتکل مسیریابی را عبور نمیدهد.
- GRE-over-IPsec · VTIهر دو را دارد؛ انتخاب معمول برای چند سایت با مسیریابی پویا.
- DMVPNترکیب mGRE، NHRP و IPsec؛ تونل مستقیم و پویا بین شعب برای تعداد زیاد شعبه.
- SD-WANجانشین امروزی، با مدیریت مرکزی و مسیریابی بر اساس کیفیت اپلیکیشن.
I23Explain SD-WAN in 30 seconds to a manager, then to an engineer.SD-WAN را در ۳۰ ثانیه برای یک مدیر و سپس برای یک مهندس توضیح دهید.
Strong answerجواب قوی
Manager: "We can use cheaper internet and LTE links alongside or instead of MPLS. The system measures each link continuously and moves important apps like voice to the best one automatically, and we manage all branches from one console." Engineer: "Controllers run OMP to distribute routes, TLOCs and keys; edges build IPsec tunnels per transport colour; BFD in the tunnels measures loss, latency and jitter; Application-Aware Routing steers traffic by SLA; control connections use DTLS/TLS and the Validator handles onboarding and NAT traversal."
برای مدیر: «میتوانیم کنار MPLS یا به جای آن از اینترنت و LTE ارزانتر استفاده کنیم. سیستم کیفیت هر لینک را دائماً میسنجد و برنامههای مهم مثل تماس صوتی را خودکار روی بهترین لینک میبرد. همه شعب هم از یک کنسول مدیریت میشوند.»
برای مهندس:
- OMPکنترلرها مسیرها، TLOCها و کلیدها را توزیع میکنند.
- IPsec per colorهر edge برای هر نوع لینک تونل جدا میسازد.
- BFDداخل تونلها loss، تأخیر و jitter را میسنجد.
- Application-Aware Routingترافیک را بر اساس SLA هدایت میکند.
- DTLS / TLS · Validatorاتصالات کنترلی امناند؛ Validator معرفی دستگاهها و عبور از NAT را انجام میدهد.
They're checkingچه چیزی را میسنجند
Communication range.
توانایی ارتباط با مخاطبهای مختلف.
I24VXLAN EVPN vs SD-Access — what's the difference?تفاوت VXLAN EVPN و SD-Access چیست؟
Strong answerجواب قوی
Both use VXLAN in the data plane. VXLAN EVPN uses MP-BGP EVPN as the control plane, is standards-based and multi-vendor, and is mainly a data-centre fabric (e.g. Nexus). SD-Access is Cisco's campus solution: LISP control plane (traditionally), VXLAN-GPO carrying SGTs, TrustSec policy from ISE, and everything provisioned by Catalyst Center.
هر دو در لایه داده از VXLAN استفاده میکنند. تفاوت در control plane و کاربرد است:
- VXLAN EVPNcontrol plane با MP-BGP EVPN؛ استاندارد و Multi-Vendor؛ بیشتر برای fabric دیتاسنتر، مثل Nexus.
- SD-Accessراهکار کمپوس سیسکو: control plane با LISP بهطور سنتی، VXLAN-GPO که SGT را حمل میکند، policy از ISE و راهاندازی کامل با Catalyst Center.
Operations · Security · Automation Interview Questionsسؤالات مصاحبه عملیات، امنیت و اتوماسیون
I25Users report slowness every day around 10:00. How do you investigate?کاربران هر روز حدود ساعت ۱۰ از کندی شکایت میکنند. چطور بررسی میکنید؟
Strong answerجواب قوی
A time pattern means a scheduled cause — prove it with data. Overlay monitoring graphs at 10:00: WAN/internet utilisation and drops, QoS class drops, firewall CPU/sessions, Wi-Fi channel utilisation. NetFlow top talkers in that window usually names the culprit (backup job, OS/AV updates, a cloud sync). Add IP SLA probes to quantify user impact. Fix with scheduling, QoS/shaping, or capacity — and confirm the graphs flatten.
الگوی زمانی یعنی یک علت زمانبندیشده؛ با داده ثابتش کنید:
- Monitoring graphsمصرف و دراپ WAN، دراپ کلاسهای QoS، CPU و session فایروال و اشغال کانال وایفای در ساعت ۱۰.
- NetFlow top talkersمعمولاً مقصر را نشان میدهد: job بکاپ، آپدیت سیستمعامل یا آنتیویروس، همگامسازی ابری.
- IP SLAاثر روی کاربر را با عدد نشان دهید.
- راهحلجابهجایی زمان job، اولویتبندی ترافیک یا افزایش ظرفیت؛ بعد ببینید نمودارها صاف شدهاند.
I26How do NetFlow, SPAN and IP SLA fit into daily operations?NetFlow، SPAN و IP SLA در عملیات روزانه چه جایگاهی دارند؟
Strong answerجواب قوی
NetFlow: always on — who talks to whom, capacity planning, anomaly detection, SIEM enrichment. SPAN/ERSPAN: on demand for packet-level proof (VoIP quality, TCP resets, app vendor disputes) or permanently to feed an IDS. IP SLA: proactive SLA measurement (latency/jitter/loss to key sites) and triggers for failover via tracking.
- NetFlowهمیشه روشن: چه کسی با چه کسی حرف میزند، برنامهریزی ظرفیت، تشخیص رفتار غیرعادی و تغذیه SIEM.
- SPAN / ERSPANهر وقت مدرک در سطح بسته لازم است، مثل کیفیت VoIP، TCP reset یا اختلاف با پشتیبانی اپلیکیشن؛ یا بهطور دائم برای IDS.
- IP SLAاندازهگیری پیشگیرانه تأخیر، jitter و loss تا سایتهای مهم، و راهاندازی failover با track.
I27How would you secure management access to 500 network devices?دسترسی مدیریتی به ۵۰۰ دستگاه شبکه را چطور امن میکنید؟
Strong answerجواب قوی
Centralised AAA with TACACS+ (per-command authorisation and accounting) and MFA, a break-glass local account stored in a vault, SSH only, management VRF / out-of-band network with VTY ACLs, jump hosts, CoPP, SNMPv3, NTP + syslog to SIEM, and automated compliance checks that flag drift (Telnet enabled, missing ACL, weak passwords).
- TACACS+ · MFAاحراز هویت متمرکز با مجوز و ثبت هر دستور.
- Break-glass accountیک حساب محلی اضطراری که رمزش در vault نگهداری میشود.
- SSH only · VTY ACLبدون Telnet؛ دسترسی فقط از شبکه مدیریت.
- Management VRF · OOB · jump hostمسیر مدیریتی جدا از ترافیک کاربران.
- CoPP · SNMPv3 · NTP · syslogمحافظت از CPU، پایش امن و ارسال لاگ به SIEM.
- Compliance checksبررسی خودکار که انحراف کانفیگ را گزارش کند: Telnet روشن، ACL جاافتاده، رمز ضعیف.
I28Explain TrustSec / SGT to someone who only knows ACLs.TrustSec و SGT را برای کسی که فقط ACL میشناسد توضیح دهید.
Strong answerجواب قوی
IP-based ACLs explode as subnets and devices grow and break when users move. TrustSec classifies each endpoint into a group (SGT) by identity — e.g. "Finance", "Contractors", "Cameras" — via ISE at login. Policy becomes a simple matrix: source group × destination group = permit/deny, enforced with SGACLs wherever the tag arrives (carried inline or via SXP). The rule follows the user, not the IP.
ACLهای مبتنی بر IP با بزرگ شدن شبکه منفجر میشوند و با جابهجایی کاربران خراب میشوند. TrustSec قانون را به هویت وصل میکند، نه به IP:
- SGTهر دستگاه هنگام ورود از طریق ISE در یک گروه قرار میگیرد؛ مثلاً «مالی»، «پیمانکار» یا «دوربین».
- Policy matrixگروه مبدأ × گروه مقصد = مجاز یا ممنوع.
- SGACLهر جا تگ برسد، قانون اعمال میشود.
- Inline tagging · SXPدو روش انتقال تگ بین دستگاهها.
I29You must change OSPF settings on 200 devices tonight. How do you do it safely?باید امشب تنظیمات OSPF را روی ۲۰۰ دستگاه تغییر دهید. چطور امن انجامش میدهید؟
Strong answerجواب قوی
- Approved change with rollback plan; tested in the lab.
- Automation (Ansible) with
--check --difffirst; templates from the source of truth. - Pre-checks captured automatically: neighbour counts, route counts, key prefixes.
- Canary: 2–3 devices, verify, then batches; stop on any failed post-check.
- Post-checks compared to pre-checks; monitoring watched; rollback ready (NETCONF candidate/confirmed commit where supported).
- Change · rollback planتغییر تأییدشده با برنامه بازگشت و تست در محیط آزمایشی.
- Ansible --check --diffاول اجرای آزمایشی؛ قالبها از منبع حقیقت.
- Pre-checksثبت خودکار وضعیت قبل: تعداد همسایهها، تعداد مسیرها و prefixهای کلیدی.
- Canaryاول دو سه دستگاه، بعد دستههای بعدی؛ با اولین خطا توقف.
- Post-checks · commit confirmedمقایسه با وضعیت قبل، زیر نظر داشتن مانیتورینگ و آماده بودن بازگشت.
I30Find every device running outdated software using the Catalyst Center API.با API در Catalyst Center همه دستگاههایی که نرمافزار قدیمی دارند را پیدا کنید.
Strong answerجواب قوی
Get a token, page through the network-device endpoint, compare softwareVersion per platform with the approved baseline, export a report — and handle errors (401 → refresh token, 429 → back off).
توکن بگیرید، لیست دستگاهها را صفحهبهصفحه بخوانید، نسخه نرمافزار هر پلتفرم را با نسخه تأییدشده مقایسه کنید و خروجی CSV بگیرید. خطاها را هم مدیریت کنید: کد 401 یعنی توکن را دوباره بگیرید و 429 یعنی کمی صبر کنید.
import csv, requests
from requests.auth import HTTPBasicAuth
BASE = "https://catalyst-center.example"
BASELINE = {"C9300": "17.12.4", "C9500": "17.12.4"}
token = requests.post(f"{BASE}/dna/system/api/v1/auth/token",
auth=HTTPBasicAuth("apiuser", "PASS")).json()["Token"]
hdr = {"X-Auth-Token": token}
outdated, offset = [], 1
while True:
r = requests.get(f"{BASE}/dna/intent/api/v1/network-device",
headers=hdr, params={"offset": offset, "limit": 500})
r.raise_for_status()
page = r.json()["response"]
for d in page:
family = (d.get("platformId") or "")[:5]
target = BASELINE.get(family)
if target and d.get("softwareVersion") != target:
outdated.append([d["hostname"], d["platformId"], d["softwareVersion"], target])
if len(page) < 500:
break
offset += 500
with open("outdated.csv", "w", newline="") as f:
csv.writer(f).writerows([["host", "platform", "running", "target"], *outdated])I31What would you automate with EEM and what with Ansible?چه چیزی را با EEM و چه چیزی را با Ansible خودکار میکنید؟
Strong answerجواب قوی
EEM = on-box and event-driven: capture diagnostics at the exact moment of failure (syslog pattern, track down, CPU threshold), react locally when the device is cut off from the NMS, or block risky commands. Ansible = off-box orchestration across many devices: configuration consistency, bulk changes, compliance reports. They complement each other — e.g. Ansible deploys the EEM applets.
- EEMروی خود دستگاه و بر اساس رویداد: ثبت اطلاعات دقیقاً در لحظه خرابی (پیام syslog، قطع track، CPU بالا)، واکنش محلی وقتی دستگاه از سیستم مدیریت جدا شده، یا جلوگیری از دستورات خطرناک.
- Ansibleبیرون از دستگاه و برای تعداد زیاد: یکسانسازی کانفیگ، تغییرات انبوه و گزارش انطباق.
این دو مکمل هماند؛ مثلاً خود EEMها را Ansible نصب میکند.
I32Tell me about a mistake you made in production.از اشتباهی که در production کردهاید بگویید.
Strong answerجواب قوی
Pick a real, moderate mistake. Structure: what happened, how you noticed, how you restored service (and how fast), how you communicated, and — most important — what you changed afterwards so it can't recur (pre-checks, peer review, automation, monitoring). Own it; don't blame others.
یک اشتباه واقعی و متوسط انتخاب کنید و به این ترتیب تعریفش کنید: چه شد، چطور فهمیدید، چطور و با چه سرعتی سرویس را برگرداندید، چطور اطلاعرسانی کردید، و مهمتر از همه، بعدش چه چیزی را عوض کردید تا تکرار نشود؛ مثل چک قبل از تغییر، بازبینی همکار، اتوماسیون یا هشدار جدید. مسئولیت را بپذیرید و کسی را مقصر نکنید.
They're checkingچه چیزی را میسنجند
Ownership and learning — every senior engineer has broken something.
مسئولیتپذیری و یادگیری — هر مهندس ارشدی چیزی را خراب کرده است.
Questions to Ask the Interviewerسؤالاتی که از مصاحبهکننده بپرسید
- What does the topology look like today — campus, DC, branches — and which vendors are in each part?
- Is "ASR" ASR 1000 or ASR 9000? Who are your upstream providers, and do you run BGP yourselves?
- What's your monitoring and logging stack, and what's the biggest blind spot right now?
- How do changes go through — CAB, maintenance windows, automation?
- How mature is automation, and is there a source of truth (NetBox, Git)?
- What's the on-call model and the typical incident load?
- What's the biggest network pain point you'd want solved in the first six months?
- How is documentation kept — and how up to date is it?
- Is there support for training and certification (e.g. CCNP)?
- توپولوژی فعلی چگونه است — کمپوس، دیتاسنتر و شعب — و در هر بخش از کدام Vendorها استفاده میکنید؟
- منظور از ASR، مدل ASR 1000 است یا ASR 9000؟ ISPهای بالادستی چه کسانی هستند و آیا خودتان BGP اجرا میکنید؟
- ابزارهای مانیتورینگ و لاگ چیست و بزرگترین نقطه کور فعلی کجاست؟
- فرایند change چطور است — CAB، پنجره نگهداری، اتوماسیون؟
- اتوماسیون در چه سطحی است و آیا منبع حقیقت (NetBox یا Git) دارید؟
- مدل on-call چیست و حجم معمول incidentها چقدر است؟
- بزرگترین مشکل شبکه که میخواهید در شش ماه اول حل شود چیست؟
- مستندات کجا نگهداری میشود و چقدر بهروز است؟
- آیا از آموزش و مدرک (مثلاً CCNP) حمایت میکنید؟
Sourcesمنابع
- Cisco — Nexus 9000 NX-OS 10.6(x): Configuring vPCs
- Cisco — Nexus 9000 Troubleshooting: vPCs
- Cisco — FTD captures and packet-tracer
- Cisco — Analyze Firepower firewall captures
- Fortinet — FortiOS 7.4 Troubleshooting Cheat Sheet
- Fortinet — Debugging the packet flow
- Fortinet — SSL VPN tunnel mode replaced with IPsec VPN (FortiOS 7.6.3)
- Cisco Learning Network — 350-401 ENCOR v1.2 exam topics
- Cisco — ENCOR v1.2 exam topics (PDF)
- Cisco — Catalyst 9300 Control Plane Policing
- MikroTik — RouterOS BGP
- MikroTik — /routing/bgp reference
- RUCKUS — Unleashed, SmartZone, RUCKUS One
- Microsoft Learn — VPN protocols in RRAS
- BleepingComputer — Microsoft deprecates PPTP and L2TP
Other values (AD, BGP best-path, DSCP, ITU-T G.114, ports) are long-standing protocol facts. Check version-specific syntax against your exact release.
سایر مقادیر (AD، ترتیب انتخاب مسیر BGP، DSCP، G.114 و پورتها) حقایق ثابت پروتکلها هستند. سینتکس وابسته به نسخه را با نسخه دقیق نرمافزار خودتان چک کنید.
Deep Diveتوضیح کامل مباحث
The same topics as the cheat sheet, explained one level deeper: how the mechanism works step by step, worked examples with real numbers, and the follow-up questions interviewers use to test understanding.همان مباحث چیتشیت، یک سطح عمیقتر: مکانیزم قدمبهقدم، مثال با عدد واقعی و سؤالهای تکمیلی که مصاحبهکننده برای سنجیدن فهم واقعی میپرسد.
How a Switch Forwards Framesسوئیچ چطور فریم را ارسال میکند
Step by stepقدمبهقدم
- Learn — Frame arrives on Gi1/0/1 with source MAC A → table entry
A → Gi1/0/1, VLAN 10(aging timer, default 300 s). - Lookup — Destination MAC B looked up in the MAC (CAM) table for VLAN 10.
- Forward / Flood — Found → send only to that port. Not found, or broadcast FF:FF:FF:FF:FF:FF → flood within VLAN 10.
- Trunk — On a trunk, the frame carries an 802.1Q tag (VLAN ID) — except the native VLAN, which is sent untagged.
- Learnفریم از Gi1/0/1 با MAC مبدأ A وارد میشود؛ سوئیچ ثبت میکند A پشت این پورت و در VLAN 10 است. این رکورد اگر استفاده نشود بعد از ۳۰۰ ثانیه پاک میشود.
- LookupMAC مقصد B در جدول MAC همان VLAN جستجو میشود.
- Forward / Floodاگر پیدا شد فقط به همان پورت میرود؛ اگر پیدا نشد یا broadcast بود، در کل VLAN 10 پخش میشود.
- Trunkروی ترانک، فریم تگ 802.1Q با شماره VLAN دارد؛ بهجز native VLAN که بدون تگ ارسال میشود.
STP / RSTP in Depth — Election with an ExampleSTP و RSTP با جزئیات — انتخابها با مثال
The four decisions, in orderچهار تصمیم، به ترتیب
- 1 · Root bridge — Lowest Bridge ID = priority + VLAN (sys-id-ext) + MAC. Ties on priority → lowest MAC wins — which is why an old switch can become root by accident.
- 2 · Root port — On every non-root switch: lowest path cost to root → lowest sender Bridge ID → lowest sender port priority → lowest sender port number.
- 3 · Designated port — One per segment: the port on the switch with the lowest cost to root for that segment (same tie-breakers). All ports of the root bridge are designated.
- 4 · Block — Every port that is neither root nor designated → blocking (802.1D) / discarding with role alternate or backup (RSTP).
- 1 · Root bridgeکمترین Bridge ID برنده است: priority بهعلاوه شماره VLAN و MAC. اگر priority برابر باشد، MAC کمتر برنده است؛ به همین دلیل گاهی یک سوئیچ قدیمی ناخواسته روت میشود.
- 2 · Root portروی هر سوئیچ غیر روت: کمترین هزینه تا روت، بعد کمترین Bridge ID فرستنده، بعد کمترین port priority فرستنده، بعد کمترین شماره پورت فرستنده.
- 3 · Designated portدر هر سگمنت یک پورت: پورت سوئیچی که برای آن سگمنت کمترین هزینه تا روت را دارد. همه پورتهای روت designated هستند.
- 4 · Blockهر پورتی که نه root است نه designated، مسدود میشود؛ در RSTP با نقش alternate یا backup.
SW1 = aaaa · SW2 = bbbb · SW3 = cccc root primary explicitly so the result doesn't depend on MAC addresses.روی SW1 که سوئیچ distribution است صریحاً root primary تنظیم کنید تا نتیجه به MAC وابسته نباشد.EtherChannel & LACP in DepthEtherChannel و LACP با جزئیات
What LACP actually doesLACP دقیقاً چه کار میکند
- LACPDUs — Each side sends its system ID (priority + MAC), port key and port number every 30 s (or 1 s with
rate fast). - Partner check — A member joins only if the partner is the same system on all links — a cable to the wrong switch stays out (shown as
Iors). - Active members — Max 8 active; extra ports are hot-standby. Lower
lacp system-prioritydecides which side chooses. - Failure — A member down → its flows re-hash onto the remaining members within about a second; no STP reconvergence.
- LACPDUsهر طرف شناسه سیستم، key و شماره پورت خود را هر ۳۰ ثانیه (یا هر ثانیه با rate fast) میفرستد.
- Partner checkعضو فقط وقتی اضافه میشود که طرف مقابل روی همه لینکها یک سیستم باشد؛ کابلی که به سوئیچ اشتباه رفته بیرون میماند.
- Active membersحداکثر ۸ عضو فعال؛ بقیه آماده به کار میمانند. سیستمی که system-priority کمتری دارد تعیین میکند کدام پورتها فعال باشند.
- Failureبا قطع یک عضو، جریانهایش در حدود یک ثانیه روی بقیه پخش میشوند و STP دوباره محاسبه نمیکند.
on + LACP on the other side does not bundle; with mismatched modes a loop is possible during misconfiguration.حالت on در یک طرف و LACP در طرف دیگر باندل نمیسازد و در زمان تنظیم اشتباه احتمال لوپ وجود دارد.vPC Failure Scenariosسناریوهای خرابی در vPC
auto-recovery it waits for the peer forever and keeps vPCs down; with it, it brings them up after a timeout.بدون auto-recovery منتظر طرف مقابل میماند و vPCها را بالا نمیآورد؛ با آن، بعد از مدتی آنها را فعال میکند.How a Router Chooses a Routeروتر چطور مسیر را انتخاب میکند
Three separate decisionsسه تصمیم جدا
- 1 · Within a protocol — Each protocol picks its best path by its own metric (OSPF cost, EIGRP composite, BGP best-path).
- 2 · Between protocols — Same prefix from several sources → lowest Administrative Distance wins the RIB (static 1 beats OSPF 110).
- 3 · Forwarding — For each packet: the most specific matching prefix wins, regardless of AD.
- 1 · Within a protocolهر پروتکل بهترین مسیر خودش را با metric خودش انتخاب میکند.
- 2 · Between protocolsاگر یک prefix از چند منبع برسد، منبعی با AD کمتر در جدول نصب میشود؛ مثلاً static با ۱ بر OSPF با ۱۱۰ غلبه میکند.
- 3 · Forwardingبرای هر بسته، دقیقترین prefix منطبق برنده است، مستقل از AD.
10.0.0.0/8 OSPF 10.1.0.0/16 static 10.1.1.0/24 EIGRP 0.0.0.0/0 static 10.1.1.0/24 از EIGRP؛ چون دقیقترین است.10.1.0.0/16 از static.10.0.0.0/8 از OSPF.OSPF Neighbours, DR/BDR and Network Typesهمسایگی OSPF، DR/BDR و انواع شبکه
Neighbour state machineمراحل همسایگی
- Down — No Hello received yet.
- Init — Hello received, but my Router-ID is not in the neighbour's list → communication is one-way.
- 2-Way — Each sees itself in the other's Hello → bidirectional. DR/BDR election happens here. Two DROTHERs stay in 2-Way — normal.
- ExStart — Master/slave chosen (higher Router-ID = master) to sequence DBD packets. Stuck here = MTU mismatch.
- Exchange — DBDs list the headers of every LSA each router has.
- Loading — Missing or newer LSAs are requested (LSR) and sent (LSU).
- Full — Databases identical → SPF runs → routes installed.
- Downهنوز Helloیی دریافت نشده.
- InitHello رسیده، ولی Router-ID من در لیست همسایه نیست؛ ارتباط یکطرفه است.
- 2-Wayهر کدام خودش را در Hello دیگری میبیند؛ ارتباط دوطرفه است و انتخاب DR و BDR اینجا انجام میشود. دو روتر DROTHER در همین حالت میمانند و این طبیعی است.
- ExStartmaster و slave انتخاب میشوند (Router-ID بالاتر master است) تا ترتیب بستههای DBD مشخص شود. گیر کردن اینجا یعنی MTU متفاوت است.
- Exchangeبستههای DBD فهرست هدر همه LSAهای هر روتر را مبادله میکنند.
- LoadingLSAهای ناموجود یا جدیدتر درخواست (LSR) و ارسال (LSU) میشوند.
- Fullدیتابیسها یکساناند؛ SPF اجرا و مسیرها نصب میشوند.
ip ospf network point-to-point on /30–/31 Ethernet links: faster adjacency, no Type 2 LSA.فقط دو روتر هست و DR لازم نیست؛ روی لینکهای اترنت /30 و /31 نوع شبکه را point-to-point کنید: همسایگی سریعتر و بدون LSA نوع ۲.auto-cost reference-bandwidth identically on every router.پهنای مرجع پیشفرض ۱۰۰ مگابیت است؛ پس لینکهای صد مگ، یک گیگ و ده گیگ همه هزینه ۱ میگیرند و OSPF فرقی بینشان نمیگذارد. reference-bandwidth را روی همه روترها یکسان تنظیم کنید.OSPF LSA Types and Area Types — Who Sends What, Whereانواع LSA و انواع Area در OSPF — چه کسی، چه چیزی، کجا
O.هر روتر برای هر area که در آن است یکی میسازد؛ لینکها، همسایهها و هزینهها را فهرست میکند و داخل همان area میماند. در جدول با O نمایش داده میشود.O IA.ABR میسازد و شبکهای از یک area را در area دیگر اعلام میکند؛ بدون جزئیات توپولوژی، فقط «این prefix با این هزینه از طریق من». با O IA نمایش داده میشود.O E2 (default) or O E1.ASBR برای مسیرهای redistribute شده میسازد و در همه areaها بهجز انواع stub و NSSA پخش میشود. با O E2 (پیشفرض) یا O E1 نمایش داده میشود.O N2 / O N1.ASBRی که داخل NSSA است میسازد؛ داخل NSSA میماند و ABR آن را به نوع ۵ برای بقیه شبکه تبدیل میکند. با O N2 یا O N1 نمایش داده میشود.default-information-originate.۱، ۲، ۳ و ۷؛ بدون ۵. برای شعبهای که باید چیزی را redistribute کند. سیسکو مسیر پیشفرض را خودکار اضافه نمیکند و باید default-information-originate بزنید.OSPF E1 vs E2 — with Numbersتفاوت E1 و E2 در OSPF — با عدد
metric-type 1باید تنظیم شود: metric-type 1O E2 0.0.0.0/0 [110/20] — for E2 the number in brackets is only the external metric.در خروجی show ip route، عدد داخل کروشه برای E2 فقط متریک خارجی است.O intra-areaمسیر داخل areaO IA inter-areaمسیر بین areaهاO E1 / O N1مسیر خارجی نوع ۱O E2 / O N2مسیر خارجی نوع ۲router ospf 1
redistribute static subnets metric-type 1 metric 20 route-map STATIC-TO-OSPF
!
route-map STATIC-TO-OSPF permit 10
match ip address prefix-list LOCAL-STATICS
set tag 100 ! tag helps filter it out later at another redistribution pointOSPF Summarisation, Filtering and Virtual Linksخلاصهسازی، فیلتر و Virtual Link در OSPF
EIGRP DUAL with Numbersالگوریتم DUAL در EIGRP با عدد
variance 3 would let R1 load-share over paths up to 3 × FD — but only over feasible successors. So R3 (32 ≤ 45) qualifies, R4 never does.با variance 3 روتر میتواند روی مسیرهایی تا سه برابر FD تقسیم بار کند، ولی فقط روی feasible successorها؛ پس R3 (۳۲ کمتر از ۴۵) واجد شرایط است و R4 هیچوقت.BGP in Depth — Sessions, Attributes, Best PathBGP با جزئیات — سشن، attributeها و بهترین مسیر
Session establishmentبرقراری سشن
- Idle → Connect — BGP tries to open TCP 179 to the configured neighbour IP.
- Active — TCP failed; BGP keeps retrying and listening. 'Active' is bad news, not good.
- OpenSent / OpenConfirm — OPEN messages exchanged: AS number, Router-ID, hold time (lowest wins; keepalive = 1/3), capabilities (address families, 4-byte AS, route refresh).
- Established — UPDATEs carry prefixes and attributes; KEEPALIVEs every 60 s; a NOTIFICATION closes the session with an error code.
- Idle → ConnectBGP تلاش میکند به آدرس همسایه روی TCP 179 وصل شود.
- Activeاتصال TCP ناموفق بوده و BGP دوباره تلاش میکند. Active یعنی مشکل، نه سلامت.
- OpenSent / OpenConfirmپیام OPEN مبادله میشود: شماره AS، Router-ID، hold time (کمترین مقدار دو طرف؛ keepalive یکسوم آن) و قابلیتها.
- EstablishedUPDATEها prefix و attribute را منتقل میکنند؛ KEEPALIVE هر ۶۰ ثانیه؛ NOTIFICATION سشن را با کد خطا میبندد.
no-export (don't send to eBGP), no-advertise (don't send to anyone), local-AS.برچسبی که طرف مقابل بر اساسش عمل میکند. انواع شناختهشده: no-export (به eBGP نفرست)، no-advertise (به هیچکس نفرست) و local-AS.ISP1 · weight 0 · LP 100 · AS path 65010 65020 · MED 50 ISP2 · weight 0 · LP 200 · AS path 65030 65040 65050 · MED 0 FHRP Failover — What Actually HappensFailover در FHRP — دقیقاً چه اتفاقی میافتد
HSRP failover sequenceترتیب failover در HSRP
- Normal — Active (priority 110) answers ARP for 10.10.10.1 with the virtual MAC (HSRPv2 group 10 = 0000.0c9f.f00a) and sends hellos every 3 s.
- Failure — Standby misses hellos for the hold time (10 s by default) — or much faster with BFD or tuned timers.
- Takeover — Standby becomes active, starts using the same virtual MAC and sends gratuitous ARP so switches relearn which port the MAC is behind.
- Tracking — If the active router's uplink fails but the router stays up,
track … decrement 20drops its priority to 90 so the standby (100) takes over — requires preempt on the standby. - Recovery — With
preempt delay minimum 60the original router waits for routing to converge before taking the role back.
- Normalروتر فعال با priority صد و ده به ARP آدرس 10.10.10.1 با MAC مجازی پاسخ میدهد و هر ۳ ثانیه hello میفرستد.
- Failureروتر پشتیبان تا پایان hold time (پیشفرض ۱۰ ثانیه) hello دریافت نمیکند؛ با BFD یا تایمر کوتاهتر خیلی سریعتر.
- Takeoverروتر پشتیبان فعال میشود، همان MAC مجازی را استفاده میکند و gratuitous ARP میفرستد تا سوئیچها محل جدید MAC را یاد بگیرند.
- Trackingاگر آپلینک روتر فعال قطع شود ولی خود روتر روشن بماند، track اولویتش را به ۹۰ کم میکند تا روتر پشتیبان با ۱۰۰ نقش را بگیرد؛ این کار preempt روی روتر پشتیبان لازم دارد.
- Recoveryبا preempt delay روتر اصلی صبر میکند تا مسیریابی همگرا شود و بعد نقش را پس میگیرد.
VRF, RD and RT — Why Two Different Numbers?VRF، RD و RT — چرا دو عدد متفاوت؟
65000:1:10.0.0.0/24 · export RT 65000:1RD 65000:1 → 65000:1:10.0.0.0/24 · RT 65000:1 RD باعث میشود prefix در MP-BGP یکتا شود و RT برای export استفاده میشود.65000:2:10.0.0.0/24 · export RT 65000:2RD 65000:2 → 65000:2:10.0.0.0/24 · RT 65000:2 همان prefix ولی با شناسه متفاوت.NAT in Depth — SNAT vs DNAT, Packet Walk, Order of OperationsNAT با جزئیات — تفاوت SNAT و DNAT، مسیر بسته و ترتیب عملیات
action=src-nat / masqueradesrc-nat یا masqueradeaction=dst-natdst-natip nat inside source list … overloadبا list و overloadip nat inside source static tcp 10.0.0.10 443 203.0.113.10 443static با پورت192.168.1.10:51000 → 93.184.216.34:443 مبدأ آدرس داخلی است و مقصد سایت.203.0.113.5:40001 → 93.184.216.34:443 مبدأ به IP عمومی و پورت جدید تغییر میکند و یک رکورد ترجمه ذخیره میشود.93.184.216.34:443 → 203.0.113.5:40001 پاسخ به IP عمومی روتر برمیگردد.93.184.216.34:443 → 192.168.1.10:51000 با همان رکورد، مقصد به آدرس و پورت داخلی برگردانده میشود.198.51.100.7:55000 → 203.0.113.10:443 مقصد، آدرس عمومی سرویس است.198.51.100.7:55000 → 10.0.0.10:443 مقصد به آدرس داخلی سرور تغییر میکند و بعد به DMZ مسیریابی میشود.10.0.0.10:443 → 198.51.100.7:55000 سرور از آدرس داخلی خودش پاسخ میدهد.203.0.113.10:443 → 198.51.100.7:55000 مبدأ دوباره به آدرس عمومی تبدیل میشود تا کلاینت پاسخ را از همان آدرسی ببیند که به آن وصل شده.iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE # SNAT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 10.0.0.10:443 # DNAT
iptables -A FORWARD -d 10.0.0.10 -p tcp --dport 443 -j ACCEPT # filter sees the NEW (private) dst
/ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade
/ip firewall nat add chain=dstnat in-interface=ether1 protocol=tcp dst-port=443 action=dst-nat to-addresses=10.0.0.10Stateful Firewalls and Session Tablesفایروال stateful و جدول session
Life of a sessionچرخه عمر یک session
- First packet (SYN) — Matched against policy top-down. If allowed → session created (src, dst, ports, protocol, NAT info, zone, timeout).
- Fast path — Later packets of the same flow match the session table — no policy lookup, which is why throughput is high.
- Return traffic — Matches the reverse of the session → allowed automatically.
- Teardown — FIN/RST or idle timeout (TCP often 3600 s, UDP ~30–180 s). Session removed.
- First packet (SYN)اولین بسته با policyها از بالا به پایین مقایسه میشود. اگر مجاز باشد، session با مشخصات کامل و تایمر ساخته میشود.
- Fast pathبستههای بعدی همان جریان با جدول session تطبیق داده میشوند و دوباره policy بررسی نمیشود؛ دلیل سرعت بالا همین است.
- Return trafficترافیک برگشت با معکوس session تطبیق دارد و خودکار مجاز است.
- Teardownبا FIN یا RST یا اتمام زمان بیکاری (TCP معمولاً یک ساعت، UDP بین ۳۰ تا ۱۸۰ ثانیه) حذف میشود.
QoS in Depth — Marking, Queuing, Policing vs ShapingQoS با جزئیات — marking، صفبندی، policing و shaping
VoIP Quality — What Breaks Callsکیفیت VoIP — چه چیزی تماس را خراب میکند
IPsec IKEv2 — the Full ExchangeIPsec با IKEv2 — مبادله کامل
Message by messageپیام به پیام
- IKE_SA_INIT (msg 1–2) — Propose crypto (encryption, integrity/PRF, DH group), exchange DH public values and nonces. NAT detection payloads reveal NAT → switch to UDP 4500. After this both sides share a key, but nobody is authenticated yet.
- IKE_AUTH (msg 3–4) — Encrypted. Identities + authentication (PSK, certificates, or EAP), and the first CHILD_SA: traffic selectors (which subnets) and ESP proposals.
- CREATE_CHILD_SA — Additional tunnels or rekeying. With PFS, a new DH exchange happens here so a stolen key can't decrypt future data.
- INFORMATIONAL — Dead peer detection, delete notifications, errors.
- IKE_SA_INIT (msg 1–2)پیشنهاد الگوریتمها (رمزنگاری، integrity، گروه DH)، مبادله مقادیر عمومی DH و nonce. اگر NAT تشخیص داده شود، به UDP 4500 میروند. بعد از این مرحله کلید مشترک دارند ولی هنوز هویت کسی تأیید نشده.
- IKE_AUTH (msg 3–4)رمزشده. هویت و احراز هویت (PSK، گواهی یا EAP) و اولین CHILD_SA شامل traffic selectorها (کدام شبکهها) و پیشنهادهای ESP.
- CREATE_CHILD_SAتونلهای بیشتر یا تعویض کلید. با PFS یک DH جدید انجام میشود تا کلید لو رفته نتواند دادههای آینده را باز کند.
- INFORMATIONALتشخیص طرف از کار افتاده (DPD)، اعلام حذف و خطاها.
WireGuard Internalsساختار داخلی WireGuard
Encapsulation Overhead and MTU Problemsسربار encapsulation و مشکلات MTU
Diagnose and fixتشخیص و رفع
- Test —
ping -M do -s 1472 x.x.x.x(Linux) /ping -f -l 1472(Windows); lower the size until it passes. 1472 + 28 = 1500. - Fix TCP —
ip tcp adjust-mss 1360on the tunnel interface — rewrites MSS in SYN packets so endpoints never send too big segments. - Fix the rest — Set the tunnel
ip mtuand allow ICMP type 3 code 4 (fragmentation needed) through firewalls so PMTUD works for UDP too.
- Testبا ping و بیت DF اندازه را کم کنید تا عبور کند؛ ۱۴۷۲ بهعلاوه ۲۸ بایت هدر برابر ۱۵۰۰ است.
- Fix TCPروی اینترفیس تونل MSS را تنظیم کنید؛ MSS در بستههای SYN بازنویسی میشود تا طرفین بسته بزرگ نفرستند.
- Fix the restMTU تونل را تنظیم کنید و ICMP نوع ۳ کد ۴ را در فایروالها باز بگذارید تا PMTUD برای UDP هم کار کند.
SD-WAN — How an Edge Joins and Picks a PathSD-WAN — اتصال edge و انتخاب مسیر
Cisco Catalyst SD-WAN onboardingاتصال یک edge در Cisco Catalyst SD-WAN
- vBond / Validator — Edge contacts the orchestrator first (from PnP/ZTP or bootstrap), mutual cert check, learns the controllers' addresses. Also helps NAT traversal.
- vManage / Manager — Edge connects and downloads its configuration template.
- vSmart / Controller — DTLS/TLS session; OMP carries routes, TLOCs (transport endpoints) and policies.
- Data plane — IPsec tunnels built directly edge-to-edge for each TLOC pair; BFD runs inside each tunnel to measure loss/latency/jitter.
- App-aware routing — An SLA class (e.g. voice: loss < 1 %, latency < 150 ms) maps apps to tunnels that meet it; if none do, fallback behaviour applies.
- vBond / Validatoredge اول به ارکستراتور وصل میشود، گواهیها متقابلاً بررسی و آدرس کنترلرها اعلام میشود؛ در عبور از NAT هم کمک میکند.
- vManage / Manageredge وصل میشود و قالب پیکربندیاش را دریافت میکند.
- vSmart / Controllerسشن DTLS یا TLS؛ پروتکل OMP مسیرها، TLOCها و policyها را منتقل میکند.
- Data planeتونلهای IPsec مستقیم بین edgeها برای هر جفت TLOC ساخته میشوند و BFD داخل هر تونل افت، تأخیر و jitter را اندازه میگیرد.
- App-aware routingیک کلاس SLA (مثلاً صدا: افت زیر یک درصد و تأخیر زیر ۱۵۰) اپلیکیشنها را به تونلهایی که شرط را دارند میفرستد؛ اگر هیچکدام نداشت، رفتار جایگزین اعمال میشود.
802.1X / NAC — the Authentication Flow802.1X و NAC — روند احراز هویت
Flowمراحل
- Link up — Port is unauthorised: only EAPoL (and possibly CDP/LLDP) allowed.
- EAP identity — Switch asks for identity; PC answers; switch wraps it in RADIUS Access-Request to the server.
- EAP method — Server and PC run the method inside RADIUS: PEAP-MSCHAPv2 (password in a TLS tunnel) or EAP-TLS (certificates on both sides — strongest).
- Access-Accept — Includes authorisation: VLAN (Tunnel-Private-Group-ID), downloadable ACL or SGT. Port opens.
- MAB fallback — Printers/phones without a supplicant: after a timeout the switch uses the MAC address as username (weak — MACs can be spoofed, so restrict what MAB gets).
- CoA — Later, the server can push a Change of Authorization (e.g. quarantine after a posture failure) without the user reconnecting.
- Link upپورت مجاز نیست: فقط EAPoL (و احتمالاً CDP و LLDP) عبور میکند.
- EAP identityسوئیچ هویت میخواهد، کامپیوتر پاسخ میدهد و سوئیچ آن را در RADIUS Access-Request به سرور میفرستد.
- EAP methodسرور و کامپیوتر روش EAP را داخل RADIUS اجرا میکنند: PEAP-MSCHAPv2 (رمز داخل تونل TLS) یا EAP-TLS (گواهی در دو طرف — قویترین).
- Access-Acceptشامل مجوزهاست: VLAN، ACL قابل دانلود یا SGT؛ پورت باز میشود.
- MAB fallbackبرای پرینتر و تلفن بدون supplicant: بعد از مهلت، سوئیچ MAC را بهعنوان نام کاربری میفرستد. ضعیف است چون MAC جعل میشود؛ پس دسترسی MAB را محدود کنید.
- CoAبعداً سرور میتواند با CoA مجوز را تغییر دهد (مثلاً قرنطینه بعد از شکست posture) بدون اینکه کاربر دوباره وصل شود.
TLS 1.3 and Certificate ValidationTLS 1.3 و اعتبارسنجی گواهی
Handshakehandshake
- ClientHello — Supported ciphers, key share (DH public value), SNI (the hostname — visible in clear, which is how SNI filtering works).
- ServerHello — Chosen cipher + server key share → both now compute the same secret. Everything after this is encrypted.
- Certificate + CertificateVerify — Server sends its chain and signs the handshake with its private key — proves it owns the certificate.
- Finished — MACs over the whole handshake — detects tampering. Application data flows.
- ClientHelloالگوریتمهای پشتیبانیشده، key share و SNI یعنی نام دامنه که رمز نشده و فیلترینگ مبتنی بر SNI از همین استفاده میکند.
- ServerHelloالگوریتم انتخابشده و key share سرور؛ هر دو طرف کلید مشترک را محاسبه میکنند و از اینجا به بعد همه چیز رمز است.
- Certificate + CertificateVerifyسرور زنجیره گواهی را میفرستد و handshake را با کلید خصوصی امضا میکند تا ثابت کند مالک گواهی است.
- Finishedهش کل handshake برای تشخیص دستکاری؛ سپس داده اپلیکیشن ارسال میشود.
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltNameSNMP, NetFlow and Syslog in DepthSNMP، NetFlow و Syslog با جزئیات
%LINEPROTO-5-UPDOWN: Line protocol on Interface Gi0/1, changed state to down = facility-severity-mnemonic.ساختار پیام: facility، severity و mnemonic.service timestamps … msec to correlate events.UDP 514 (ممکن است گم شود) یا TCP و TLS روی 6514. برای مرتبط کردن رویدادها NTP درست و timestamp با میلیثانیه لازم است.Automation — NETCONF, RESTCONF, Ansibleاتوماسیون — NETCONF، RESTCONF و Ansible
Multicast — PIM-SM Step by StepMulticast — مراحل PIM-SM
Walk-through: receiver joins 239.1.1.1, source S starts sendingمراحل: گیرنده عضو 239.1.1.1 میشود و منبع S ارسال را شروع میکند
- IGMP report — Receiver sends an IGMP membership report; the last-hop router (LHR) creates (*,G).
- (*,G) join — LHR sends a PIM join hop-by-hop toward the RP (RPF check uses the unicast route to the RP). Shared tree built.
- Register — S sends; the first-hop router (FHR) encapsulates packets in unicast PIM Register messages to the RP.
- (S,G) to the source — RP joins (S,G) toward S, receives native multicast, sends Register-Stop to FHR.
- SPT switchover — After the first packet (Cisco default threshold 0) LHR joins (S,G) directly toward S, then prunes S off the shared tree (RPT prune).
- IGMP reportگیرنده IGMP report میفرستد و روتر آخر (LHR) رکورد (*,G) میسازد.
- (*,G) joinLHR یک PIM join هاپ به هاپ به سمت RP میفرستد؛ بررسی RPF با مسیر unicast به RP انجام میشود و درخت مشترک ساخته میشود.
- RegisterS ارسال میکند و روتر اول (FHR) بستهها را در پیامهای unicast از نوع Register به RP میفرستد.
- (S,G) to the sourceRP به سمت S یک join از نوع (S,G) میفرستد، multicast بومی دریافت میکند و Register-Stop به FHR میفرستد.
- SPT switchoverبعد از اولین بسته (آستانه پیشفرض سیسکو صفر) LHR مستقیم به سمت S عضو (S,G) میشود و S را از درخت مشترک prune میکند.
SD-Access and VXLAN/LISP — How a Host Gets ConnectedSD-Access و VXLAN/LISP — هاست چطور وصل میشود
Host onboardingاتصال هاست
- Authenticate — Laptop connects to an edge node → 802.1X with ISE → ISE returns the VN (VRF), IP pool and SGT (e.g. Employees = 10).
- Register — Edge registers the endpoint (EID = host IP/MAC) with the control-plane node (LISP map-server): 'EID 10.10.10.5 is behind RLOC 192.168.0.11'.
- Resolve — Another edge wanting to reach 10.10.10.5 sends a LISP map-request and caches the answer.
- Forward — Traffic is VXLAN-encapsulated to RLOC 192.168.0.11, carrying the VNI and the source SGT.
- Enforce — Egress edge checks the SGACL matrix (src SGT × dst SGT) and permits or drops.
- Roam — Host moves to another edge → re-registers → control plane updates and old edges are told to refresh. Same IP, same policy.
- Authenticateلپتاپ به edge وصل میشود، با ISE احراز هویت 802.1X انجام میشود و ISE شبکه مجازی، pool آدرس و SGT را برمیگرداند.
- Registeredge هاست را در نود control plane ثبت میکند: «این EID پشت این RLOC است».
- Resolveedge دیگری که میخواهد به این هاست برسد map-request میفرستد و پاسخ را cache میکند.
- Forwardترافیک در VXLAN به RLOC مقصد فرستاده میشود و VNI و SGT مبدأ را حمل میکند.
- Enforceedge مقصد ماتریس SGACL را بررسی میکند و اجازه میدهد یا دور میریزد.
- Roamهاست به edge دیگری میرود، دوباره ثبت میشود و control plane بهروز میشود. همان IP و همان policy.
NTP Detailsجزئیات NTP
ntp authenticate + key + trusted-key — prevents a rogue time source.با کلید و trusted-key از منبع زمان جعلی جلوگیری میشود.