1) Infrastructure & Protocoles
TCP/UDP/QUIC · ICMP/ARP/ND · IPv4/IPv6 & Subnetting · NAT/PAT · Routage statique/PBR · OSPF/IS-IS/BGP · Multicast · QoS · L2 & STP · HA (VRRP/HSRP) · MPLS (intro) · Outils & Debug.
TCP/IP IPv4/IPv6 NAT/PAT OSPF/BGP Multicast QoS
TCP/UDP & QUIC — États, timers, congestion, tuning noyau
TCP (rappel utile)
- Handshake SYN→SYN/ACK→ACK ; teardown FIN/ACK ou RST.
- Fiabilité : numéros de séquence, ACK cumulatifs, SACK/DSACK, retransmissions.
- Contrôles : rwnd (receveur) · cwnd (émetteur) · MSS · PMTUD/PLPMTUD.
- Nagle vs Delayed ACK : petits writes → latence ; activer
TCP_NODELAYpour RPC/basse latence.
UDP
- Aucun contrôle d’erreur ni de flux. Usage : DNS, RTP, syslog, transports userspace (QUIC).
- Ports : 0–1023 système · 1024–49151 registres · 49152–65535 éphémères.
- Risque de fragmentation : privilégier PMTU + payloads courts.
Mesures clés
- RTT/jitter/p95, perte, retransmissions, out-of-order, zero-window.
- Fenêtre effective = min(cwnd, rwnd) ; débit ≈ fenêtre / RTT.
Machine d’états (côté serveur)
| État | Déclencheur | Notes |
|---|---|---|
| LISTEN | socket passive | En attente SYN |
| SYN-RECV | SYN reçu, SYN/ACK envoyé | Backlog/SYN cookies |
| ESTABLISHED | ACK du SYN/ACK | Échanges de data |
| FIN-WAIT-1/2 | FIN émis | Mi-fermeture |
| CLOSE-WAIT | FIN reçu | App doit fermer |
| LAST-ACK | FIN émis après FIN reçu | Attente ACK final |
| TIME-WAIT | Fermeture propre | ≈ 2×MSL, protège des duplicatas |
Timers importants
- RTO (retransmission) ≈ SRTT + 4·RTTVAR (adaptatif).
- Keepalive (inactivité longue) ;
tcp_keepalive_*lisibles viasysctl. - TIME-WAIT ≈ 2×MSL (valeur OS-dépendante) : normal sur serveurs très actifs.
# Inspecter
ss -ant state time-wait | wc -l
sysctl net.ipv4.tcp_keepalive_time net.ipv4.tcp_syn_retriesSignaux Wireshark utiles
tcp.analysis.retransmission,tcp.analysis.fast_retransmissiontcp.window_size_value == 0(zero-window)tcp.options.mss/tcp.analysis.spurious_retransmission
Algorithmes & cas d’usage
| Algo | Profil | Points forts | Notes |
|---|---|---|---|
| CUBIC | Défaut WAN | Stable, efficace RTT élevés | Bon compromis |
| BBR(v2) | Débits/latence | Model-based, pacing | Requiert qdisc fq |
| Reno | Legacy | Simple | Moins performant |
| DCTCP | Datacenter | ECN, faible latence | Nécessite marquage ECN |
Perte & recovery
- Fast-retransmit (3 dupACK), SACK-based recovery.
- RACK/TLP (loss-probe tail) pour fin de flux.
- ECN : éviter pertes → marquage CE + CWR/ECE.
# Activer BBR + pacing fq
sysctl -w net.ipv4.tcp_congestion_control=bbr
sysctl -w net.core.default_qdisc=fqCalculs BDP (Bandwidth-Delay Product)
Fenêtre requise ≈ Débit cible × RTT.
| Débit | RTT | Fenêtre requise | Buffers conseillés |
|---|---|---|---|
| 1 Gbps | 40 ms | ~5 MB | rmem/wmem max ≥ 8–16 MB |
| 10 Gbps | 20 ms | ~25 MB | ≥ 64–128 MB |
| 100 Mbps | 80 ms | ~1 MB | ≥ 4–8 MB |
Débit soutenu ≈ min(cwnd, rwnd)/RTT ; ajuster autotune + qdisc.
MTU/MSS & fragmentation
- Clamp MSS sur VPN/PPPoE pour éviter PMTU black-holes.
- Jumbo frames (9000) utiles en DC homogène seulement.
# PMTU & clamp (nftables)
nft add table ip mangle
nft add chain ip mangle postrouting { type filter hook postrouting priority 0; }
nft add rule ip mangle postrouting tcp flags syn tcp option maxseg size set 1360
# Tests MTU / path
tracepath -n 8.8.8.8
ping -M do -s 1472 8.8.8.8 # 1500-28AQM (anti-bufferbloat)
| AQM | Atout | Où |
|---|---|---|
| fq_codel | Latence faible, simple | Accès/Edge |
| CAKE | + shaping intégré | CPE/Box |
| FQ | Pacing fin (TCP/BBR) | Serveurs |
# Serveur (pacing TCP)
tc qdisc replace dev eth0 root fq maxrate 0
# Edge/CPE (fq_codel)
tc qdisc replace dev eth0 root fq_codel target 5ms interval 100ms
# CAKE avec shaping 100M
tc qdisc replace dev eth0 root cake bandwidth 100Mbit besteffortOffloads principaux
| Offload | But | Cmd |
|---|---|---|
| TSO/GSO | Segmentation TX | ethtool -K eth0 tso on gso on |
| GRO/LRO | Coalescence RX | ethtool -K eth0 gro on lro off (LRO off si routeur) |
| RSS/RPS/XPS | Répartition CPU | Queues & affinités IRQ |
# Stats & rings
ethtool -S eth0 | head
ethtool -g eth0
# Affinités IRQ (ex.)
grep -i eth0 /proc/interrupts
echo 2 > /proc/irq/XX/smp_affinityAdapter ring-buffers pour bursts ; aligner IRQ/NUMA avec RSS.
# RPS/XPS (ex.)
echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
echo f > /sys/class/net/eth0/queues/tx-0/xps_cpus
# GRO/GSO sanity
ethtool -k eth0 | egrep 'gro|gso|tso'# Congestion & pacing
sysctl -w net.ipv4.tcp_congestion_control=bbr
sysctl -w net.core.default_qdisc=fq
# Autotune buffers (ex. haut BDP)
sysctl -w net.ipv4.tcp_rmem="4096 262144 134217728"
sysctl -w net.ipv4.tcp_wmem="4096 262144 134217728"
sysctl -w net.core.rmem_max=134217728
sysctl -w net.core.wmem_max=134217728
# PMTU & timestamps/SACK
sysctl -w net.ipv4.tcp_mtu_probing=1
sysctl -w net.ipv4.tcp_timestamps=1
sysctl -w net.ipv4.tcp_sack=1
# Fast Open (client+serveur)
sysctl -w net.ipv4.tcp_fastopen=3
# TIME-WAIT/ports éphémères (fort trafic)
sysctl -w net.ipv4.ip_local_port_range="20000 60999"
sysctl -w net.ipv4.tcp_tw_reuse=1 # prudence: NAT/load-balancerToujours mesurer avant/après ; version kernel et matos influent fortement.
# Ports & sockets
ss -tinmpoEe
# Tests
iperf3 -c host -t 30 -P 4 # TCP
iperf3 -u -b 200M -c host -t 20 # UDP (jitter/perte)
# MTU/MSS
ip route get 8.8.8.8 | grep mtu
# Compteurs réseau
nstat -az | egrep 'Tcp|Udp'
# qdisc
tc qdisc show dev eth0
# Wireshark filters
tcp.analysis.retransmission || quic || icmp
Playbook
- Mesurer RTT/perte (iperf3, ping, flow-logs).
- Vérifier PMTU/MSS → clamp si need.
- Inspecter qdisc/AQM (fq, fq_codel, cake).
- Buffers/BDP cohérents ? (rmem/wmem).
- NIC offloads/IRQ/RSS équilibrés.
- Choix CC (BBR/CUBIC) + pacing actif.
Signatures & causes
| Symptôme | Cause probable | Action |
|---|---|---|
| Zero-window | App lente / kernel buffers | Augmenter buffers / profiler app |
| DupACKs | Perte/MTU/route asym. | PMTU, AQM, bilan perte |
| RTO fréquent | Jitter extrême | Stabiliser files / ECN/AQM |
SYN flood & backlog
# Protection basique
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.ipv4.tcp_max_syn_backlog=4096Transport QUIC (UDP/443)
- Handshake 1-RTT (TLS 1.3 intégré), 0-RTT (replay-prone) pour reprise.
- Multiplexage sans HoL blocking (streams indépendants).
- Migration de chemin (connection ID), anti-reset (stateless reset token), PLPMTUD.
# Observer QUIC
tcpdump -ni any udp port 443
tshark -Y quic -T fields -e quic.stream_id -e quic.packet_numberPerf & buffers UDP
# Buffers UDP pour QUIC
sysctl -w net.core.rmem_default=262144
sysctl -w net.core.wmem_default=262144
sysctl -w net.core.rmem_max=134217728
sysctl -w net.core.wmem_max=134217728Beaucoup d’implémentations QUIC font leur propre pacing (timer userspace + GSO).
HTTP/3 & outils
# cURL HTTP/3
curl -v --http3 https://example.com
# h3load (nghttp3/ngtcp2) — bench H3
h3load -n 10000 -c 100 https://site/ICMP, ARP & Neighbor Discovery — PMTUD, sécurité, captures (hyper-densifié)
PMTUD/PLPMTUD (principe)
IPv4 PMTUD : DF=1 → routeur renvoie ICMP type 3/code 4 "Frag Needed" (avec MTU)
IPv6 : pas de fragmentation routeur → ICMPv6 type 2 "Packet Too Big" (avec MTU)
PLPMTUD (RFC 4821/8899) : déduit la MTU par sondes sans dépendre d'ICMP- Ne jamais bloquer ICMPv6 Type 2/3/4 ni IPv4 Type 3/11 (sinon black-hole MTU & traceroute KO).
- Outils :
tracepath(découvre MTU),ping -M do(IPv4),ping -6 -s <size>(IPv6).
Diagnostiquer un black-hole MTU
# IPv4 : forcer DF + taille
ping -M do -s 1472 8.8.8.8 # 1500-28
ping -M do -s 8972 host-jumbo # 9000-28
# IPv6 : sonder tailles
ping -6 -s 1452 2001:4860::8888
tracepath -n 8.8.8.8 # remonte la plus petite MTU sur le pathSi latence ↗ + pertes sur gros paquets uniquement → suspecter PMTUD/fragmentation.
TTL/HL ↔ diagnostics
- ICMP Time Exceeded (Type 11 / v6 Type 3) →
traceroute -I(ICMP) ou-T(TCP 80/443). - Unreachables (Type 3 / v6 Type 1) : host/proto/port unreachable (routing/ACL/nat indicateurs).
Schéma PMTUD (ASCII)
Host A --DF pkt(1500)--> R1(1400 MTU) ✖
<-- ICMP Frag Needed (MTU=1400)
Host A réduit MSS/size → renvoie 1400 → ✓ARP (IPv4)
- États : REACHABLE→STALE→DELAY→PROBE→FAILED.
- Gratuitous ARP (GARP) : annonce IP→MAC (failover/ARP cache refresh).
- Proxy ARP (cas limités) : routeur répond à la place d’un hôte.
# Table ARP & GARP
ip neigh
arping -U -I eth0 10.0.0.10 # GARP
# Proxy-ARP (attention)
sysctl -w net.ipv4.conf.eth0.proxy_arp=1NDP (IPv6)
- NS/NA (Neighbor Solicitation/Advertisement), RA/RS (Router Advert./Solicit.).
- DAD (Duplicate Address Detection), options SLLAO/TLLAO (MAC sources/dest).
- RA-Guard/DHCPv6-Guard sur switchs d’accès ; Proxy-NDP pour HA/tunnels.
# Voisinage IPv6
ip -6 neigh
ndisc6 fe80::1%eth0
rdisc6 eth0 # RA réceptionICMPv4 principaux
| Type/Code | Nom | Usage |
|---|---|---|
| 8/0 | Echo Request | Ping |
| 0/0 | Echo Reply | Ping |
| 3/0,1,3,4 | Dest. Unreachable | Network/host/port/Frag Needed |
| 11/0 | Time Exceeded | Traceroute |
| 5/* | Redirect | Éviter (sécurité) |
ICMPv6 principaux
| Type | Nom | Usage |
|---|---|---|
| 128/129 | Echo Req/Rep | Ping |
| 2 | Packet Too Big | PMTUD obligatoire |
| 1 | Dest. Unreachable | Codes variés |
| 3 | Time Exceeded | Traceroute |
| 133–137 | RS, RA, NS, NA, Redirect | NDP |
Overheads (ordre de grandeur)
| Encapsulation | Overhead | MTU utile (base 1500) | Notes |
|---|---|---|---|
| IPv4/TCP | 20+20=40 | 1460 MSS | Sans options |
| IPv6/TCP | 40+20=60 | 1440 MSS | Sans options |
| GRE | ~24 | ≈1476 | Sans IPsec |
| VXLAN | ~50 | ≈1450 | UDP 4789 |
| IPsec ESP (tunnel) | ~50–74 | ≈1426–1450 | Algorithmes variables |
| PPPoE | 8 | 1492 | Souvent clamp MSS |
MSS clamp & PLPMTUD
# nftables — clamp MSS (éviter black-holes)
nft add table ip mangle
nft add chain ip mangle postrouting { type filter hook postrouting priority 0; }
nft add rule ip mangle postrouting tcp flags syn tcp option maxseg size set 1380
# PLPMTUD (côté app/stack) : pas d’ICMP requis → utile si réseau filtre ICMPMenaces & mitigations
- ARP spoof/poison → DAI (Dynamic ARP Inspection) + DHCP Snooping, port-security, 802.1X/MAB.
- RA spoof → RA-Guard, DHCPv6-Guard, IPv6 SAVI (source validation).
- ICMP abuse → rate-limit (CoPP/Policers), pas de blocage PMTUD/Time Exceeded.
- Redirects → désactiver ICMP Redirects sur hôtes/routeurs.
Linux (hôte/routeur)
# ICMP redirects off
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv6.conf.all.accept_redirects=0
# ARP hardening (proxy/announce/ignore selon rôle)
sysctl -w net.ipv4.conf.all.arp_ignore=1
sysctl -w net.ipv4.conf.all.arp_announce=2
# Rate-limit ICMP (préserver PMTUD/TTL)
nft add table inet filter
nft add chain inet filter input { type filter hook input priority 0; }
nft add rule inet filter input meta l4proto icmp limit rate 100/second accept
nft add rule inet filter input meta l4proto icmp counter drop # ajuster / exceptions v6CoPP/Control-Plane (ex. Cisco)
class-map match-any ICMP-CP
match protocol icmp
policy-map CONTROL-PLANE-POLICY
class ICMP-CP
police 128000 conform-action transmit exceed-action drop
control-plane
service-policy input CONTROL-PLANE-POLICYARP/NDP (Linux)
# Timers & seuils ARP
sysctl -a | egrep 'neigh.*(gc_thresh|base_reachable|gc_stale_time)'
# Exemples
sysctl -w net.ipv4.neigh.default.gc_stale_time=120
sysctl -w net.ipv4.neigh.default.gc_thresh1=1024
sysctl -w net.ipv4.neigh.default.gc_thresh2=4096
sysctl -w net.ipv4.neigh.default.gc_thresh3=8192
# IPv6 NUD
sysctl -w net.ipv6.neigh.default.base_reachable_time_ms=30000Hôtes Windows
arp -a
netsh interface ipv6 show neighbors
# Flush ARP/NDP
arp -d *
netsh interface ip delete arpcacheSur serveurs RDS/VDI très chargés : surveiller saturation de cache ARP.
tcpdump
# Filtrer L3 contrôle
tcpdump -ni any '(arp or icmp or icmp6)'
# PMTUD spécifique
tcpdump -ni any 'icmp[0]=3 and icmp[1]=4' # Frag Needed (v4)
tcpdump -ni any 'icmp6 and ip6[40]=2' # PTB (v6)Wireshark (display filters)
arp || icmp || icmpv6
icmp.type==3 && icmp.code==4 # v4 Frag Needed
icmpv6.type==2 # v6 Packet Too Big
ndp || icmpv6.nd.ns || icmpv6.nd.naeBPF/bpftrace (détection simple)
# Compter ARP/NS (pseudo)
kprobe:netif_receive_skb { @arp += (proto == 0x806); @icmp6 += (proto == 0x86dd); }Cisco IOS-XE/NX-OS
show ip arp | inc Vlan|Internet
show ipv6 neighbors
# RA-Guard
ipv6 nd raguard policy EDGE
device-role host
interface range Gi1/0/1-24
ipv6 nd raguard attach-policy EDGE
# DAI
ip dhcp snooping
ip arp inspection vlan 10-20Juniper
show arp no-resolve
show nd neighbor
#set ethernet-switching-options secure-access-port ? # RA/DAI équivalents
# CoPP
set firewall family inet filter PROTECT term ICMP from protocol icmp
set firewall family inet filter PROTECT term ICMP then policer P-128k
set firewall family inet filter PROTECT term ICMP then acceptChecklist rapide
- PMTUD : vérifier PTB/Frag-Needed visibles ; activer PLPMTUD côté app si besoin.
- MTU/MSS : mesurer via tracepath ; clamp MSS sur tunnels/VPN/PPPoE.
- Cache ARP/NDP : états anormaux massifs (STALE/FAILED) → tuning gc_thresh*.
- Sécurité : DAI + DHCP Snooping ; RA-Guard/SAVI ; désactiver redirects.
- Policing : CoPP ICMP, sans casser PMTUD/TTL.
Indicateurs à tracer
| Métrique | Symptôme | Interprétation |
|---|---|---|
| icmpFragNeeded/icmp6PacketTooBig | pics corrélés à changements de path | Adapter MSS/MTU |
| ARP misses / NDP fails | latence ARP, timeouts | Cache insuffisant / flaps |
| ICMP Time Exceeded | traceroute OK/KO | Routing/loops/ACL |
Exemple d’incident
# Symptom: downloads HTTP bloqués, pings OK
# 1) tracepath montre MTU 1472 entre CE et PE
# 2) icmp Frag Needed filtré sur FW intermédiaire
# 3) Fix: clamp MSS 1380 + autoriser Frag NeededAdressage IPv4/IPv6 & Subnetting — Plans, VLSM, SLAAC/DHCPv6 (hyper-densifié)
Bonnes pratiques (IPv4 & IPv6)
- Découper par site → zone → rôle (Users/Servers/DMZ/Mgmt/Transit/WAN).
- Réserves 30–50% pour croissance ; pas de chevauchements (VRF incluses).
- Documentation par sous-réseau : GW, DHCP, DNS, ACL, NAT, VLAN, description.
- Numérotation cohérente entre IPv4 et IPv6 (suffixes / VLAN IDs).
Schéma (ex.)
Campus Paris
Users 10.10.0.0/21 2001:db8:10:100::/56
Servers 10.10.8.0/22 2001:db8:10:200::/56
Mgmt 10.10.12.0/24 2001:db8:10:300::/64
Transit 10.10.13.0/30 2001:db8:10:ffff:0:links::/64
Loops 10.255.0.0/24 2001:db8:10:ffff:0:lo::/64Plan par rôle (gabarit)
| Rôle | IPv4 (ex.) | IPv6 (ex.) | Notes |
|---|---|---|---|
| Users | /22 à /20 | /56 | Plusieurs /64 par étage/SSID |
| Servers | /23 à /22 | /56 | Séparer fronts/backs/DB |
| Mgmt/OOB | /24 | /64 | Accès restreint (ACL/Jump) |
| Transit PtP | /31 | /127 | Évite broadcast & ND superflus |
| Loopbacks | /32 | /128 | Adresses stables pour iBGP/OSPF |
Règle : /64 par lien L2 en IPv6, sans exception (SLAAC, ND, sécurité).
Table CIDR (taille & hôtes)
| Prefix | Adresses totales | Hôtes utilisables* |
|---|---|---|
| /24 | 256 | 254 |
| /23 | 512 | 510 |
| /22 | 1024 | 1022 |
| /21 | 2048 | 2046 |
| /20 | 4096 | 4094 |
| /30 | 4 | 2 |
| /31 | 2 | 2 (PtP) |
*Hôtes utilisables = 2^(32-prefix) − 2 sauf /31 (RFC 3021) et /32.
VLSM (ex. allocation)
Bloc: 10.20.0.0/20 → besoins: 900, 300, 120, 30
Tri: 900 (/22), 300 (/23), 120 (/25), 30 (/27)
Alloc:
10.20.0.0/22 (1022 hôtes)
10.20.4.0/23 (510)
10.20.6.0/25 (126)
10.20.6.128/27 (30)Toujours trier du plus grand au plus petit et conserver un alignement CIDR.
IPv6 — tailles usuelles
| Niveau | Préfixe | Nb de /64 |
|---|---|---|
| Organisation (RIR/LIR) | /32 | 2^32 /64 |
| Site | /48 | 65 536 |
| Client | /56 | 256 |
| Lien | /64 | 1 |
Compression IPv6 & calcul
- “::” qu’une seule fois, retirer zéros initiaux.
- Ex :
2001:0db8:0000:0001::/64 → 2001:db8:0:1::/64
# Python (ipaddress) — sous-réseaux
from ipaddress import IPv4Network, IPv6Network
list(IPv4Network('10.10.0.0/20').subnets(new_prefix=24))[:3]
list(IPv6Network('2001:db8::/48').subnets(new_prefix=56))[:4]SLAAC, RA & flags
- RA porte les préfixes (L=On-link, A=Autonomous).
- Flags M (Managed) & O (Other): M=DHCPv6 address, O=DHCPv6 options.
- Privacy (RFC 4941) & Stable (RFC 7217) — éviter EUI-64.
# FRR (extrait RA)
interface vlan10
ipv6 nd prefix 2001:db8:10:100::/64
ipv6 nd other-config-flag
!
dhcpv6-server ... # options DNS (si besoin)ULA / GUA / Link-local
| Plage | Usage | Note |
|---|---|---|
| fc00::/7 (ULA) | Interne | Pas routé Internet |
| 2000::/3 (GUA) | Public | Routable |
| fe80::/10 | Link-local | ND/RA, non routé |
NPTv6 (stateless) seulement si renumérotation impossible.
Prefix Delegation (PD)
- ISP délègue /56 (souvent) → CPE distribue /64 aux LANs.
- Renouvellement PD ⇒ reconfig automatique (RDNSS/DHCPv6).
# dhcp6c (ex.) — demander /56
interface wan { send ia-pd 0; }
id-assoc pd 0 { prefix-interface lan0 { sla-id 0; sla-len 8; }; }Multihoming IPv6
- Deux GUA → source address selection (RFC 6724), PBR par source.
- Annonce BGP propre AS + /48 si PI (selon politique).
# Policy routing par source (Linux)
ip -6 rule add from 2001:db8:aa::/48 table ISP_A
ip -6 route add default via fe80::1 dev wanA table ISP_ALoopbacks & IGP/BGP
- Loopback /32 (IPv4) & /128 (IPv6) pour iBGP/OSPF/IS-IS.
- Schéma :
10.255.site.node/32;2001:db8:lo:site::node/128.
# FRR: iBGP via loopback
router bgp 65010
neighbor 10.255.0.2 remote-as 65010
neighbor 10.255.0.2 update-source loVRF/tenantisation
- RFC1918 distincts par VRF ; éviter overlaps DSCP/NAT inter-VRF.
- IPv6: préférer /56 par VRF client (facilite filtrage).
# Linux VRF
ip link add vrfA type vrf table 100
ip link set eth10 master vrfAPlages spéciales (extraits)
| Plage | Usage |
|---|---|
| 10/8, 172.16/12, 192.168/16 | RFC1918 |
| 100.64/10 | CGNAT |
| 169.254/16 | Link-local |
| 127/8 | Loopback |
| 192.0.2/24, 198.51.100/24, 203.0.113/24 | Documentation |
| 224/4 | Multicast |
| 198.18/15 | Bench/Interconnect |
/31 & /127 (PtP)
- IPv4 /31 : 2 adresses utilisables (pas de broadcast).
- IPv6 /127 pour éviter ND discovery sur /64 PtP.
# Cisco (PtP)
interface Gi0/0
ip address 10.10.13.0 255.255.255.254
ipv6 address 2001:db8:links::1/127Reverse DNS
- IPv4: zones
in-addr.arpa/24 (ou délégation < /24 par RFC 2317). - IPv6:
ip6.arpa— nibble par nibble (long) ; automatiser.
# RFC 2317 (IPv4 < /24) — BIND (ex. 203.0.113.64/27)
64-27.113.0.203.in-addr.arpa. NS ns1.example.
ptr 70 IN CNAME 70.64-27.113.0.203.in-addr.arpa.Naming
- Convention:
role-site-zone-idx(ex. sw-par1-mgmt-01). - PTR ↔ A/AAAA cohérents ; automation via IPAM.
NAT44/NPTv6/NAT64
- NAT44 : source/port translation ; PAT sortant.
- NPTv6 : translation stateless de préfixe (préserve ports).
- NAT64/DNS64 : clients v6 → serveurs v4 (préfixe
64:ff9b::/96).
# Tayga (NAT64) — exemple
prefix 64:ff9b::/96
tun-device nat64Summarization & agrégats
# FRR — agrégation IPv6
router bgp 65010
address-family ipv6 unicast
aggregate-address 2001:db8:10::/44 summary-only
# BIRD (extrait)
protocol bgp ISP { ipv6 { import filter agg(); export where net ~ [ 2001:db8:10::/44{44,56} ]; } }Réduire la table, éviter plus de 4 agrégats par site si possible.
# Calculs rapides
ipcalc 10.10.0.0/22
sipcalc 2001:db8::/48
# Linux — états IP
ip -4 addr; ip -6 addr
ip -4 route; ip -6 route
# Python (ipaddress) — VLSM simple
from ipaddress import IPv4Network
pool = IPv4Network('10.20.0.0/20')
needs = [900,300,120,30]
pref = []
for n in sorted(needs, reverse=True):
p = 32
while (2**(32-p)) - 2 < n: p -= 1
pref.append(p)
alloc = []; cur = pool.network_address
for p in pref:
net = IPv4Network((int(cur), p))
alloc.append(net); cur = net.broadcast_address + 1
print(alloc)Playbook déploiement
- Réserver blocs (RIR/LIR/ISP ou RFC1918/ULA).
- Designer par rôles (Users/Servers/Mgmt/Transit/Loops).
- Vérifier collisions (IPAM), générer VLAN/VRF.
- Provision DHCP/DHCPv6, RA flags M/O, RDNSS, DNS zones.
- Tests : ping, tracepath, SLAAC/DHCPv6, reverse DNS.
Checklist qualité
| Point | OK | Notes |
|---|---|---|
| Pas d’overlap (v4/v6, VRF) | [ ] | |
| /64 sur tous liens L2 | [ ] | |
| Loopbacks /32 & /128 | [ ] | |
| Reverse DNS cohérent | [ ] | |
| MSS/PMTUD validés | [ ] |
Exemple site (synthèse)
Site Lyon (ID 12)
VLAN 120 Users 10.12.0.0/22 2001:db8:12:120::/56
VLAN 121 Servers 10.12.4.0/23 2001:db8:12:121::/56
VLAN 199 Mgmt 10.12.7.0/24 2001:db8:12:199::/64
PtP CE-PE 10.12.8.0/31 2001:db8:12:links::/127
Loopback CE 10.255.12.1/32 2001:db8:lo:12::1/128NAT & PAT — SNAT/DNAT, Hairpin, ALG, NPTv6 (Linux & IOS)
- SNAT : translation source (sortie Internet, masquerade).
- DNAT : translation destination (exposer service interne).
- PAT / Overload : multiples IP internes vers une seule IP publique, différenciées par ports.
- Static NAT 1:1 : mapping fixe, utile pour serveurs exposés.
- Hairpin NAT : clients internes accédant via IP publique → nécessite règle spécifique.
- ALG : application-level gateways (FTP, SIP, H.323) → source d’instabilité, privilégier modes passifs / SBC.
- IPv6 : NAT non requis (adressage global), seul NPTv6 (prefix translation) possible en dernier recours.
# nftables : SNAT (Masquerade) + DNAT
nft add table ip nat
nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; }
nft add rule ip nat postrouting oifname "eth0" masquerade
nft add chain ip nat prerouting { type nat hook prerouting priority -100 \; }
nft add rule ip nat prerouting iifname "eth0" tcp dport 80 dnat to 10.0.1.10
# iptables (legacy)
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 10.0.1.20:443
# Hairpin NAT
iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -d 10.0.1.10 -j MASQUERADE
interface G0/0
ip nat outside
interface G0/1
ip nat inside
# PAT (overload)
access-list 10 permit 10.0.1.0 0.0.0.255
ip nat inside source list 10 interface G0/0 overload
# Static NAT
ip nat inside source static tcp 10.0.1.10 80 203.0.113.2 80
# Cisco ASA (object NAT)
object network WEB
host 10.0.1.10
nat (inside,outside) static 203.0.113.2 service tcp 80 80
- MSS Clamping sur VPN/PPPoE : ajuster taille MTU (ex. iptables --clamp-mss-to-pmtu).
- Asymétrie de routage : retour non traduit → sessions rompues.
- Double NAT (ISP box + FW interne) → complexité debug, préférer bridge/DMZ.
- Conntrack full : tables saturées → drop massif.
- NAT Traversal : IPSec, GRE, SIP nécessitent config spécifique (UDP encapsulation, ALG off).
# Linux
conntrack -L | head -20
nft list ruleset | grep masquerade -n
tcpdump -ni eth0 host 203.0.113.2 and tcp port 80
# Debug iptables counters
iptables -t nat -L -v -n
# Cisco IOS
show ip nat translations
show ip nat statistics
debug ip nat
# Cisco ASA
show xlate
packet-tracer input inside tcp 10.0.1.50 12345 203.0.113.2 80
Routage statique & Policy-Based Routing — ECMP, tables, marquage (hyper-densifié)
Statique vs PBR
- Statique : LPM dans FIB. Floating static via distance/metric ↑ pour backup.
- PBR : sélection d’une table ou d’un next-hop en fonction de source, port, protocole, mark… (pré-routing); puis LPM dans la table choisie.
- Null0/blackhole : agrégations & RTBH (remédiation DDoS).
- Retour : assurer symétrie (ou SNAT) sinon FW stateful casse.
Flux décision (Linux)
PREROUTING: nft (marque) → ip rule (table) → LPM (ip route) → xfrm/NAT → OUTPUTDesign & distances
| But | Mécanisme | Ex. |
|---|---|---|
| Backup | Floating static | IOS: distance 200 · Junos: preference 200 · FRR: distance 250 |
| Éviter loops | Null0 / blackhole | Résumé + spécifiques dynamiques |
| Séparer flux | PBR par source/dscp | Table 100 (ISP-A) / Table 200 (ISP-B) |
# --- Tables & règles ---
echo "100 ispA" >> /etc/iproute2/rt_tables
echo "200 ispB" >> /etc/iproute2/rt_tables
ip rule add pref 1000 from 10.0.2.0/24 table ispB
ip rule add pref 1010 fwmark 0x1/0xff table ispB
ip rule add pref 1020 from all table ispA # défaut
# --- Routage statique & ECMP (Linux) ---
ip route replace default scope global \
nexthop via 203.0.113.1 dev wanA weight 1 \
nexthop via 198.51.100.1 dev wanB weight 1 # ECMP
# Table ISP-B dédiée
ip route add default via 198.51.100.1 dev wanB table ispB
ip route add 10.50.0.0/16 via 10.0.1.254 # spécifique on-top
# --- Marquage (nftables) PBR par source/port/DSCP ---
nft add table inet mangle
nft 'add chain inet mangle prerouting { type filter hook prerouting priority -150 ; }'
nft 'add rule inet mangle prerouting ip saddr 10.0.2.0/24 meta mark set 0x1 comment "Users→ISP-B"'
nft 'add rule inet mangle prerouting tcp dport {443,8443} ip dscp cs3 meta mark set 0x3'
# --- Conntrack marks (persister la décision retour) ---
nft 'add rule inet mangle prerouting meta mark set ct mark'
nft 'add rule inet mangle postrouting ct mark set meta mark'
# --- Kernel tuning utile ---
sysctl -w net.ipv4.fib_multipath_hash_policy=1 # 0=L3, 1=L3+L4
sysctl -w net.ipv4.conf.all.rp_filter=2 # loose (multi-WAN)
sysctl -w net.ipv4.ip_forward=1
# --- FRR : statique + ECMP pondéré (nexthop-group) ---
conf t
nexthop-group ECMP-A
nexthop 203.0.113.1 weight 1
nexthop 198.51.100.1 weight 2
!
ip route 0.0.0.0/0 nexthop-group ECMP-A
ip route 10.50.0.0/16 10.0.1.254
! distance 250 0.0.0.0/0 192.0.2.1 # floating backup
endCisco IOS-XE — PBR + IP SLA/track
ip access-list extended ACL-SRC
permit ip 10.0.2.0 0.0.0.255 any
route-map RM-PBR permit 10
match ip address ACL-SRC
set ip next-hop 198.51.100.1
interface GigabitEthernet0/1
ip policy route-map RM-PBR
! Default + backup (floating)
ip route 0.0.0.0 0.0.0.0 203.0.113.1 1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 200
! Health-check (IP SLA + track)
ip sla 1
icmp-echo 8.8.8.8 source-interface GigabitEthernet0/1
frequency 5
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 reachability
ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 1JunOS — FBF (filter-based forwarding) & VRF
set routing-instances FBF1 instance-type forwarding
set routing-options rib inet.0 static route 0.0.0.0/0 next-hop 203.0.113.1
set routing-instances FBF1 routing-options static route 0.0.0.0/0 next-hop 198.51.100.1
set firewall family inet filter PBR term SRC-Users from source-address 10.0.2.0/24
set firewall family inet filter PBR term SRC-Users then routing-instance FBF1
set interfaces ge-0/0/1 unit 0 family inet filter input PBR
! ECMP & hashing
set routing-options forwarding-table export ECMP-HASH
set policy-options policy-statement ECMP-HASH then load-balance per-packet disableTables & politiques
| Plateforme | Hash par défaut | Réglage clé |
|---|---|---|
| Linux | L3 (ou L3+L4) | net.ipv4.fib_multipath_hash_policy=1 |
| IOS-XE (CEF) | 5-tuple | ip cef load-sharing algorithm |
| JunOS | per-flow | enhanced-hash-key, per-packet off |
Éviter per-packet hors DC faible latence (réordonancement possible).
# Linux ECMP pondéré (ex.)
ip route replace 0.0.0.0/0 \
nexthop via 203.0.113.1 weight 1 \
nexthop via 198.51.100.1 weight 3
# Vérifier le next-hop choisi
ip route get 1.1.1.1
ip route get to 1.1.1.1 sport 5555 dport 443 protocol tcpSuivi next-hop
- IP SLA / RPM (Cisco/JunOS) : supprime route si échec.
- Scripts Linux (systemd timers) : replace route / bascule table.
- BFD : souvent pour dynamiques ; certains NOS supportent pour statiques.
# Linux (systemd-run ping monitor simplifié)
while true; do ping -c1 -W1 203.0.113.1 || ip route change default via 198.51.100.1; sleep 2; doneAsymétrie & retour
- Two-WAN : forcer retour via même ISP (PBR retour, SNAT par WAN, connmark).
- rp_filter=2 (loose) en multi-WAN ; strict casse les retours valides.
VRF & tables Linux
# VRF Linux
ip link add vrf-ISP_A type vrf table 100
ip link set wanA master vrf-ISP_A
# Routes dédiées par VRF/table
ip -4 route add default via 203.0.113.1 table 100Séparer DNS, NTP, mgmt par VRF évite fuites de routes.
Symétrie via CONNMARK
# Associer WAN de sortie à la session
nft add chain inet mangle postrouting { type route hook postrouting priority -150\; }
nft 'add rule inet mangle postrouting oifname "wanA" ct mark set 0xA'
nft 'add rule inet mangle postrouting oifname "wanB" ct mark set 0xB'
# Retour : choisir table selon ct mark
ip rule add fwmark 0xA/0xFF table ispA
ip rule add fwmark 0xB/0xFF table ispBDSCP → table
# Router le trafic "Business" (CS3) via ISP-B
nft 'add rule inet mangle prerouting ip dscp cs3 meta mark set 0x30'
ip rule add fwmark 0x30/0xF0 table ispBOn peut combiner source + DSCP pour granularité fine.
Shaping & cohérence
# S'assurer que l'upload WAN suit la politique
tc qdisc replace dev wanB root fq_codel
tc filter add dev wanB protocol ip parent 1: prio 1 handle 0x30 fw flowid 1:10Linux
ip rule show; ip route show table all
ip route get 8.8.8.8 from 10.0.2.10 oif lan0
nft list ruleset | sed -n '1,120p'
nft monitor trace # trace décision dataplaneCisco
show ip policy interface G0/1
show route-map RM-PBR
show ip cef exact-route 10.0.2.10 1.1.1.1
show track 1; show ip sla statisticsJunOS
show route forwarding-table detail
show firewall filter PBR
show interfaces ge-0/0/1 extensive | match Filter- Asymétrie : casse FW stateful → SNAT par WAN ou connmark-based return.
- Per-packet LB : réordonnancement TCP → préférez per-flow.
- rp_filter strict en multi-WAN : bloquera des retours légitimes.
- Recursive next-hop : éviter boucles (vérifier résolution via route de connectivité).
- CoPP : protéger control-plane si IP SLA/RPM agressifs.
Lab 1 — Multi-WAN + PBR
But: Users(10.0.2.0/24) → ISP-B ; reste → ISP-A ; backup auto.
# Linux
ip rule add from 10.0.2.0/24 table ispB
ip route add default via 198.51.100.1 table ispB
ip route replace default \
nexthop via 203.0.113.1 weight 1 \
nexthop via 198.51.100.1 weight 1Tester
ip route get pour différents sport/dport et vérifier ECMP.Lab 2 — Résumé + Null0
But: Annoncer 10.20.0.0/20 avec spécifiques /24 internes.
IOS:
ip route 10.20.0.0 255.255.240.0 Null0
ip route 10.20.1.0 255.255.255.0 10.0.1.2
ip route 10.20.2.0 255.255.255.0 10.0.1.3Évite trous noirs si spécifiques présents, sinon Null0 “absorbe”.
OSPF — LSA, Areas, Design (Stub/NSSA), OSPFv3 & TS
Fondamentaux
- SPF (Dijkstra) : calcule le plus court chemin (O(n log n)).
- Timers : Hello=10s, Dead=40s (LAN) · Hello=30s, Dead=120s (WAN NBMA).
- DR/BDR : élections sur multi-accès (LAN). DR réduit nb d’adjacences.
- Adjacences : FULL seulement avec DR/BDR sur Ethernet, point-to-point = FULL direct.
Types de LSA
| Type | Nom | Scope | Usage |
|---|---|---|---|
| 1 | Router-LSA | Area | Liens et états d’un routeur |
| 2 | Network-LSA | Area | DR décrit réseau multi-accès |
| 3 | Summary-LSA | Inter-area | ABR → autres areas |
| 4 | ASBR-Summary | Inter-area | Annonce d’ASBR |
| 5 | External-LSA | AS | Routes externes (redistribution) |
| 7 | NSSA-LSA | NSSA | Externe dans NSSA (translaté en 5 par ABR) |
Diagramme DR/BDR
[R1]----+
|----(DR:R2)----[LAN]----(BDR:R3)
[R4]----+
Principes de design
- Area 0 = backbone, doit être contigu.
- Stub Area : pas de routes externes (LSA 5), remplacés par défaut route.
- Totally Stubby (Cisco) : pas de LSA 3/4/5, uniquement défaut.
- NSSA : accepte redistribution mais pas LSA 5 → converti en LSA 7.
- Summarisation :
- ABR :
area X range - ASBR :
summary-address
- ABR :
- Scaler : limiter 50 routeurs/area, 200 adjacences max.
Diagramme hiérarchie
[Area 1]---ABR---+
|---[Backbone Area 0]---ABR---[Area 2]
[Area NSSA]------+
# Cisco IOS - OSPFv2
router ospf 10
router-id 1.1.1.1
network 10.0.1.0 0.0.0.255 area 0
passive-interface default
no passive-interface G0/1
# OSPFv3 (IPv6)
router ospf 10
router-id 1.1.1.1
interface G0/1
ipv6 ospf 10 area 0
# FRR / Quagga
router ospf
ospf router-id 2.2.2.2
network 10.0.2.0/24 area 0
!
router ospf6
router-id 2.2.2.2
interface eth0 area 0.0.0.0
# JunOS
set protocols ospf area 0 interface ge-0/0/0
set protocols ospf area 1 stub
set protocols ospf3 area 0 interface ge-0/0/1
# Vérification voisins
show ip ospf neighbor
show ip ospf interface brief
show ip ospf database
# Vérif routes
show ip route ospf
vtysh -c "show ip ospf database router"
vtysh -c "show ip ospf border-routers"
# Cisco debug
debug ip ospf adj
debug ip ospf hello
# JunOS
show ospf neighbor
show ospf database
BGP — Best-path, Policy (RM/COMM), Sécurité (RPKI/GTSM), TS
Fondamentaux
- eBGP (inter-AS) vs iBGP (intra-AS). Full-mesh iBGP requis sauf si RR/Confed.
- Internet global DFZ (2025) : ~950k routes IPv4, ~200k IPv6.
- Convergence BGP : lente (secondes à minutes), dépend timers + RR design.
- Timers défaut : Keepalive 60s, Holdtime 180s. Souvent 30/90s en prod.
- BGP Multipath : plusieurs next-hops actifs (load-sharing).
Comparatif iBGP vs eBGP
| Aspect | iBGP | eBGP |
|---|---|---|
| AS-Path | Pas modifié | AS ajouté |
| TTL | 255 (loopback peering) | 1 (direct link) |
| Full Mesh | Requis sans RR/Confed | Pas nécessaire |
| Next-hop | Préservé | Réécrit |
| Usage | Distribution interne | Peering opérateurs |
Critères Best-path (ordre)
| # | Attribut | Description |
|---|---|---|
| 1 | Weight | Cisco local-only, plus haut préféré |
| 2 | Local Preference | Propagé dans AS, plus haut préféré |
| 3 | AS-Path Length | Plus court préféré |
| 4 | Origin | IGP < EGP < Incomplete |
| 5 | MED | Plus petit préféré |
| 6 | eBGP vs iBGP | eBGP préféré |
| 7 | IGP Metric | Plus court chemin interne |
| 8+ | Tiebreak | Router-ID, Cluster-ID |
Diagrammes
# iBGP Full Mesh
R1----R2
\ /
\ /
R3
# Route Reflector
[RR]
/ \
R1 R2
# Confederation
AS65001.1 --- AS65001.2 --- AS65001.3
\ /
\-----/
Outils de Policy
- Prefix-list : filtrage des annonces.
- Route-map : match (prefix, as-path, comm) + actions (set).
- Communautés :
- Well-known :
no-export,no-advertise,local-AS. - Standard (32 bits) : ex
65001:100. - Extended (64 bits)
- Large Communities (96 bits)
- Well-known :
- AS-Path prepend : influencer choix externe.
# Exemple Cisco IOS
ip prefix-list PL-OUT seq 10 permit 203.0.113.0/24
route-map RM-OUT permit 10
match ip address prefix-list PL-OUT
set community 65001:100 additive
set as-path prepend 65001 65001 65001
router bgp 65001
neighbor 198.51.100.2 remote-as 65002
address-family ipv4
neighbor 198.51.100.2 route-map RM-OUT out
Mécanismes de Sécurité
- GTSM : TTL Security (protection spoof eBGP).
- MD5 / TCP-AO : authentification sessions.
- RPKI : validation ROA (route origin auth).
- Max-prefix : limiter nb routes reçues (éviter overload → BGP storm).
- Dampening : réduire impact flaps (pénalités → rétention).
- Route Leak Protection : communities, filtering strict.
# GTSM
neighbor 192.0.2.2 ttl-security hops 2
# Authentification
neighbor 192.0.2.2 password mySecretMD5
# RPKI (IOS-XR exemple)
router bgp 65001
bgp rpki server tcp 203.0.113.50 3323
validate rpki
# Max-prefix
neighbor 198.51.100.2 maximum-prefix 100000 80 restart 5
# Dampening
bgp dampening 15 750 2000 60
# Cisco IOS-XE
router bgp 65010
bgp log-neighbor-changes
neighbor 192.0.2.2 remote-as 65020
address-family ipv4 unicast
network 203.0.113.0 mask 255.255.255.0
maximum-paths 2
# FRR (frr.conf)
router bgp 65010
bgp router-id 1.1.1.1
neighbor 192.0.2.2 remote-as 65020
!
address-family ipv4 unicast
network 203.0.113.0/24
maximum-paths 2
exit-address-family
# JunOS
set protocols bgp group EBGP type external
set protocols bgp group EBGP peer-as 65020
set protocols bgp group EBGP neighbor 192.0.2.2
set policy-options policy-statement EXPORT term 1 from route-filter 203.0.113.0/24 exact
set policy-options policy-statement EXPORT term 1 then accept
set protocols bgp group EBGP export EXPORT
Commandes & Debug
# Cisco IOS
show ip bgp summary
show ip bgp 203.0.113.0
show ip bgp neighbors 198.51.100.2 routes
clear ip bgp * soft in|out
# IOS-XR
show bgp ipv4 unicast summary
show bgp ipv4 unicast neighbors 198.51.100.2 received-routes
# FRR / vtysh
show bgp summary
show bgp ipv4 unicast 203.0.113.0/24
clear bgp ipv4 * soft
# JunOS
show bgp summary
show route receive-protocol bgp 192.0.2.2
show route advertising-protocol bgp 192.0.2.2
Méthodologie TS
- 1️⃣ Vérifier session (ESTABLISHED ? → BGP FSM 6).
- 2️⃣ Vérifier annonces envoyées/reçues (prefix-list, RM appliqués ?).
- 3️⃣ Vérifier attributs (AS-path, LP, MED).
- 4️⃣ Vérifier RPKI/max-prefix drops.
- 5️⃣ Déboguer propagation via RR/Confed.
IS-IS — L1/L2, TLV, wide metrics, SR-MPLS (aperçu)
Niveaux & portée
- L1 : intra-area (domaines locaux).
- L2 : backbone inter-areas.
- L1-L2 : routeurs frontière (faisceaux L1↔L2).
Recommandation : cœur L2, bords L1.
Adjacences
- IIH (Hello) → découverte voisins.
- DIS (LAN) : élu via priorité → envoie CSNP.
- Sur p2p : pas de DIS (FULL direct).
Hello typiques : 10 s (LAN) · Hold ~30 s.
Base & calcul
- LSDB (LSPs) synchronisée par zone.
- SPF (Dijkstra) par niveau (L1 et L2).
- Adresses CLNS, identifiant NET :
49.AAAA.BBBB.CCCC.CCCC.00.
# Diagramme niveaux
[L1 Domain A] --(ABR L1/L2)-- [Backbone L2] --(ABR)-- [L1 Domain B]
PDUs principaux
| PDU | Rôle | Notes |
|---|---|---|
| IIH (Hello) | Découverte/maintien voisins | Contient priorité DIS, MT-IDs, authent. |
| LSP | Annonce de liens/préfixes | Fragmentable, TTL, aging. |
| CSNP | Résumé LSDB (LAN) | Envoyé périodiquement par DIS. |
| PSNP | Demande/ACK LSP | Point-à-point et LAN (MAJ fine). |
TLV usuels (vue opérateur)
| Catégorie | Contenu | Usage |
|---|---|---|
| IS/IP Reach. | Voisins + métriques | Narrow/wide metrics, sub-TLVs (TE/SR). |
| IPv4/IPv6 Reach. | Préfixes & attributes | Multi-Topology, tags, route-leak. |
| Router Capabilities | Flags & capacités | Annonce SR, MSD (Max SID Depth), etc. |
| Authentication | Clé (HMAC-MD5/clear) | Sécurise IIH/LSP/CSNP/PSNP. |
# Diagramme synchronisation LSDB (LAN)
[R1] --\
[R2] --- (DIS) ==CSNP==> Tous
[R3] --/ <==PSNP/LSP== échanges ciblés
Métriques
- Narrow : granularité historique (0–63) → à éviter en DC/Backbone.
- Wide : 24 bits (jusqu’à ~16M) → recommandé (lien 100G/400G).
- Coût par défaut souvent = 10 (vendors), ajuster selon capacité/latence.
- External/Inter-area : coûts additionnels possibles.
Règle simple : coût ≈ 10Gb:10 · 100Gb:1–5 · 400Gb:1
Multi-Topology (MT-IS-IS)
- Topologies séparées (IPv4/IPv6/Services).
- Migration IPv4→IPv6 sans impact (MT-IDs distincts).
- Possibilité de route leaking L1↔L2 contrôlé.
Alternative : Single-Topology (même LSDB), plus simple mais moins souple.
Bonnes pratiques de design
- Backbone L2 unifié, bords en L1 pour limiter SPF & LSDB.
- Activer wide-metrics-only; proscrire narrow dans nouveaux domaines.
- Sur LAN, fixer DIS-priority, hello/hold cohérents, p2p si possible (Ethernet p2p).
- Limiter taille area : ~100–150 routeurs par niveau (ordre de grandeur).
# Diagramme hiérarchie simple
Access (L1) --(ABR L1/L2)-- Aggregation/Core (L2)
SR-MPLS (aperçu intégration IS-IS)
- SRGB : bloc global de labels (ex. 16000–23999).
- Node-SID : identifie un nœud (préfixe loopback) → plus court chemin IGP.
- Adj-SID : lien spécifique (forwarding explicite).
- Prefix-SID : associé à un /32(/128) loopback.
- MSD (Max SID Depth) annoncé via capacités routeur.
# Chemin SR (ex.) : {16002, 24001, 16005}
Node-SID(2) -> Adj-SID(lien R2-R4) -> Node-SID(5)
# Cisco IOS-XE/IOS (exemple générique)
router isis DC
net 49.0001.0000.0000.0001.00
is-type level-2
metric-style wide
authentication mode md5
authentication key-chain ISIS-KEY
!
interface Ethernet1
ip router isis DC
isis network point-to-point
isis circuit-type level-2
isis hello-interval 10
isis priority 64 # si LAN multipoint, ajuster pour DIS
!
# SR (selon plate-forme)
segment-routing mpls
isis topology ipv4 unicast
prefix-sid index 101
# JunOS
set protocols isis level 2 wide-metrics-only
set protocols isis interface ge-0/0/0.0 point-to-point
set protocols isis interface ge-0/0/1.0
set protocols isis interface ge-0/0/1.0 hello-interval 10
set protocols isis interface ge-0/0/1.0 priority 80
set protocols isis authentication key-chain ISIS-KEY
set protocols isis source-address 10.0.0.1
# SR (aperçu)
set protocols isis segment-routing srgb start-label 16000 index-range 8000
set protocols isis segment-routing prefix-sid index 101
# FRR (isisd)
router isis DC
net 49.0001.0000.0000.0001.00
is-type level-2
metric-style wide
authentication mode md5
area-password 7
interface eth0
isis network point-to-point
isis hello 10
!
# IPv6 (single-topology)
address-family ipv6
topology ipv6-unicast
Méthodologie
- 1) Voisins : état (Up/Down), MT-IDs, niveaux.
- 2) LSDB : LSP manquants/expirés, checksum, aging.
- 3) SPF : recalculs fréquents ? (flaps liens).
- 4) Métriques : cohérence wide-metrics, coûts anormaux.
- 5) SR-MPLS : SRGB alignés, SIDs résolus, MSD.
Commandes utiles
# Cisco
show isis neighbors
show clns neighbors
show isis database
show isis topology
show isis segment-routing prefix-sid-map
# JunOS
show isis adjacency
show isis database detail
show route protocol isis
show isis segment-routing
# FRR
show isis neighbor
show isis database
show isis route
# Capture
tcpdump -i eth0 -vv isis
# Check-list rapide
[ ] Niveaux & types circuits corrects (L1/L2, p2p vs LAN)
[ ] metric-style wide partout (éviter mixed)
[ ] Auth cohérente (modes/clé) sur tous les PDUs
[ ] DIS stable sur LAN (priority / topologie p2p si possible)
[ ] SRGB/SID homogènes si SR activé
Multicast — IGMPv2/v3, PIM SM/SSM, RP, RPF, MSDP (hyper-densifié)
Rappels & Plages
| Famille | Plage | Notes |
|---|---|---|
| IPv4 | 224.0.0.0/4 | 224.0.0.0/24 link-local (non routé) |
| SSM (v4) | 232.0.0.0/8 | IGMPv3 include-only, pas de RP |
| GLOP | 233.0.0.0/8 | Hist. (AS-based) |
| IPv6 | ff00::/8 | Scopes: 1=interface, 2=link, 5=site, e=global |
| MLD SSM (v6) | ff3x::/96 | MLDv2 include-only |
Entrées MRIB: (* ,G) (RP-tree) et (S,G) (SPT).
Flux de base (ASCII)
Receiver --IGMP Join--> DR ---PIM Join(*,G)---> RP
Source S --Register--> RP --Join(S,G)--> vers S
└─ Receivers basculent SPT (RPT->SPT)- RPT (shared tree via RP) → SPT (source tree) si débit/latence justifient.
IGMP/MLD (timers clés)
| Paramètre | Défaut typ. | Notes |
|---|---|---|
| IGMP Query Interval | 125s | Garde les memberships |
| IGMP Robustness | 2 | Perte tolérée |
| IGMP LMQI | 10s | Group-specific query |
| MLD (v6) timers | similaires | MLDv1/v2 = IGMPv2/v3 |
- IGMPv3/MLDv2 = include/exclude lists (SSM = include-only).
- DR (Designated Router) par PIM-Hello (prio), IGMP Proxying possible sur CPE.
IGMP Snooping (L2)
- Activez snooping par VLAN + querier si aucun L3 IGMP querier.
- Port mrouter/uplink vers L3 pour éviter flooding.
- Filtres statiques pour groupes critiques (TV, finance).
# Cisco Catalyst (ex.)
ip igmp snooping vlan 100
ip igmp snooping vlan 100 mrouter interface Gi1/0/48
ip igmp snooping querier 10.10.100.1 vlan 100Modes PIM
| Mode | RP | Cas d’usage | Notes |
|---|---|---|---|
| PIM-SM | Oui | Multi-sources, scalable | RPT→SPT switch, Register/Join |
| PIM-SSM | Non | One-to-many contrôlé | IGMPv3 include (S,G), 232/8 |
| PIM-DM | Non | Petits réseaux | Flood & prune (rare en prod) |
| PIM-BIDIR | Oui (bidir) | Many-to-many | Pas de Register, DF election |
SSM si possible (moins de contrôle-plane, pas de RP, RPF simple).
Messages/timers PIM
- Hello (30s), Join/Prune (60s), Assert (LAN), Bootstrap (BSR), Register/Stop (SM).
- SPT-threshold (kbps) pour bascule RPT→SPT.
# Cisco
ip pim spt-threshold 64 kbps # bascule SPT si débit > 64kbpsRP provisioning
- Static RP : simple, peu scalable.
- Auto-RP (224.0.1.39/40) : legacy ; filtrer sur frontières.
- BSR : Bootstrap Router annonce mapping (PIMv2).
- Anycast-RP + MSDP : haute dispo multi-RP (partage (S,G) via SA).
- SSM mapping : définir SSM range (ex. 232/8) → plus de RP.
Exemples
# Cisco BSR
ip pim rp-candidate Loopback0 group-list 10
ip pim bsr-candidate Loopback0 0
access-list 10 permit 239.0.0.0 0.255.255.255
# Anycast-RP + MSDP
ip pim anycast-rp 198.51.100.10 203.0.113.10
ip msdp peer 203.0.113.10 connect-source Loopback0
!
# SSM range + mapping
ip pim ssm range 232.0.0.0/8
ip igmp ssm-map enable
ip igmp ssm-map static 232.1.1.1 192.0.2.10Reverse Path Forwarding
- Validation que l’interface d’entrée pointe vers la source (S) (ou RP pour * ,G).
- MRIB = table unicast (CEF/inet.0). RPF-fail → pas de forwarding.
# Vérification Cisco
show ip rpf 198.51.100.20
# Linux
ip mroute; ip route get 198.51.100.20LAN Assert & DR
- Assert : évite dupli-forward sur LAN (meilleur métrique).
- DR election : priorité PIM Hello (configurable).
# Cisco
interface Gi0/1
ip pim dr-priority 100ip multicast-routing
ip cef
!
ip pim rp-address 198.51.100.10
ip pim ssm range 232.0.0.0/8
!
interface Gi0/0
ip address 10.0.10.1 255.255.255.0
ip pim sparse-mode
ip igmp version 3
!
interface Gi0/1
ip address 10.0.20.1 255.255.255.0
ip pim sparse-mode
ip igmp version 3
!
ip pim spt-threshold 64 kbps
! Boundaries/TTL (ex.)
ip multicast ttl-threshold 16set routing-options multicast
set protocols pim rp static address 198.51.100.10
set protocols pim interface ge-0/0/0 mode sparse
set protocols pim interface ge-0/0/1 mode sparse
set protocols pim ssm range 232.0.0.0/8
set protocols igmp interface ge-0/0/1 version 3
# Anycast-RP + MSDP
set protocols pim anycast-rp 198.51.100.10 rp-set 203.0.113.10
set protocols msdp peer 203.0.113.10 local-address lo0.0FRR pimd (PIM-SM/SSM)
router pim
rp-address 198.51.100.10 239.0.0.0/8
ssm prefix 232.0.0.0/8
!
interface eth0
ip igmp version 3
ip pim sm
!
interface eth1
ip pim smLinux outils
# Tables multicast
ip mroute
bridge mdb show # snooping L2
# smcroute (routes statiques multicast)
smcroute -d
smcroute -j eth0 232.1.1.1 192.0.2.10 -k eth1 232.1.1.1Commandes clés
# Cisco
show ip mroute
show ip pim neighbor
show ip pim rp mapping
show ip igmp groups
debug ip pim; debug ip igmp
# JunOS
show multicast route
show pim join
show igmp group
# Linux
ip mroute; ip -s mroute
tcpdump -ni any '(pim or igmp or udp port 1900)'mtrace2 (source → receiver)
mtrace2 -s 192.0.2.10 -G 232.1.1.1 receiver.example.comValide RPF sur chaque saut et montre l’interface suivante prévue.
Signatures & causes
| Symptôme | Cause probable | Action |
|---|---|---|
| RPF-fail | MRIB pointe ailleurs | Fix route unicast / static mroutes |
| Flood L2 | Snooping off / pas de mrouter port | Activer snooping + mrouter |
| Pas de SPT | Seuil non atteint | Adapter spt-threshold / liens |
| Groupes fantômes | IGMP timers/sources muettes | Réduire LMQI / query |
Sécurité
- Filtrer Auto-RP (224.0.1.39/40) aux frontières (evite fuites).
- ip multicast boundary par ACL (groupes autorisés).
- CoPP/Policers pour PIM/IGMP/MLD.
- Limiter SSM aux préfixes autorisés.
# Cisco (boundary)
ip multicast boundary 101 filter-autorp
access-list 101 deny 224.0.1.39 0.0.0.0
access-list 101 deny 224.0.1.40 0.0.0.0
access-list 101 permit 239.0.0.0 15.255.255.255QoS & shaping
- Marquez vidéo (AF3x/AF4x), priorité modérée, policing sur uplinks.
- Sur WAN: shaping global & file distincte multicasts.
Playbook déploiement rapide
- Choisir SSM (232/8) si possible; sinon PIM-SM + RP (Anycast-RP si HA).
- Activer IGMPv3/MLDv2, snooping + querier VLANs.
- Valider MRIB (routes unicast stables), RPF OK.
- Configurer boundaries et CoPP.
- Tests end-to-end : mtrace2, perf vidéo/latence/jitter.
Checklist opérationnelle
| Point | OK | Notes |
|---|---|---|
| SSM range défini | [ ] | |
| RP HA (Anycast/MSDP ou BSR) | [ ] | |
| Snooping + mrouter ports | [ ] | |
| CoPP PIM/IGMP | [ ] | |
| SPT-threshold cohérent | [ ] |
QoS — Classification, marquage, policing/shaping, WRED
Cartographie DiffServ
| Classe | PHB | DSCP | 802.1p CoS | Usage typique |
|---|---|---|---|---|
| Voix | EF | 46 | 5 | VoIP/RTP |
| Vidéo Temps réel | AF41–43 | 34–38 | 4 | Visio |
| Business Critique | AF31–33 | 26–30 | 3 | Apps métier |
| Business Standard | AF21–23 | 18–22 | 2 | Apps bureautiques |
| Contrôle/Signal. | CS6 | 48 | 6 | Routage/Control-plane |
| Best Effort | BE | 0 | 0 | Par défaut |
| Scavenger | CS1/LE | 8 | 1 | Background/P2P |
MPLS EXP/TC mapping typique : EF→5, AF4x→4, AF3x→3, AF2x→2, BE→0.
Techniques & files
- Classification : ACL/L4, NBAR, VLAN CoS, DSCP.
- Marquage : DSCP/CoS (trust boundary aux bords).
- Queuing : CBWFQ, LLQ (priority strict), WFQ, DRR.
- Policing (jetons, drop/remark) vs Shaping (tamponnage).
- WRED/AQM : aléatoire prédictif + ECN, éviter tail-drop global.
- HQoS : parent (shape) → enfants (LLQ/CBWFQ).
Règle d’or : LLQ limité (1–10% WAN), jamais saturer la file priorité.
# Cisco MQC (LLQ + CBWFQ)
class-map match-any VOICE
match dscp ef
class-map VIDEO
match dscp af41 af42 af43
policy-map CHILD
class VOICE
priority percent 10 # LLQ, policer implicite
class VIDEO
bandwidth percent 20
class class-default
fair-queue
policy-map PARENT
class class-default
shape average 20000000 # 20 Mbps
service-policy CHILD
interface G0/0
service-policy output PARENT
Policing vs Shaping
| Aspect | Policing | Shaping |
|---|---|---|
| Excès | Drop/remark | File d’attente |
| Latence | Faible | ↑ (tampon) |
| Jitter | Faible | Moyen |
| Usage | Edge/peering, protection | Sortie WAN, lissage |
Seaux à jetons (TB)
| Paramètre | Formule | Exemple |
|---|---|---|
| CIR | Débit moyen | 10 Mb/s |
| Tc | Période | 10 ms |
| Bc | CIR × Tc | 10e6 × 0.01 = 100 kbits ≈ 12.5 kB |
| Be | Excédent optionnel | ~ Bc |
Choisir Tc 5–25 ms (WAN). Bc trop petit → bursty/drop.
Délai de sérialisation
| L (octets) | R (Mb/s) | t = L×8/R |
|---|---|---|
| 1500 | 10 | 1.2 ms |
| 1500 | 2 | 6 ms |
| 200 | 2 | 0.8 ms |
Utiliser fragmentation/LLQ (p.ex. cRTP, pMTU) pour la voix sur liens lents.
WRED / AQM (avec ECN)
| Paramètre | Rôle | Repères |
|---|---|---|
| min-th | Début de probabilité | 40–60% de la file |
| max-th | Drop à 100% | 80–90% de la file |
| mark-prob | Pente | 1/10–1/20 |
| ECN | Marque CE vs drop | Activer si bout-à-bout |
# Cisco : WRED DSCP-based + ECN
policy-map WAN
class class-default
random-detect dscp-based
random-detect exponential-weighting-constant 9
random-detect ecn
Trust boundary (Switch)
# Cisco Catalyst
mls qos
interface Gi1/0/10
mls qos trust dscp
mls qos map cos-dscp 0 8 16 24 32 46 48 56
Ne jamais « trust » les ports user sans contrôle (risque d’EF abusif).
# JunOS : classes, schedulers, rewrite
set class-of-service forwarding-classes queue 0 best-effort
set class-of-service forwarding-classes queue 1 voice
set class-of-service schedulers LLQ transmit-rate percent 10 priority high
set class-of-service schedulers AF transmit-rate percent 20
set class-of-service scheduler-maps OUT schedulers LLQ forwarding-class voice
set class-of-service interfaces ge-0/0/0 unit 0 scheduler-map OUT
set class-of-service classifiers dscp DSCP-IN forwarding-class voice loss-priority low code-points ef
set class-of-service rewrite-rules dscp DSCP-OUT forwarding-class voice code-point ef
# Linux tc : shaping + AQM moderne
# Parent : HTB shape 20 Mb/s, enfants : LLQ approximée + BE
tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 20mbit ceil 20mbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 2mbit ceil 2mbit prio 0 # "LLQ"
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 18mbit ceil 18mbit prio 3
tc qdisc add dev eth0 parent 1:10 handle 10: fq_codel
tc qdisc add dev eth0 parent 1:20 handle 20: fq_codel
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip dscp 46 0xfc flowid 1:10
# Policer simple :
tc qdisc add dev eth1 root tbf rate 10mbit burst 12kb latency 50ms
Diagrammes
# Hiérarchie HQoS (Parent shape -> Enfants par classe)
[PARENT: shape 20 Mb/s]
/ \
[LLQ:10% voix] [CBWFQ: reste]
| |
(EF) (AF/BE, WRED)
# Flux de décision (simplifié)
Ingress → Classifier → Mark (DSCP) → Queue Select → (Policer?) → Shaper → Scheduler → Egress
# Cisco observabilité
show policy-map interface
show queueing interface g0/0
show mls qos interface
show platform hardware qfp active statistics drop
# JunOS
show class-of-service interface ge-0/0/0
show interfaces queue ge-0/0/0
show class-of-service scheduler-errors
# Linux
tc -s qdisc show dev eth0
tc -s class show dev eth0
ethtool -S eth0 | egrep "tx_.*drop|rx_.*drop"
Bonnes pratiques rapides
- Limiter LLQ (1–10%) et activer le policer implicite si dispo.
- Shaper parent au débit pile WAN (éviter tail-drop chez l’opérateur).
- Activer WRED + ECN sur BE/AF, pas sur LLQ.
- Définir cartes de réécriture (rewrite DSCP/CoS) aux bords.
- Mesurer : one-way delay, jitter, gigue (SLA/IP-SLA/BFD).
Pièges fréquents
- Trust DSCP côté accès → abus EF.
- LLQ trop grand → famine des autres files.
- Policing sur VoIP → gigue/perte ; préférer shaping.
- Incohérence DSCP↔CoS↔EXP → classes « fantômes ».
- WRED mal réglé → drop prématuré / pas d’ECN.
L2 & STP — VLAN, RSTP/MSTP, EtherChannel/LACP, protections
STP
RSTP (802.1w), MSTP (802.1s) · root guard, bpdu guard, loop guard
- PVST+/Rapid-PVST (par VLAN), RSTP global, MSTP (instances M-x).
- Rôles : Root/Designated/Alternate/Backup · États : Discarding/Learning/Forwarding.
- Timers (base 802.1D) : Hello 2s · MaxAge 20s · FwdDelay 15s (RSTP converge <1–3s).
Trunks
802.1Q · native VLAN · pruning
- Tag 802.1Q (12 bits VLAN, 3 bits PCP CoS) · VLAN natif non taggé.
- Pruning : limiter VLAN transportés · éviter native mismatch.
- VTP : préférer transparent (maîtrise locale des VLAN).
spanning-tree mode rapid-pvst
spanning-tree portfast default
spanning-tree bpduguard default
!
interface Po1
description Uplink-DC
channel-group 1 mode active ! LACP
switchport
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30
spanning-tree guard root ! Root Guard côté accès
États/Rôles RSTP
| Rôle | État | Note |
|---|---|---|
| Root | FWD | Port vers le Root Bridge |
| Designated | FWD | Port désigné sur segment |
| Alternate | DISC | Backup vers root (blocage RSTP) |
| Backup | DISC | Backup même segment (rare) |
| Edge (PortFast) | FWD immédiat | Jamais trunk/serveur L2 |
MSTP — Instances
| Paramètre | Exemple | But |
|---|---|---|
| Region-name | DC-PARIS | Doit matcher partout |
| Revision | 10 | Version de mapping |
| Mapping | MST1: VLAN 10-19 · MST2: 20-29 | Load-balancing L2 |
Mismatch (name/rev/mapping) = boundary → CST.
LACP/EtherChannel
| Point | Valeur | Note |
|---|---|---|
| Modes | active/passive (LACP), on (statique) | Préférer LACP |
| LACP rate | fast=1s · normal=30s | Détection rapide |
| Hash | src/dst MAC/IP/L4 | Équilibrage flux |
| min-links | p.ex. 2 | Down sous seuil |
# Arbre STP (racine en haut)
[Root Bridge]
/ \
FWD FWD
[SW-A]--------ALT/Disc------[SW-B]
\ /
\------FWD-------------/
# EtherChannel (Po1) entre SW-A et SW-B
host ---[Access VLAN 10]--- SW-A ==Po1(LACP)== SW-B --- Trunk vers Core
Protections L2
- BPDU Guard sur ports edge (désactive si BPDU reçu).
- Root Guard sur downlinks (empêche nouveau root).
- Loop Guard sur liens bloqués (évite unidirectionnels).
- UDLD (unidirectional link) : aggressive sur fibre.
- Storm-control : p.ex. broadcast/multicast 1–2%.
Sécurité de plan de données
- DHCP Snooping (définir trusted sur uplinks).
- DAI (ARP Inspection) ↔ DHCP Snooping bindings.
- IP Source Guard : liaison IP/MAC/port.
- Port-Security : max-mac 2–4, sticky, violation shut.
VLAN/Trunking
- Native VLAN dédié (ex. 99), jamais en prod.
- Limiter allowed-vlans· pas de VLAN orphelins.
- Désactiver DTP :
switchport nonegotiate.
# Cisco IOS/NX-OS : RPVST, protections, LACP
spanning-tree mode rapid-pvst
spanning-tree extend system-id
spanning-tree portfast default
spanning-tree bpduguard default
spanning-tree loopguard default
!
interface range Gi1/0/1-24
switchport mode access
spanning-tree portfast
spanning-tree bpduguard enable
storm-control broadcast level 1.00
!
interface po1
description Uplink-MLAG
switchport mode trunk
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30
lacp rate fast
spanning-tree guard root
# MSTP (Cisco)
spanning-tree mode mst
spanning-tree mst configuration
name DC-PARIS
revision 10
instance 1 vlan 10-19
instance 2 vlan 20-29
exit
spanning-tree mst 1 priority 24576 ! root primaire i1
spanning-tree mst 2 priority 4096 ! root primaire i2
# JunOS (EX/QFX) : RSTP/MSTP + LACP
set protocols rstp interface ge-0/0/1 edge
set protocols mstp configuration name DC-PARIS
set protocols mstp configuration revision-level 10
set protocols mstp configuration mstp-instance 1 vlan [10-19]
set protocols mstp interface ae0 mode mstp
set ethernet-switching-options storm-control interface ge-0/0/1 bandwidth 1
set ethernet-switching-options secure-access-port interface ge-0/0/1 sticky
set interfaces ae0 aggregated-ether-options lacp active
# Linux (bridge, vlan, LACP via bonding)
ip link add br0 type bridge vlan_filtering 1
ip link set eth1 master br0
bridge vlan add dev eth1 vid 10 pvid untagged
# LACP (bond)
modprobe bonding
ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate 1
ip link set eth2 master bond0
ip link set eth3 master bond0
ip link set bond0 up
# Arista EOS (MLAG rapide)
spanning-tree mode rapid-pvst
interface Port-Channel10
switchport trunk allowed vlan 10,20,30
lacp rate fast
!
mlag configuration
domain-id DC-MLAG
local-interface Vlan4094
peer-address 10.0.0.2
peer-link Port-Channel100
# TS / Observabilité
show spanning-tree vlan 10
show spanning-tree detail | inc ieee|from
show interfaces status err-disabled
show etherchannel summary
show lacp neighbor
show mac address-table vlan 10
# Linux
bridge link; bridge vlan show
tcpdump -i eth0 -vv stp
# Checklist déploiement L2
[ ] Root primaire/secondaire définis (priorités STP)
[ ] PortFast + BPDU Guard sur ports edge
[ ] Loop Guard/UDLD sur liens fibre & trunks
[ ] Native VLAN unique & cohérent (pas utilisé)
[ ] Allowed VLANs minimaux sur trunks
[ ] Storm-control sur accès (1–2% b/m)
[ ] LACP "active" + min-links + hash cohérent
[ ] MST region (name/rev/mapping) identique
Haute Dispo — VRRP/HSRP/GLBP : IP flottantes, preempt, tracking
Principes
- IP flottante (gateway virtuelle) répond via Gratuitous ARP/ND.
- État : Active/Master <=> Standby/Backup.
- Preempt : reprise du rôle actif par le plus prioritaire (avec délai).
- Load-bal. : GLBP distribue la GW via ARP (AVG/AVF).
Chiffres (défauts usuels)
| Proto | Hello/Adv | Hold/Dead | Failover≈ |
|---|---|---|---|
| HSRPv1/v2 | 3 s | 10 s | ~10 s (≈Hold) |
| VRRPv2/v3 | 1 s | 3 × Adv | ~3 s |
| GLBP | 3 s | 10 s | ~10 s |
Avec BFD : sous-seconde (p.ex. 50–300 ms).
Comparatif rapide
| Aspect | VRRP | HSRP | GLBP |
|---|---|---|---|
| Standard | Ouvert (multi-vendor) | Cisco | Cisco |
| LB par défaut | Non | Non | Oui (ARP) |
| Preempt défaut | Oui | Non (cmd preempt) | Non (poids) |
| IPv6 natif | v3 | HSRP for IPv6 | Oui (selon plate-formes) |
# Diagramme (VLAN10)
Hosts
| GW=10.10.10.1
+---+-------------------+
| L2/L3 Switch |
+-----------+-----------+
|
+-----+-----+ +-----+-----+
| R1 (Active) | | R2 (Standby) |
| VIP 10.10.10.1 | VIP 10.10.10.1
+-----------+--+ +--+----------+
| Heartbeats (multicast)
Cisco HSRP (MQC-like)
interface Vlan10
ip address 10.10.10.2 255.255.255.0
standby 10 ip 10.10.10.1
standby 10 priority 120
standby 10 preempt delay minimum 5
standby 10 authentication md5 key-chain HSRP-KEY
standby 10 track GigabitEthernet0/0 20
! second routeur : priority 100
VRRP (Cisco/JunOS-like)
interface Vlan10
ip address 10.10.10.3 255.255.255.0
vrrp 10 ip 10.10.10.1
vrrp 10 priority 110
vrrp 10 timers advertise 1
vrrp 10 preempt delay minimum 5
! JunOS (ex.)
set interfaces vlan.10 family inet address 10.10.10.3/24 vrrp-group 10 virtual-address 10.10.10.1
set interfaces vlan.10 family inet vrrp-group 10 priority 110
set interfaces vlan.10 family inet vrrp-group 10 preempt
GLBP (LB ARP)
interface Vlan10
ip address 10.10.10.2 255.255.255.0
glbp 10 ip 10.10.10.1
glbp 10 load-balancing host-dependent
glbp 10 priority 120
glbp 10 preempt delay minimum 5
glbp 10 weighting 110 lower 95 upper 105
! Rôles : AVG (répond ARP), AVF (porte l'IP virtuelle)
Linux (keepalived / VRRPv3 IPv4/IPv6)
# /etc/keepalived/keepalived.conf
vrrp_script chk_gw {
script "/usr/bin/ping -c1 -W1 203.0.113.1 >/dev/null"
interval 2
fall 2
rise 2
}
vrrp_instance VI_10 {
state MASTER
interface eth0
virtual_router_id 10
priority 120
advert_int 1
preempt_delay 5
track_script { chk_gw }
virtual_ipaddress {
10.10.10.1/24 dev eth0
2001:db8:10::1/64 dev eth0
}
garp_master_delay 1
}
NX-OS (HSRP/GLBP) - options utiles
feature hsrp
interface Vlan10
hsrp 10 ip 10.10.10.1
hsrp 10 priority 120 preempt delay minimum 5
hsrp 10 timers msec 250 msec 750 ! convergence rapide
! GLBP (si supporté)
glbp 10 timers 1 3
glbp 10 weighting 110 lower 95 upper 105
Interface/Object tracking
- Interface : décrément de priorité si down (p.ex. −20).
- Route/IP SLA : track reachabilité next-hop/Internet.
- GLBP weighting : désinscription AVF si seuil bas.
ip sla 10
icmp-echo 203.0.113.1 source-interface G0/0
frequency 2
ip sla schedule 10 life forever start-time now
track 10 ip sla 10 reachability
interface Vlan10
standby 10 track 10 decrement 30
Calcul failover
| Proto | Intervalle | Détection≈ | Notes |
|---|---|---|---|
| VRRP | adv=1s | ~3s | Dead=3×adv |
| HSRP | hello=3s | ~10s | Hold 10s |
| BFD | tx/rx=100ms | ~300ms | mult=3 |
Réel = détection + preempt-delay + propagation ARP/ND.
ARP/ND & convergence
- Envoyer 5–10 Gratuitous ARP (ou NA en IPv6) à la bascule.
- Réduire ARP cache (ex. 60–120 s) sur hôtes critiques.
- Sur DC : LACP min-links + STP stable pour éviter oscillations.
VRRPv3 / HSRP for IPv6
- VRRPv3 : support IPv4/IPv6, auth supprimée du protocole (sécuriser via IGP/ACL/IPsec).
- HSRP IPv6 : adresse virtuelle
fe80::link-local possible. - GLBPv6 : support dépend des plates-formes.
interface Vlan10
ipv6 address 2001:db8:10::2/64
standby version 2
standby 10 ipv6 2001:db8:10::1
standby 10 priority 120 preempt
ND (Neighbor Discovery)
- Utiliser Unsolicited NA pour mettre à jour caches ND.
- Attention aux DAD (duplicate address detection) : preempt-delay > DAD.
Plan de contrôle
- ACL limiter multicast HSRP/VRRP/GLBP aux VLAN attendus.
- HSRP auth (text/md5). VRRPv3 : pas d’auth → filtre L2/L3.
- RA Guard / DHCP Guard pour éviter usurpation de gateway.
Anti-split-brain
- Suivre l’état L2 (UDLD, STP loop-guard).
- Track route/IP SLA (pas seulement l’interface).
- Prévoir preempt delay (5–10 s) pour laisser converger.
Edge cases
- Firewalls/ARP proxies → activer ARP gratuitous.
- Hyperviseurs : désactiver cache ARP persistant/override.
# Cisco IOS/NX-OS
show standby brief
show standby vlan 10
debug standby terse
show glbp brief
show glbp vlan 10
show vrrp brief
show ip arp | inc 10.10.10.1
clear arp 10.10.10.1
# JunOS
show vrrp summary
show vrrp interface vlan.10
show arp | match 10.10.10.1
# Linux keepalived
systemctl status keepalived
journalctl -u keepalived | tail -50
ip a show dev eth0 | egrep "10.10.10.1|2001:db8:10::1"
arp -an | grep 10.10.10.1
ndisc6 2001:db8:10::1 eth0
Méthodo Debug
- 1) Rôle (Active/Master) cohérent avec priority & tracking ?
- 2) Timers/hello reçus ? (compteurs incrementent).
- 3) ARP/ND mis à jour après bascule ? (gratuitous).
- 4) Retour trafic OK ? (asymétrie/ACL).
- 5) BFD/IP SLA actifs et stables ?
Checklist Déploiement
[ ] Priorités et preempt-delay définis (ex. 120/100, 5s)
[ ] Tracking interface + IP SLA (décrément 20–40)
[ ] Timers VRRP 1s (ou HSRP msec si supporté)
[ ] Gratuitous ARP/Unsolicited NA envoyés
[ ] ACL multicast limitant HSRP/VRRP/GLBP
[ ] ARP/ND cache hôtes raisonnables (60–120s)
[ ] Tests bascule planifiés (avec trafic réel)
MPLS (intro) — Labels, LDP/RSVP, L3VPN (très bref)
Composants
- PE (Provider Edge), P (core), CE (client).
- LFIB (Label FIB) = ILM/NHLFE (in-label → action → out-label/iface).
- PHP (Penultimate Hop Popping) : suppression du label avant PE (label 3 implicite).
Chemin MPLS = LSP (Label Switched Path).
Pile de labels
| Champ | Taille | Rôle |
|---|---|---|
| Label | 20 bits | Identifiant local LSP |
| TC (EXP) | 3 bits | QoS/CoS |
| S | 1 bit | Bottom-of-Stack |
| TTL | 8 bits | Boucles (MPLS ping/traceroute) |
Labels réservés (extraits)
| # | Nom | Usage |
|---|---|---|
| 0 | IPv4 Explicit Null | Préserver DSCP/EXP (pas de PHP) |
| 2 | IPv6 Explicit Null | Idem pour IPv6 |
| 3 | Implicit Null | PHP (label retiré, non transmis) |
| 7 | ELI | Entropy Label Indicator |
| 13 | GAL | G-ACh pour OAM (BFD/GMPLS) |
# Diagramme LSP (avec PHP)
CE -- PE -- P -- P -- PE -- CE
| | |
push swap pop(3)
LDP vs RSVP-TE (aperçu)
| Critère | LDP | RSVP-TE |
|---|---|---|
| Type | Best effort | Ingénierie de trafic (contraintes) |
| Chemin | IGP shortest | Contrainte (bande passante, SRLG, affinities) |
| État | Sans état par flux | Stateful par LSP |
| Usage | Core simple | Backbones TE, circuits |
Tendance moderne : SR-MPLS (IGP+SR, sans LDP/RSVP).
# Rappels
- LDP : TDP/LDP, découverte via UDP 646, session TCP 646.
- RSVP-TE : PATH/RESV, soft-state, refresh.
- SR-MPLS : SIDs (Node/Adj/Prefix), SRGB (ex. 16000-23999).
Architecture
- VRF par client (RIB/FIB séparées).
- MP-BGP : VPNv4 (AFI 1/SAFI 128), VPNv6 (AFI 2/SAFI 128).
- Double label : outer (transport LSP) + inner (VPN label).
RD & RT
- RD (Route Distinguisher) : rend les préfixes uniques (export BGP).
- RT (Route Target) : communautés d’import/export (isolation, hub-&-spoke).
Modèles : any-to-any (mêmes RT), hub-spoke (RT asymétriques).
PE-CE
- Static, OSPF, EIGRP, BGP (souvent préféré).
- Réécriture de tags/metrics selon protocole.
# Stack typique : [Transport Label][VPN Label][IP]
# PE "push" 2 labels, P "swap" outer, PHP "pop" outer → PE egress lit VPN label.
QoS (EXP/TC)
- Mapping DSCP→EXP en entrée PE, EXP→DSCP en sortie.
- EXP “service-class” sur le label de transport (porté dans le core).
- Avec Explicit Null (0/2) : préserver DSCP bout-à-bout.
Entropy Label
- ELI(7)/EL : améliore l’ECMP en core (hash stable).
- Inséré entre transport et payload (ELI, puis EL).
# OAM
- LSP Ping / Traceroute (RFC 4379) : vérifie data-plane (labels).
- BFD sur LSP/IGP : détection sous-seconde.
- MPLS OAM via GAL (13) + G-ACh.
# Troubleshooting (Cisco/JunOS/FRR)
show mpls forwarding-table
show mpls ldp neighbor | bindings
show bgp vpnv4 unicast summary
traceroute mpls ipv4 198.51.100.1
ping mpls ipv4 198.51.100.1/32
Cisco IOS/IOS-XE (LDP + L3VPN)
mpls ip
mpls label protocol ldp
!
interface Gig0/0
ip address 10.0.12.1 255.255.255.0
mpls ip
!
ip vrf CUSTA
rd 65000:10
route-target export 65000:10
route-target import 65000:10
!
interface Gig0/1
ip vrf forwarding CUSTA
ip address 192.0.2.1 255.255.255.252
!
router bgp 65000
bgp log-neighbor-changes
address-family vpnv4
neighbor 203.0.113.2 activate
neighbor 203.0.113.2 send-community extended
!
address-family ipv4 vrf CUSTA
redistribute connected
JunOS (LDP + VRF + VPNv4)
set protocols mpls interface ge-0/0/0
set protocols ldp interface ge-0/0/0
set routing-instances CUSTA instance-type vrf
set routing-instances CUSTA route-distinguisher 65000:10
set routing-instances CUSTA vrf-target target:65000:10
set routing-instances CUSTA interface ge-0/0/1.0
set protocols bgp group IBGP type internal
set protocols bgp group IBGP local-address 10.0.0.1
set protocols bgp group IBGP neighbor 10.0.0.2
set protocols bgp group IBGP family inet-vpn unicast
set routing-options router-id 10.0.0.1
FRR (ldpd + BGP VPN)
# /etc/frr/ldpd.conf
interface eth0
router-id 10.0.0.1
address-family ipv4
discovery transport-address 10.0.0.1
!
# /etc/frr/frr.conf (extrait)
router bgp 65000
bgp router-id 10.0.0.1
address-family vpnv4
neighbor 203.0.113.2 activate
neighbor 203.0.113.2 send-community both
!
vrf CUSTA
vni 10
exit-vrf
router bgp 65000 vrf CUSTA
address-family ipv4 unicast
redistribute connected
# Raccourcis CLI utiles (Cisco)
show mpls interfaces
show mpls ldp discovery
show mpls forwarding-table labels 16000
show bgp vpnv4 all neighbors 203.0.113.2 advertised-routes
Outils & Troubleshooting — ping/trace/mtr, tcpdump, ethtool, perf
Paramètres & invariants
- Variables :
IF_WAN=eth0,SERVER=<IP serveur iperf3>. - Horloge :
chronyc tracking(corréler timestamps). - ECN/BBR (optionnel tests TCP) :
sysctl net.ipv4.tcp_ecn=1,tcp_congestion_control=bbr. - Captures : rotation pcap
-C/-W(taille/nb fichiers).
| MTU lien | IPv4 ping -s | IPv6 ping -s | Note |
|---|---|---|---|
| 1500 | 1472 | 1452 | +28 bytes (v4), +48 (v6) |
| 1492 (PPPoE) | 1464 | 1444 | Overhead PPPoE |
| 9000 (jumbo) | 8972 | 8952 | Tests DC/LAN |
Séquence type (toutes vitesses)
# 0) Préflight
chronyc tracking; uname -a
ip a show dev IF_WAN; ethtool -S IF_WAN | egrep 'drop|err|fifo' || true
# 1) MTU utile
ping -I IF_WAN -M do -s 1472 8.8.8.8 # IPv4 1500
tracepath -6 2001:4860:4860::8888 # IPv6 PMTUD
# 2) MTR (120 paquets)
mtr -uw -c 120 1.1.1.1
# 3) Capture (anneaux)
tcpdump -i IF_WAN -nn -s 0 -C 100 -W 10 -w /tmp/wan-%Y%m%d%H%M%S.pcap &
# 4) Iperf3 (aller/retour)
iperf3 -c SERVER -P 4 -t 20
iperf3 -c SERVER -P 4 -R -t 20
# 5) Stop capture
pkill -INT tcpdump
Windows :
ping -n 4 -f -l 1472, tracert, WinMTR, iperf3.exe.Lecture rapide
- MTR : pertes fin de chemin > pertes intermédiaires.
- iperf3 : tester -R (chemin retour) + varier -P.
- tcpdump : vérifier retransmissions, MSS, ECN (CE).
# Débits attendus (ordre de grandeur)
10 Mb/s : 9–10 Mb/s TCP
50 Mb/s : 47–50 Mb/s TCP
100 Mb/s : 94–100 Mb/s TCP
Profil WAN — 10 Mb/s
Shaper local (éviter tail-drop opérateur)
# TBF simple ~9.8 Mb/s
tc qdisc replace dev IF_WAN root tbf rate 9800kbit burst 16kb latency 50ms
- Garde ~2% sous la synchro opérateur.
- Pour lever :
tc qdisc del dev IF_WAN root.
Runbook 10M
# MTU (IPv4 1500)
ping -I IF_WAN -M do -s 1472 1.1.1.1
# MTR
mtr -uw -c 200 1.1.1.1
# Capture
tcpdump -i IF_WAN -nn -s 0 -w /tmp/10M.pcap &
# Iperf
iperf3 -c SERVER -P 2 -t 30
iperf3 -c SERVER -R -P 2 -t 30
pkill -INT tcpdump
Attendus & indices
- TCP ≈ 9–10 Mb/s, RTT stable, peu de retrans.
- Si débit plafonne < 8 Mb/s → MTU/PMTUD, QoS opérateur, CPU faible.
Profil WAN — 50 Mb/s
Shaper local
tc qdisc replace dev IF_WAN root tbf rate 49mbit burst 64kb latency 50ms
Runbook 50M
ping -I IF_WAN -M do -s 1472 8.8.8.8
mtr -uw -c 200 8.8.8.8
tcpdump -i IF_WAN -nn -s 0 -C 100 -W 5 -w /tmp/50M-%s.pcap &
iperf3 -c SERVER -P 4 -t 30
iperf3 -c SERVER -R -P 4 -t 30
pkill -INT tcpdump
Réglages TCP utiles
sysctl net.ipv4.tcp_congestion_control=bbr
sysctl net.core.rmem_max=67108864
sysctl net.core.wmem_max=67108864
Profil WAN — 100 Mb/s
Shaper local
tc qdisc replace dev IF_WAN root tbf rate 98mbit burst 128kb latency 50ms
Adapter
burst aux buffers NIC (éviter micro-bursts).Runbook 100M
ping -I IF_WAN -M do -s 1472 1.0.0.1
mtr -uw -c 200 1.0.0.1
tcpdump -i IF_WAN -nn -s 0 -C 200 -W 5 -w /tmp/100M-%s.pcap &
iperf3 -c SERVER -P 6 -t 30
iperf3 -c SERVER -R -P 6 -t 30
pkill -INT tcpdump
Quand passer à UDP
# Débit/jitter/pertes sans contrôle congestion
iperf3 -c SERVER -u -b 95M -l 1200 -t 20
iperf3 -c SERVER -u -R -b 95M -l 1200 -t 20
Surveiller pertes & jitter — si pertes >1–2%, suspecter goulot opérateur.
Astuce capture fidèle
- Désactiver GRO/LRO pendant capture :
ethtool -K IF_WAN gro off lro off. - Réactiver ensuite :
gro on(perfs).
Diag visuel
# Flux séquencé
( MTU ok ) -> ( MTR stable ) -> ( Capture on ) -> ( iperf3 →/← ) -> ( Analyse pcap )# Checklist profil
[ ] IF_WAN correct, horloge NTP ok
[ ] MTU validée (v4/v6)
[ ] MTR ~0% pertes fin de chemin
[ ] Anneaux pcap actifs
[ ] iperf3 aller/retour >= 95% cible
[ ] Captures analysées (retrans, MSS, ECN)
