📋 Production HAProxy & Firewall Lab Checklist 📋 Liste de contrôle : Labo HAProxy & Pare-feu

Lab Completion Progress Progression du laboratoire 0% (0/18 Items)

🌐 Network Blueprint Mapping 🌐 Cartographie de la Topologie Réseau

Verify you are operating within this mapped IP workspace before executing variables. Vérifiez que vous opérez bien dans cet espace IP configuré avant d'exécuter vos variables.

HAProxy WAN
(External)
172.16.5.130
HAProxy LAN
(Gateway)
172.20.0.10
SRV-WEB1
(Internal Node)
172.20.0.11
SRV-WEB2
(Internal Node)
172.20.0.12
🟥 Phase 1: Baseline Web Server Environments 🟥 Phase 1 : Configuration initiale des serveurs Web
Verify Local Web Server Addressing Vérifier l'adressage IP local des serveurs
Action: Run ip a on both web servers.Exécutez ip a sur les deux serveurs Web.
Check: Confirm SRV-WEB1 shows 172.20.0.11/24 on interface ens33 and SRV-WEB2 shows 172.20.0.12/24 on interface ens33.Confirmez que SRV-WEB1 affiche 172.20.0.11/24 sur l'interface ens33 et SRV-WEB2 affiche 172.20.0.12/24 sur ens33.
Verify Apache Service Status Vérifier le statut du service Apache
Action: Run systemctl status apache2 on both web servers.Exécutez systemctl status apache2 sur les deux serveurs.
Check: Output must state Active: active (running).La sortie terminal doit indiquer Active: active (running).
Differentiate Content Payloads Différencier le contenu des pages Web
Action: Inspect /var/www/html/thegrill-master/index.html on both nodes.Inspectez /var/www/html/thegrill-master/index.html sur les deux serveurs.
Check: Ensure text reads "THE GRILL 1" on Server 1 and "THE GRILL 2" on Server 2.Assurez-vous que le titre affiche "THE GRILL 1" sur le Serveur 1 et "THE GRILL 2" sur le Serveur 2.
Internal LAN Connectivity Vérifier la connectivité LAN interne
Action: From the HAProxy node, run ping 172.20.0.11 and ping 172.20.0.12.Depuis la machine HAProxy, lancez un ping vers 172.20.0.11 et 172.20.0.12.
Check: ICMP echo replies must return successfully with 0% packet loss.Les réponses d'écho ICMP doivent revenir avec succès (0% de perte).
🟨 Phase 2: HAProxy Installation & Correction Fixes 🟨 Phase 2 : Installation et corrections de HAProxy
Correct Configuration File Target Cibler le bon fichier de configuration
Correction Applied:Correction appliquée : Ignored document template typo (/etc/ha proxy/ha proxy.Fg). Ignoré l'erreur de syntaxe du document (/etc/ha proxy/ha proxy.Fg).
Action: Modify legitimate system path: nano /etc/haproxy/haproxy.cfg.Modifiez le vrai chemin système : nano /etc/haproxy/haproxy.cfg.
Correct Frontend Binding IP Corriger l'IP d'écoute (Binding) Frontend
Correction Applied:Correction appliquée : Replaced placeholder string IPdeLaDeuxièmeCarte. Remplacé la chaîne générique IPdeLaDeuxièmeCarte.
Action: Explicitly set the configuration block directive to: bind 172.16.5.130:80.Définissez explicitement la directive d'écoute sur : bind 172.16.5.130:80.
Correct Backend Server IP Routing Alignment Aligner les adresses IP des serveurs Backend
Correction Applied:Correction appliquée : Swapped broken template network hosts (.21 / .22) for localized addresses. Remplacé les mauvaises IP du modèle (.21 / .22) par vos vraies adresses.
Action: Verify block definitions point to correct live IPs:Vérifiez que les définitions de bloc pointent vers vos IP réelles :
server SRV-WEB1 172.20.0.11:80 check
server SRV-WEB2 172.20.0.12:80 check
Clean Restart and Diagnostics Validation Validation et redémarrage propre de HAProxy
Correction Applied:Correction appliquée : Restructured dual status error typo command. Corrigé la commande erronée contenant deux fois le mot "status".
Action: Run system control orchestration sequence:Exécutez la séquence système suivante :
sudo systemctl restart haproxy
sudo systemctl status haproxy
Check: Verify configuration engine reads Active: active (running).Vérifiez que le service affiche bien Active: active (running).
🟩 Phase 3: Load Balancing & Stats Demonstration 🟩 Phase 3 : Équilibrage de charge & Statistiques
Validate Layer 7 Round-Robin Distribution Valider la répartition Round-Robin (Couche 7)
Action: From an external client browser, go to: http://172.16.5.130.Depuis un navigateur client externe, allez sur : http://172.16.5.130.
Check: Initial hit displays "The Grill 1". Perform a hard refresh (Ctrl + F5); layout must transition to "The Grill 2".Le premier chargement doit afficher "The Grill 1". Faites un rafraîchissement forcé (Ctrl + F5) ; la page doit basculer sur "The Grill 2".
Access Administrative Telemetry Dashboard Accéder au tableau de bord des statistiques
Action: Direct client browser to: http://172.16.5.130/statistique.Dirigez le navigateur client vers : http://172.16.5.130/statistique.
Check: Authenticate using user admin and password password. Verify the grid paints both servers in bright green (UP).Connectez-vous avec admin et le mot de passe password. Vérifiez que la page affiche les deux serveurs web en vert (UP).
High Availability Health Check (Failover) Test de Haute Disponibilité & Tolérance aux pannes
Action: Kill worker process on Node 1: sudo systemctl stop apache2. Track metrics engine dashboard.Coupez Apache sur le Serveur 1 : sudo systemctl stop apache2. Suivez l'évolution sur l'interface de statistiques.
Check: SRV-WEB1 triggers to red (DOWN) status. Main proxy address must successfully distribute 100% of packets to SRV-WEB2 without packet loss.SRV-WEB1 doit passer en rouge (DOWN). L'adresse IP principale doit rediriger automatiquement 100% du trafic sur SRV-WEB2 sans aucune coupure pour l'utilisateur.
Cleanup: Wake up process engine: sudo systemctl start apache2.Relancez le service : sudo systemctl start apache2.
🟦 Phase 4: Security Privileges & Firewall Manipulation 🟦 Phase 4 : Privilèges de sécurité & Pare-feu
Provision Sudoer Permissions Accorder les privilèges Sudo à l'utilisateur
Correction Applied:Correction appliquée : Fixed standard user terminal blockades (Permission non accordée). Résolu le blocage des droits du terminal (Permission non accordée).
Action: Root privilege drop: escalate via su -, run apt install sudo, add regular account via usermod -aG sudo user, and initialize clean login.Passez en root via su -, installez le paquet via apt install sudo, ajoutez votre compte au groupe via usermod -aG sudo user, puis reconnectez-vous pour appliquer.
Synchronize Firewall Script to Local Topology Adapter le script du Pare-feu à votre topologie IP
Correction Applied:Correction appliquée : Stripped foreign script gateway address (192.168.254.136). Remplacé l'adresse IP étrangère du script initial (192.168.254.136).
Action: Ensure script routes point to your true interface name and local WAN destination:Vérifiez que les lignes de redirection correspondent bien à votre carte réseau et votre IP WAN (172.16.5.130) :
iptables -t nat -A PREROUTING -p tcp -d 172.16.5.130 --dport 2221 -j DNAT --to-destination 172.20.0.11:22
iptables -t nat -A PREROUTING -p tcp -d 172.16.5.130 --dport 2222 -j DNAT --to-destination 172.20.0.12:22
Enforce Firewall Runtime Operations Exécuter le script de pare-feu
Action: Spin up custom shell engine rules with sudo access:Lancez l'application des règles iptables avec vos droits sudo tout neufs :
sudo ./firewall.sh start
Verify Kernel Transit Engine (IP Forwarding) Vérifier le routage du Noyau (IP Forwarding)
Action: Query internal packet forwarding state parameters: cat /proc/sys/net/ipv4/ip_forward.Interrogez le paramètre système de transfert réseau : cat /proc/sys/net/ipv4/ip_forward.
Check: Standard core value verification must return `1`.La valeur retournée par le noyau doit être égale à `1`.
🟪 Phase 5: Persistent Routing & Remote Inbound Access 🟪 Phase 5 : Routage persistant & Accès distant SSH
Incorporate Permanent Gateway Signatures Rendre la passerelle par défaut (Gateway) permanente
Correction Applied:Correction appliquée : Mitigated asymmetric routing drops where internal hosts lacked an outbound return path. Résolu le problème du routage asymétrique où les serveurs internes perdaient le chemin de retour.
Action: Edit /etc/network/interfaces on both nodes. Append gateway 172.20.0.10 under device blocks, then run sudo systemctl restart networking.Modifiez /etc/network/interfaces sur les deux serveurs. Ajoutez la ligne gateway 172.20.0.10 sous votre carte, puis relancez via sudo systemctl restart networking.
Confirm Permanent Kernel Routing Tables Confirmer la table de routage du noyau
Action: Evaluate routing tables via ip route command on web nodes.Vérifiez la table de routage avec la commande ip route sur les deux serveurs web.
Check: Ensure output includes structural persistent entry line: default via 172.20.0.10 dev ens33 proto static.Assurez-vous qu'une ligne de route permanente par défaut apparaît : default via 172.20.0.10 dev ens33 proto static.
Verify Destination NAT Inbound Tunneling (Port 2221) Tester le tunnel de redirection DNAT (Port 2221)
Action: From an external client device shell, attempt to cross-route via customized port redirection:Depuis le terminal de votre machine cliente externe, initiez la connexion SSH sur le port personnalisé :
ssh user@172.16.5.130 -p 2221
Check: Handshake must establish password authorization prompt. Authenticate and verify hostname states you are running terminals inside SRV-WEB1.La connexion doit aboutir sur la demande de mot de passe. Connectez-vous, puis tapez hostname : vous devez être sur la console de SRV-WEB1.
Verify Destination NAT Inbound Tunneling (Port 2222) Tester le tunnel de redirection DNAT (Port 2222)
Action: Connect to secondary node translation lane:Connectez-vous sur le deuxième port de redirection :
ssh user@172.16.5.130 -p 2222
Check: Confirm session connection maps securely to the backend command line of SRV-WEB2.Confirmez que la session s'ouvre de manière sécurisée directement sur l'environnement de SRV-WEB2.