Outils pour utilisateurs

Outils du site


article:virt-manager_plusieurs_vm_yunohost_vers_une_seule_ip:accueil

Ceci est une ancienne révision du document !


<html> <!DOCTYPE html> <html lang=“fr”> <head>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Documentation : Proxy Sécurisé C++ sur Virt-Manager</title>
  <style>
      :root {
          --primary-color: #2c3e50;
          --accent-color: #3498db;
          --bg-color: #f4f6f7;
          --code-bg: #282c34;
          --text-color: #333;
          --border-color: #ddd;
      }
      body {
          font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
          line-height: 1.6;
          color: var(--text-color);
          background-color: var(--bg-color);
          margin: 0;
          padding: 20px;
      }
      .container {
          max-width: 1000px;
          margin: 0 auto;
          background: white;
          padding: 40px;
          border-radius: 8px;
          box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      }
      h1, h2, h3 {
          color: var(--primary-color);
          border-bottom: 2px solid var(--accent-color);
          padding-bottom: 10px;
          margin-top: 30px;
      }
      h1 { text-align: center; font-size: 2.5em; margin-bottom: 40px; }
      h2 { font-size: 1.8em; margin-top: 40px; }
      h3 { font-size: 1.4em; margin-top: 25px; }
      
      .alert {
          background-color: #fff3cd;
          border-left: 5px solid #ffc107;
          padding: 15px;
          margin: 20px 0;
          border-radius: 4px;
      }
      .alert-danger {
          background-color: #f8d7da;
          border-left: 5px solid #dc3545;
      }
      .alert-success {
          background-color: #d4edda;
          border-left: 5px solid #28a745;
      }
      pre {
          background-color: var(--code-bg);
          color: #abb2bf;
          padding: 15px;
          border-radius: 5px;
          overflow-x: auto;
          font-family: 'Consolas', 'Monaco', monospace;
          font-size: 0.95em;
          border: 1px solid #444;
      }
      code {
          font-family: 'Consolas', 'Monaco', monospace;
          background-color: #eee;
          padding: 2px 5px;
          border-radius: 3px;
          color: #c7254e;
      }
      pre code {
          background-color: transparent;
          color: inherit;
          padding: 0;
      }
      table {
          width: 100%;
          border-collapse: collapse;
          margin: 20px 0;
      }
      th, td {
          border: 1px solid var(--border-color);
          padding: 12px;
          text-align: left;
      }
      th {
          background-color: var(--primary-color);
          color: white;
      }
      tr:nth-child(even) { background-color: #f9f9f9; }
      
      .step-box {
          background: #f8f9fa;
          border: 1px solid #e9ecef;
          padding: 20px;
          margin-bottom: 20px;
          border-radius: 5px;
      }
      .copy-btn {
          background-color: var(--accent-color);
          color: white;
          border: none;
          padding: 5px 10px;
          cursor: pointer;
          border-radius: 3px;
          font-size: 0.8em;
          float: right;
      }
      .copy-btn:hover { background-color: #2980b9; }
      
      .diagram {
          font-family: monospace;
          white-space: pre;
          background: #f0f0f0;
          padding: 20px;
          border: 1px dashed #ccc;
          overflow-x: auto;
          text-align: center;
          font-size: 0.85em;
      }
  </style>

</head> <body>

  <h1>Architecture Proxy Sécurisé C++ sur Virt-Manager</h1>
  <p><strong>Objectif :</strong> Créer une infrastructure virtualisée où des VMs Yunohost sont isolées dans un réseau privé, protégées par une VM Gateway (Debian) exécutant un Reverse Proxy personnalisé en C++.</p>
  <p><strong>Contexte :</strong> Freebox Pop (IP Fixe V4 Full Stack), PC Hôte Linux avec virt-manager.</p>
  <!-- SECTION 1: ARCHITECTURE -->
  <h2>1. Architecture Réseau</h2>
  <div class="alert alert-success">
      <strong>Topologie Clé :</strong> La VM Yunohost est <em>invisible</em> depuis Internet. Seul le Proxy sur la Gateway est exposé.
  </div>
  <div class="diagram">

+———————–+ INTERNET (IP Fixe) +—————————+

UTILISATEUR FREEBOX POP
(Navigateur) (IP Publique Fixe)

+———-+————+ +————-+————-+

         |                                                       |
         | 1. Requêtes HTTP/HTTPS (Port 80/443)                  |
         |                                                       |
         v                                                       v

+——————————————————————————————–+

SERVEUR PHYSIQUE (Hôte KVM)
(PC avec virt-manager)
+———————-+ +———————-+ +——————+
RÉSEAU VIRTUEL VM YUNOHOST
VM GATEWAY (Debian) ←—–> (reseau-yunohost) ←—–> (Service A)
(192.168.100.0/24)
+————–+ (Bridge virtuel) IP: 192.168.100.10
eth0 (WAN) —-+———-+———————-+———-+–> eth0 (LAN)
192.168.1.50
+————–+
+————–+
eth1 (LAN) —-+———-+——————–+———-+–> eth0 (LAN)
192.168.100.1
+————–+
[Services]: [Services]:

TARGET = proxy_manager

all: $(TARGET)

$(TARGET): main.cpp

$(CXX) $(CXXFLAGS) -o $@ $<

clean:

rm -f $(TARGET)

run: $(TARGET)

sudo ./$(TARGET)</code></pre>
  <!-- SECTION 6: CONFIG.JSON -->
  <h2>6. Fichier de Configuration (config.json)</h2>
  <p>Créez ce fichier manuellement ou laissez le programme le créer au premier lancement.</p>
  
  <button class="copy-btn" onclick="copyCode('json-code')">Copier</button>
  <pre id="json-code"><code>{
"vm_list": []

}</code></pre>

  <!-- SECTION 7: INSTRUCTIONS -->
  <h2>7. Instructions de Déploiement</h2>
  <ol>
      <li><strong>Préparer la VM Gateway (Debian) :</strong>
          <ul>
              <li>Installer les dépendances : <code>sudo apt update && sudo apt install -y build-essential net-tools iptables-persistent</code>.</li>
              <li>Créer les fichiers <code>main.cpp</code>, <code>Makefile</code>, <code>config.json</code>.</li>
              <li>Lancer le script Bash <code>setup_gateway.sh</code> (copié ci-dessus) pour configurer le réseau.</li>
          </ul>
      </li>
      <li><strong>Compiler le Proxy :</strong>
          <ul>
              <li><code>make</code></li>
          </ul>
      </li>
      <li><strong>Lancer le Proxy :</strong>
          <ul>
              <li><code>sudo ./proxy_manager</code></li>
          </ul>
      </li>
      <li><strong>Configurer les VMs Yunohost :</strong>
          <ul>
              <li>Assurez-vous qu'elles sont sur le réseau <code>reseau-yunohost</code>.</li>
              <li>Accédez à l'interface web du proxy : <code>http://192.168.1.50:8080</code>.</li>
              <li>Ajoutez vos VMs via l'interface (ex: Domaine: <code>monsite.com</code>, IP: <code>192.168.100.10</code>).</li>
          </ul>
      </li>
      <li><strong>Test Final :</strong>
          <ul>
              <li>Depuis l'extérieur (4G), accédez à <code>http://<VOTRE_IP_FIXE></code>.</li>
              <li>Le trafic doit passer par la Gateway, puis être routé vers la VM Yunohost.</li>
          </ul
article/virt-manager_plusieurs_vm_yunohost_vers_une_seule_ip/accueil.1778601749.txt.gz · Dernière modification : de estro

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki