Your IP : 216.73.217.13


Current Path : /proc/thread-self/root/snap/lxd/current/share/lxd-documentation/howto/network_forwards/
Upload File :
Current File : //proc/thread-self/root/snap/lxd/current/share/lxd-documentation/howto/network_forwards/index.html

<!doctype html>
<html class="no-js" lang="en" data-content_root="../../">
  <head><meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="How to configure network forwards" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/howto/network_forwards/" />
<meta property="og:site_name" content="LXD documentation" />
<meta property="og:description" content="Network forwards allow an external IP address (or specific ports on it) to be forwarded to an internal IP address (or specific ports on it) in the network that the forward belongs to. This feature ..." />
<meta property="og:image" content="https://documentation.ubuntu.com/lxd/latest/_static/lxd_tag.png" />
<meta property="og:image:alt" content="LXD documentation" />
<meta name="description" content="Network forwards allow an external IP address (or specific ports on it) to be forwarded to an internal IP address (or specific ports on it) in the network that the forward belongs to. This feature ..." />

    <meta property="article:modified_time" content="2026-02-13T13:16:52+00:00" /><link rel="index" title="Index" href="../../genindex/"><link rel="search" title="Search" href="../../search/"><link rel="next" title="How to configure network zones" href="../network_zones/"><link rel="prev" title="How to configure network ACLs" href="../network_acls/">
        <link rel="canonical" href="/howto/network_forwards/">

    <link rel="shortcut icon" href="../../_static/favicon.ico"><!-- Generated with Sphinx 7.4.7 and Furo 2025.12.19 -->
        <title>How to configure network forwards - LXD documentation</title>
      <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=d111a655" />
    <link rel="stylesheet" type="text/css" href="../../_static/styles/furo.css?v=7bdb33bb" />
    <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
    <link rel="stylesheet" type="text/css" href="../../_static/config-options.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/related-links.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/terminal.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/youtube.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/sphinx-design.min.css?v=95c83b7e" />
    <link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
    <link rel="stylesheet" type="text/css" href="../../_static/styles/furo-extensions.css?v=8dab3a3b" />
    <link rel="stylesheet" type="text/css" href="../../_static/lxd_custom.css?v=bfbf4da2" />
    <link rel="stylesheet" type="text/css" href="../../_static/cookie-banner.css?v=b74831ab" />
    <link rel="stylesheet" type="text/css" href="../../_static/custom.css?v=e189117a" />
    <link rel="stylesheet" type="text/css" href="../../_static/header.css?v=a8078839" />
    <link rel="stylesheet" type="text/css" href="../../_static/github_issue_links.css?v=3d761185" />
    <link rel="stylesheet" type="text/css" href="../../_static/furo_colors.css?v=825fec6f" />
    
</head>
  <body>
    <header id="header" class="p-navigation">
  <!-- Google Tag Manager -->
  <script>
    (function(w, d, s, l, i) {
      w[l] = w[l] || [];
      w[l].push({
        'gtm.start': new Date().getTime(),
        event: 'gtm.js'
      });
      var f = d.getElementsByTagName(s)[0];
      var j = d.createElement(s);
      var dl = '';
      if (l != 'dataLayer') {
          dl = '&l=' + l;
      }
      j.async = true;
      j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
      f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', 'GTM-KNX3CJC');
  </script>
  
  <div class="p-navigation__nav" role="menubar">

    <ul class="p-navigation__links" role="menu">

      <li>
        
        <a class="p-logo" href="https://canonical.com/lxd" aria-current="page">
          <img src="../../_static/lxd_tag.png" alt="Logo" class="p-logo-image">
          <div class="p-logo-text p-heading--4">LXD
          </div>
        </a>
        
      </li>

      <li class="nav-ubuntu-com">
        
        <a href="https://canonical.com/lxd" class="p-navigation__link">canonical.com/lxd</a>
        
      </li>

      <li class="nav-dropdown">
        <a href="#" class="p-navigation__link nav-more-links"
           id="more-resources-toggle"
           aria-haspopup="true"
           aria-expanded="false">
          More resources
        </a>
        <ul class="more-links-dropdown" aria-labelledby="more-resources-toggle">
          
          <li>
            <a href="https://discourse.ubuntu.com/c/lxd/" class="p-navigation__sub-link p-dropdown__link">Discourse</a>
          </li>
          
      
          
      
          
          <li>
            <a href="https://matrix.to/#/#documentation:ubuntu.com" class="p-navigation__sub-link p-dropdown__link">Matrix</a>
          </li>
          
      
          
          <li>
            <a href="https://github.com/canonical/lxd" class="p-navigation__sub-link p-dropdown__link">GitHub</a>
          </li>
          

        </ul>
      </li>

    </ul>
  </div>
</header>
   
    <script>
      document.body.dataset.theme = localStorage.getItem("theme") || "auto";
    </script>
    

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  <symbol id="svg-toc" viewBox="0 0 24 24">
    <title>Contents</title>
    <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
      <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
    </svg>
  </symbol>
  <symbol id="svg-menu" viewBox="0 0 24 24">
    <title>Menu</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
      <line x1="3" y1="12" x2="21" y2="12"></line>
      <line x1="3" y1="6" x2="21" y2="6"></line>
      <line x1="3" y1="18" x2="21" y2="18"></line>
    </svg>
  </symbol>
  <symbol id="svg-arrow-right" viewBox="0 0 24 24">
    <title>Expand</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
      <polyline points="9 18 15 12 9 6"></polyline>
    </svg>
  </symbol>
  <symbol id="svg-sun" viewBox="0 0 24 24">
    <title>Light mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
      <circle cx="12" cy="12" r="5"></circle>
      <line x1="12" y1="1" x2="12" y2="3"></line>
      <line x1="12" y1="21" x2="12" y2="23"></line>
      <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
      <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
      <line x1="1" y1="12" x2="3" y2="12"></line>
      <line x1="21" y1="12" x2="23" y2="12"></line>
      <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
      <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
    </svg>
  </symbol>
  <symbol id="svg-moon" viewBox="0 0 24 24">
    <title>Dark mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
      <path stroke="none" d="M0 0h24v24H0z" fill="none" />
      <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
    </svg>
  </symbol>
  <symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
    <title>Auto light/dark, in light mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
      class="icon-custom-derived-from-feather-sun-and-tabler-moon">
      <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/>
      <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/>
      <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/>
      <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/>
      <line x1="19" y1="14.05" x2="20.414" y2="15.464"/>
      <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/>
      <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/>
      <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/>
      <line x1="19" y1="5.05" x2="20.414" y2="3.636"/>
      <circle cx="14.5" cy="9.55" r="3.6"/>
    </svg>
  </symbol>
  <symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
    <title>Auto light/dark, in dark mode</title>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
      class="icon-custom-derived-from-feather-sun-and-tabler-moon">
      <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/>
      <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/>
      <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/>
      <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/>
      <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/>
      <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/>
      <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/>
      <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/>
      <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/>
      <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/>
    </svg>
  </symbol>
  <symbol id="svg-pencil" viewBox="0 0 24 24">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code">
      <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
      <path d="M13.5 6.5l4 4" />
      <path d="M20 21l2 -2l-2 -2" />
      <path d="M17 17l-2 2l2 2" />
    </svg>
  </symbol>
  <symbol id="svg-eye" viewBox="0 0 24 24">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
      stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code">
      <path stroke="none" d="M0 0h24v24H0z" fill="none" />
      <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
      <path
        d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" />
      <path d="M20 21l2 -2l-2 -2" />
      <path d="M17 17l-2 2l2 2" />
    </svg>
  </symbol>
</svg>

<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
<label class="overlay sidebar-overlay" for="__navigation"></label>
<label class="overlay toc-overlay" for="__toc"></label>

<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>



<div class="page">
  <header class="mobile-header">
    <div class="header-left">
      <label class="nav-overlay-icon" for="__navigation">
        <span class="icon"><svg><use href="#svg-menu"></use></svg></span>
      </label>
    </div>
    <div class="header-center">
      <a href="../../"><div class="brand">LXD documentation</div></a>
    </div>
    <div class="header-right">
      <div class="theme-toggle-container theme-toggle-header">
        <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
          <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
          <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
          <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
          <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
        </button>
      </div>
      <label class="toc-overlay-icon toc-header-icon" for="__toc">
        <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
      </label>
    </div>
  </header>
  <aside class="sidebar-drawer">
    <div class="sidebar-container">
      
      <div class="sidebar-sticky"><a class="sidebar-brand" href="../../">
  
  <span class="sidebar-brand-text">LXD documentation</span>
  
</a><form class="sidebar-search-container" method="get" action="../../search/" role="search">
    <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
    <input type="submit" value="Go">
    <input type="hidden" name="check_keywords" value="yes">
    <input type="hidden" name="area" value="default">
  </form>
  <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
  <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../">LXD</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/first_steps/">Tutorial</a></li>
<li class="toctree-l1 current has-children"><a class="reference internal" href="../">How-to guides</a><input aria-label="Toggle navigation of How-to guides" checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul class="current">
<li class="toctree-l2 has-children"><a class="reference internal" href="../../getting_started/">Getting started</a><input aria-label="Toggle navigation of Getting started" class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../installing/">Install LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../initialize/">Initialize LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../access_ui/">Access the UI</a></li>
<li class="toctree-l3"><a class="reference internal" href="../access_documentation/">Access documentation locally</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../operation/">LXD server and client</a><input aria-label="Toggle navigation of LXD server and client" class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../server_expose/">Expose LXD to the network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../server_configure/">Configure the LXD server</a></li>
<li class="toctree-l3 has-children"><a class="reference internal" href="../oidc/">Configure single sign-on with OIDC</a><input aria-label="Toggle navigation of Configure single sign-on with OIDC" class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l4"><a class="reference internal" href="../oidc_auth0/">How to configure Auth0</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_ory/">How to configure Ory Hydra</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_keycloak/">How to configure Keycloak</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_entra_id/">How to configure Entra ID</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../remotes/">Add remote servers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../lxc_alias/">Add command aliases</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../instances/">Instances</a><input aria-label="Toggle navigation of Instances" class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../instances_create/">Create instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_configure/">Configure instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_manage/">Manage instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../profiles/">Use profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_troubleshoot/">Troubleshoot errors</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_ubuntu_pro_attach/">Auto attach Ubuntu Pro</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_access_files/">Access files</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_console/">Access the console</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../instance-exec/">Run commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-init/">Use cloud-init</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_routed_nic_vm/">Add a routed NIC to a VM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_backup/">Back up instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_migrate/">Migrate instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../import_machines_to_instances/">Import existing machines</a></li>
<li class="toctree-l3"><a class="reference internal" href="../container_gpu_passthrough_with_docker/">Pass NVIDIA GPUs</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../images/">Images</a><input aria-label="Toggle navigation of Images" class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../images_remote/">Use remote images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_manage/">Manage images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_profiles/">Associate profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_copy/">Copy and import images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_create/">Create images</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../projects/">Projects</a><input aria-label="Toggle navigation of Projects" class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../projects_create/">Create and configure</a></li>
<li class="toctree-l3"><a class="reference internal" href="../projects_work/">Work with projects</a></li>
<li class="toctree-l3"><a class="reference internal" href="../projects_confine/">Confine users to projects</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../storage/">Storage</a><input aria-label="Toggle navigation of Storage" class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../storage_pools/">Manage pools</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_volumes/">Manage volumes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_buckets/">Manage buckets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_create_instance/">Create an instance in a pool</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_backup_volume/">Back up a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_move_volume/">Move or copy a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_csi/">Use the LXD CSI driver with Kubernetes</a></li>
</ul>
</li>
<li class="toctree-l2 current has-children"><a class="reference internal" href="../../networks/">Networking</a><input aria-label="Toggle navigation of Networking" checked="" class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../network_create/">Create a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_configure/">Configure a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bgp/">Configure as BGP server</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_acls/">Configure network ACLs</a></li>
<li class="toctree-l3 current current-page"><a class="current reference internal" href="#">Configure forwards</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_zones/">Configure network zones</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_resolved/">Integrate with resolved</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ovn_setup/">Set up OVN</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_load_balancers/">Configure load balancers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ovn_peers/">Configure peer routing</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ipam/">Display IPAM information</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../clustering/">Clustering</a><input aria-label="Toggle navigation of Clustering" class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../cluster_form/">Form a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_manage/">Manage a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_config_networks/">Configure networks</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_config_storage/">Configure storage</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_manage_instance/">Manage instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_groups/">Set up cluster groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_placement_groups/">Use placement groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_recover/">Recover a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_vip/">Set up a highly available virtual IP</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../production-setup/">Production setup</a><input aria-label="Toggle navigation of Production setup" class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../benchmark_performance/">Benchmark performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_increase_bandwidth/">Increase bandwidth</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../metrics/">Monitor metrics</a></li>
<li class="toctree-l3"><a class="reference internal" href="../logs_loki/">Send logs to Loki</a></li>
<li class="toctree-l3"><a class="reference internal" href="../grafana/">Set up Grafana</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../backup/">Back up a server</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster_recovery/">Recover instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster_recovery_replication/">Disaster recovery with storage replication</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../snap/">Manage the snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../security_harden/">Harden security</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../troubleshoot/">Troubleshooting</a><input aria-label="Toggle navigation of Troubleshooting" class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_troubleshoot/">Troubleshoot instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../dqlite_troubleshoot/">Troubleshoot Dqlite</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../debugging/">Debug LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../faq/">Frequently asked</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../support/">Get support</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contributing/">Contribute to LXD</a></li>
<li class="toctree-l2"><a class="reference internal" href="../auth_bearer/">How to authenticate to the LXD API using bearer tokens</a></li>
<li class="toctree-l2"><a class="reference internal" href="../devlxd_authenticate/">How to authenticate to the DevLXD API</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../explanation/">Explanation</a><input aria-label="Toggle navigation of Explanation" class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" role="switch" type="checkbox"/><label for="toctree-checkbox-13"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/lxd_lxc/"><code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/instances/">Containers and VMs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../image-handling/">Local and remote images</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/storage/">Storage pools, volumes, and buckets</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/networks/">Networking setups</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../database/">The LXD Dqlite database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/lxc_show_info/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code> <code class="docutils literal notranslate"><span class="pre">show</span></code> and <code class="docutils literal notranslate"><span class="pre">info</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../authentication/">Remote API authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/authorization/">Remote API authorization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/projects/">Instances grouping with projects</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/clusters/">Clusters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/performance_tuning/">Performance tuning</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/security/">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/bpf/">Privilege delegation using BPF Token</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/csi/">The LXD CSI driver</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../reference/">Reference</a><input aria-label="Toggle navigation of Reference" class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" role="switch" type="checkbox"/><label for="toctree-checkbox-14"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../requirements/">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../architectures/">Architectures</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/release-notes/">Release notes</a><input aria-label="Toggle navigation of Release notes" class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" role="switch" type="checkbox"/><label for="toctree-checkbox-15"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/release-notes/release-notes-6.7/">LXD 6.7</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/release-notes/release-notes-6.6/">LXD 6.6</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/releases-snap/">Releases and snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/remote_image_servers/">Remote image servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/image_format/">Image format</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../guest-os-compatibility/">Guest OS compatibility</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../container-environment/">Container environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../config-options/">Configuration option index</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../server/">Server configuration</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../explanation/instance_config/">Instance configuration</a><input aria-label="Toggle navigation of Instance configuration" class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" role="switch" type="checkbox"/><label for="toctree-checkbox-16"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_properties/">Instance properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_options/">Instance options</a></li>
<li class="toctree-l3 has-children"><a class="reference internal" href="../../reference/devices/">Devices</a><input aria-label="Toggle navigation of Devices" class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" role="switch" type="checkbox"/><label for="toctree-checkbox-17"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l4"><a class="reference internal" href="../../reference/standard_devices/">Standard devices</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_none/">Type: <code class="docutils literal notranslate"><span class="pre">none</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_nic/">Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_disk/">Type: <code class="docutils literal notranslate"><span class="pre">disk</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_char/">Type: <code class="docutils literal notranslate"><span class="pre">unix-char</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_block/">Type: <code class="docutils literal notranslate"><span class="pre">unix-block</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_usb/">Type: <code class="docutils literal notranslate"><span class="pre">usb</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_gpu/">Type: <code class="docutils literal notranslate"><span class="pre">gpu</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_infiniband/">Type: <code class="docutils literal notranslate"><span class="pre">infiniband</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_proxy/">Type: <code class="docutils literal notranslate"><span class="pre">proxy</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_hotplug/">Type: <code class="docutils literal notranslate"><span class="pre">unix-hotplug</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_tpm/">Type: <code class="docutils literal notranslate"><span class="pre">tpm</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_pci/">Type: <code class="docutils literal notranslate"><span class="pre">pci</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_units/">Units for storage and network limits</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/preseed_yaml_fields/">Preseed YAML file fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/projects/">Project configuration</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/storage_drivers/">Storage drivers</a><input aria-label="Toggle navigation of Storage drivers" class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" role="switch" type="checkbox"/><label for="toctree-checkbox-18"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_dir/">Directory - <code class="docutils literal notranslate"><span class="pre">dir</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_btrfs/">Btrfs - <code class="docutils literal notranslate"><span class="pre">btrfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_lvm/">LVM - <code class="docutils literal notranslate"><span class="pre">lvm</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_zfs/">ZFS - <code class="docutils literal notranslate"><span class="pre">zfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_ceph/">Ceph RBD - <code class="docutils literal notranslate"><span class="pre">ceph</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_powerflex/">Dell PowerFlex - <code class="docutils literal notranslate"><span class="pre">powerflex</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_pure/">Pure Storage - <code class="docutils literal notranslate"><span class="pre">pure</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_alletra/">HPE Alletra - <code class="docutils literal notranslate"><span class="pre">alletra</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_cephfs/">CephFS - <code class="docutils literal notranslate"><span class="pre">cephfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_cephobject/">Ceph Object - <code class="docutils literal notranslate"><span class="pre">cephobject</span></code></a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/networks/">Networks</a><input aria-label="Toggle navigation of Networks" class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" role="switch" type="checkbox"/><label for="toctree-checkbox-19"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_bridge/">Bridge network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_ovn/">OVN network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_macvlan/">Macvlan network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_physical/">Physical network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_sriov/">SR-IOV network</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/cluster_member_config/">Cluster configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/placement_groups/">Placement group configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/server_settings/">Production server settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/provided_metrics/">Provided metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/permissions/">Permissions</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../restapi_landing/">REST API</a><input aria-label="Toggle navigation of REST API" class="toctree-checkbox" id="toctree-checkbox-20" name="toctree-checkbox-20" role="switch" type="checkbox"/><label for="toctree-checkbox-20"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../rest-api/">Main API documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../api/">Main API specification</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../api-extensions/">Main API extensions</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../events/">Events API documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../dev-lxd/">Instance API</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/driver_csi/">LXD CSI driver reference</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/manpages/">Man pages</a><input aria-label="Toggle navigation of Man pages" class="toctree-checkbox" id="toctree-checkbox-21" name="toctree-checkbox-21" role="switch" type="checkbox"/><label for="toctree-checkbox-21"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/manpages/lxc/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../internals/">Internals</a><input aria-label="Toggle navigation of Internals" class="toctree-checkbox" id="toctree-checkbox-22" name="toctree-checkbox-22" role="switch" type="checkbox"/><label for="toctree-checkbox-22"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../environment/">Environment variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/uefi_variables/">UEFI variables for VMs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../daemon-behavior/">Daemon behavior</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../syscall-interception/">System call interception</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../userns-idmap/">User namespace setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/ovn-internals/">OVN implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/vm_live_migration_internals/">VM live migration implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/dqlite-internals/">Dqlite</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="https://github.com/canonical/lxd">Project repository</a></li>
<li class="toctree-l2"><a class="reference external" href="https://images.lxd.canonical.com">Image server</a></li>
</ul>
</li>
</ul>

</div>
</div>

      </div>
      
    </div>
  </aside>
  <div class="main">
    <div class="content">
      <div class="article-container">
        <a href="#" class="back-to-top muted-link">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
            <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
          </svg>
          <span>Back to top</span>
        </a>
        <div class="content-icon-container">
          <div class="edit-this-page">
  <a class="muted-link" href="https://github.com/canonical/lxd/edit/main/doc/howto/network_forwards.md" title="Contribute to this page">
    <svg><use href="#svg-pencil"></use></svg>
    <span class="visually-hidden">Contribute to this page</span>
  </a>
</div><div class="theme-toggle-container theme-toggle-content">
            <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
              <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
              <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
              <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
              <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
            </button>
          </div>
          <label class="toc-overlay-icon toc-content-icon" for="__toc">
            <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
          </label>
        </div>
        <article role="main" id="furo-main-content">
          <section id="how-to-configure-network-forwards">
<span id="network-forwards"></span><h1>How to configure network forwards<a class="headerlink" href="#how-to-configure-network-forwards" title="Link to this heading">¶</a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Network forwards are available for the <a class="reference internal" href="../../reference/network_ovn/#network-ovn"><span class="std std-ref">OVN network</span></a> and the <a class="reference internal" href="../../reference/network_bridge/#network-bridge"><span class="std std-ref">Bridge network</span></a>.</p>
</div>

            <p class="youtube_link">
              <a href="https://www.youtube.com/watch?v=B-Uzo9WldMs" target="_blank">
                <span title="LXD network forwards" class="play_icon">▶</span>
                <span title="LXD network forwards">Watch on YouTube</span>
              </a>
            </p>
        <p>Network forwards allow an external IP address (or specific ports on it) to be forwarded to an internal IP address (or specific ports on it) in the network that the forward belongs to.</p>
<p>This feature can be useful if you have limited external IP addresses and want to share a single external address between multiple instances. In this case, you have two options:</p>
<ul class="simple">
<li><p>Forward all traffic from the external address to the internal address of one instance.
This method makes it easy to move the traffic destined for the external address to another instance by simply reconfiguring the network forward.</p></li>
<li><p>Forward traffic from different port numbers of the external address to different instances (and optionally different ports on those instances).
This method allows to “share” your external IP address and expose more than one instance at a time.</p></li>
</ul>
<p>For <a class="reference internal" href="../../reference/network_ovn/#network-ovn"><span class="std std-ref">OVN networks</span></a>, network forwards also allow an internal IP address (or specific ports on it) to be forwarded to another internal IP address (or specific ports).</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Network forwards are very similar to using a <a class="reference internal" href="../../reference/devices_proxy/#devices-proxy"><span class="std std-ref">proxy device</span></a> in NAT mode.</p>
<p>The difference is that network forwards are applied on a network level, while a proxy device is added for an instance.
In addition, proxy devices can be used to proxy traffic between different connection types (for example, TCP and Unix sockets).</p>
</div>
<section id="list-network-forwards">
<h2>List network forwards<a class="headerlink" href="#list-network-forwards" title="Link to this heading">¶</a></h2>
<p>View a list of all forwards configured on a network:</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-0-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-0-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-0-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-0-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-0-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="nb">list</span> <span class="o">&lt;</span><span class="n">network_name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="nb">list</span> <span class="n">lxdbr0</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This list displays the listen address of the network forward and its default target address, if set. To view the target addresses for a network forward’s ports <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">set in its port specifications</span></a>, you can <a class="reference internal" href="#network-forward-show"><span class="std std-ref">show details about the network forward</span></a> or <a class="reference internal" href="#network-forward-edit"><span class="std std-ref">edit the network forward</span></a>.</p>
</div>
</div><div aria-labelledby="tab-0-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>Query the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}</span></code> endpoint to list all forwards for a network.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">GET</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span>
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">GET</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">lxdbr0</span><span class="o">/</span><span class="n">forwards</span>
</pre></div>
</div>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forwards_get">the API reference</a> for more information.</p>
<p>You can also use <a class="reference internal" href="../../rest-api/#rest-api-recursion"><span class="std std-ref">recursion</span></a> to list the forwards with a higher level of detail:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>lxc query --request GET /1.0/networks/{networkName}/forwards?recursion=1
</pre></div>
</div>
</div><div aria-labelledby="tab-0-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab:</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forwards_view.png"><img alt="View a list of forwards on a network" src="../../_images/forwards_view.png" style="width: 95%;" />
</a>
</figure>
</div></div>
</section>
<section id="show-a-network-forward">
<span id="network-forward-show"></span><h2>Show a network forward<a class="headerlink" href="#show-a-network-forward" title="Link to this heading">¶</a></h2>
<p>Show details about a specific network forward:</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-1-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-1-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-1-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-1-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-1-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-1-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-1-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">show</span> <span class="o">&lt;</span><span class="n">network_name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">listen_address</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">show</span> <span class="n">lxdbr0</span> <span class="mf">192.0.2.1</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-1-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-1-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>Query the following endpoint for details about a specific forward:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">GET</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="p">{</span><span class="n">listenAddress</span><span class="p">}</span>
</pre></div>
</div>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_get">the API reference</a> for more information.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">GET</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovn1</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="mf">10.152.119.200</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-1-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-1-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab. This tab shows you information about all forwards on the network. You can click the <span class="guilabel">Edit</span> icon to view details for a specific forward:</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_edit_ex1.png"><img alt="View details about a specific forward on a network through its edit screen" src="../../_images/forward_edit_ex1.png" style="width: 95%;" />
</a>
</figure>
</div></div>
</section>
<section id="create-a-network-forward">
<span id="network-forward-create"></span><h2>Create a network forward<a class="headerlink" href="#create-a-network-forward" title="Link to this heading">¶</a></h2>
<section id="requirements-for-listen-addresses">
<span id="network-forwards-listen-addresses"></span><h3>Requirements for listen addresses<a class="headerlink" href="#requirements-for-listen-addresses" title="Link to this heading">¶</a></h3>
<p>Before you can create a network forward, you must understand the requirements for listen addresses.</p>
<p>For both OVN and bridge networks, the listen addresses must not overlap with any subnet in use by other networks on the host. Otherwise, the listen address requirements differ by network type.</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-T1ZOIG5ldHdvcms=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-2-T1ZOIG5ldHdvcms=" name="T1ZOIG5ldHdvcms=" role="tab" tabindex="0">OVN network</button><button aria-controls="panel-2-QnJpZGdlIG5ldHdvcms=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-2-QnJpZGdlIG5ldHdvcms=" name="QnJpZGdlIG5ldHdvcms=" role="tab" tabindex="-1">Bridge network</button></div><div aria-labelledby="tab-2-T1ZOIG5ldHdvcms=" class="sphinx-tabs-panel group-tab" id="panel-2-T1ZOIG5ldHdvcms=" name="T1ZOIG5ldHdvcms=" role="tabpanel" tabindex="0"><p>For an OVN network, the allowed listen addresses that are external IPs must be defined in at least one of the following configuration options, using <a class="reference external" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR notation</a>:</p>
<ul class="simple">
<li><p><a class="configref reference internal" href="../../reference/network_bridge/#network-bridge-network-conf:ipv4.routes"><code class="docutils literal notranslate"><span class="pre">ipv4.routes</span></code></a> or <a class="configref reference internal" href="../../reference/network_bridge/#network-bridge-network-conf:ipv6.routes"><code class="docutils literal notranslate"><span class="pre">ipv6.routes</span></code></a> in the OVN network’s uplink network configuration</p></li>
<li><p><a class="configref reference internal" href="../../reference/projects/#project-restricted:restricted.networks.subnets"><code class="docutils literal notranslate"><span class="pre">restricted.networks.subnets</span></code></a> in the OVN network’s project configuration</p></li>
</ul>
<p>The allowed internal IPs do not need to be defined. Use any non-conflicting internal IP address available on the OVN network.</p>
</div><div aria-labelledby="tab-2-QnJpZGdlIG5ldHdvcms=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-2-QnJpZGdlIG5ldHdvcms=" name="QnJpZGdlIG5ldHdvcms=" role="tabpanel" tabindex="0"><p>A bridge network does not require you to define allowed listen addresses. Use any non-conflicting IP address available on the host.</p>
</div></div>
</section>
<section id="create-a-forward-in-an-ovn-network">
<h3>Create a forward in an OVN network<a class="headerlink" href="#create-a-forward-in-an-ovn-network" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You must configure the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">allowed listen addresses</span></a> before you can create a forward in an OVN network.</p>
<p>The IP addresses and ports shown in the examples below are only examples. It is up to you to choose the allowed and available addresses and ports for your setup.</p>
</div>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-3-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-3-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-3-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-3-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-3-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-3-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-3-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><p>Use the following command to create a forward in an OVN network:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">create</span> <span class="o">&lt;</span><span class="n">ovn_network_name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">listen_address</span><span class="o">&gt;|--</span><span class="n">allocate</span><span class="o">=</span><span class="n">ipv</span><span class="p">{</span><span class="mi">4</span><span class="p">,</span><span class="mi">6</span><span class="p">}</span> <span class="p">[</span><span class="n">target_address</span><span class="o">=&lt;</span><span class="n">target_address</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="n">user</span><span class="o">.&lt;</span><span class="n">key</span><span class="o">&gt;=&lt;</span><span class="n">value</span><span class="o">&gt;</span><span class="p">]</span>
</pre></div>
</div>
<ul class="simple">
<li><p>For <code class="docutils literal notranslate"><span class="pre">&lt;ovn_network_name&gt;</span></code>, specify the name of the OVN network on which to create the forward.</p></li>
<li><p>Immediately following the network name, provide only one of the following for the listen address:</p>
<ul>
<li><p>A listen IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number)</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">--allocate=</span></code> flag with a value of either <code class="docutils literal notranslate"><span class="pre">ipv4</span></code> or <code class="docutils literal notranslate"><span class="pre">ipv6</span></code> for automatic allocation of an allowed external IP address</p></li>
</ul>
</li>
<li><p>Optionally provide a default <code class="docutils literal notranslate"><span class="pre">target_address</span></code> (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the OVN network’s subnet; typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally provide custom user.* keys to be stored in the network forward’s configuration.</p></li>
</ul>
<p class="rubric" id="examples">Examples</p>
<p>This example shows how to create a network forward on a network named <code class="docutils literal notranslate"><span class="pre">ovn1</span></code> with an allocated listen address and no default target address:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">create</span> <span class="n">ovn1</span> <span class="o">--</span><span class="n">allocate</span><span class="o">=</span><span class="n">ipv4</span>
</pre></div>
</div>
<p>This example shows how to create a network forward on a network named <code class="docutils literal notranslate"><span class="pre">ovn1</span></code> with a specific listen address and a default target address:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">create</span> <span class="n">ovn1</span> <span class="mf">192.0.2.1</span> <span class="n">target_address</span><span class="o">=</span><span class="mf">10.41.211.2</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-3-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-3-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>To create a network forward in an OVN network, send a POST request to the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}/forwards</span></code> endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">POST</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_address&gt;&quot;</span><span class="p">,</span>            <span class="c1"># required</span>
  <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward&gt;&quot;</span><span class="p">,</span>   <span class="c1"># optional</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;default_target_address&gt;&quot;</span><span class="p">,</span>  <span class="c1"># optional</span>
     <span class="s2">&quot;user.&lt;key&gt;&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;value&gt;&quot;</span>                        <span class="c1"># optional</span>
  <span class="p">},</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>                                        <span class="c1"># optional</span>
    <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward to this port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;tcp|udp&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target address&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target port or ports&gt;&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<ul class="simple">
<li><p>For <code class="docutils literal notranslate"><span class="pre">{networkName}</span></code>, specify the name of the OVN network on which to create the forward.</p></li>
<li><p>For <code class="docutils literal notranslate"><span class="pre">&lt;listen_address&gt;</span></code>, provide only one of the following:</p>
<ul>
<li><p>A listen IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number)</p></li>
<li><p>For automatic allocation of an allowed IP address, use <code class="docutils literal notranslate"><span class="pre">&quot;0.0.0.0&quot;</span></code> for IPv4 and <code class="docutils literal notranslate"><span class="pre">&quot;::&quot;</span></code> for IPv6.</p></li>
</ul>
</li>
<li><p>Optionally provide a description of the forward.</p></li>
<li><p>Optionally provide a default <code class="docutils literal notranslate"><span class="pre">target_address</span></code> as part of the <code class="docutils literal notranslate"><span class="pre">config</span></code> object (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the OVN network’s subnet; typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally provide custom <code class="docutils literal notranslate"><span class="pre">user.*</span></code> keys, also as part of the <code class="docutils literal notranslate"><span class="pre">config</span></code> object.</p></li>
<li><p>Optionally set up port specifications during forward creation. These specifications allow forwarding traffic from specific ports on the listen address to ports on a target address. For details on how to configure ports, see: <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">Configure ports</span></a>.</p></li>
</ul>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_post">the API reference</a> for more information.</p>
<p class="rubric" id="id1">Examples</p>
<p>This example shows how to create a network forward on a network named <code class="docutils literal notranslate"><span class="pre">ovn1</span></code> with an allocated listen address and no default target address:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">POST</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovn1</span><span class="o">/</span><span class="n">forwards</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.0.0&quot;</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p>This example shows how to create a network forward on a network named <code class="docutils literal notranslate"><span class="pre">ovn1</span></code> with a specific listen address and a default target address:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">POST</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovn1</span><span class="o">/</span><span class="n">forwards</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.2&quot;</span>
  <span class="p">}</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-3-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-3-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired OVN network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab. Click the <span class="guilabel">Create forward</span> button.</p>
<p>In the <span class="guilabel">Create a new forward</span> panel, only the <span class="guilabel">Listen address</span> field is required.</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_create_ovn.png"><img alt="Create an OVN network forward" src="../../_images/forward_create_ovn.png" style="width: 95%;" />
</a>
</figure>
<ul class="simple">
<li><p>For the <span class="guilabel">Listen address</span>, provide an IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number).</p></li>
<li><p>Optionally provide a <span class="guilabel">Default target address</span> (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the OVN network’s subnet; typically, the static IP address of an instance is used.</p></li>
</ul>
<p>You can optionally set up port specifications for the network forward by clicking the <span class="guilabel">Add port</span> button. These specifications allow forwarding traffic from specific ports on the listen address to ports on a target address. For details on how to configure this section, see: <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">Configure ports</span></a>.</p>
<p>Once you have finished setting up the network forward, click the <span class="guilabel">Create</span> button.</p>
</div></div>
</section>
<section id="create-a-forward-in-a-bridge-network">
<h3>Create a forward in a bridge network<a class="headerlink" href="#create-a-forward-in-a-bridge-network" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The IP addresses and ports shown in the examples below are only examples. It is up to you to choose the allowed and available addresses and ports for your setup.</p>
</div>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-4-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-4-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-4-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-4-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-4-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-4-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-4-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-4-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><p>Use the following command to create a forward in a bridge network:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">create</span> <span class="o">&lt;</span><span class="n">bridge_network_name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">listen_address</span><span class="o">&gt;</span> <span class="p">[</span><span class="n">target_address</span><span class="o">=&lt;</span><span class="n">target_address</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="n">user</span><span class="o">.&lt;</span><span class="n">key</span><span class="o">&gt;=&lt;</span><span class="n">value</span><span class="o">&gt;</span><span class="p">]</span>
</pre></div>
</div>
<ul class="simple">
<li><p>For <code class="docutils literal notranslate"><span class="pre">&lt;bridge_network_name&gt;</span></code>, specify the name of the bridge network on which to create the forward.</p></li>
<li><p>Immediately following the network name, provide an IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number).</p></li>
<li><p>Optionally provide a default <code class="docutils literal notranslate"><span class="pre">target_address</span></code> (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the bridge network’s subnet; typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally provide custom user.* keys to be stored in the network forward’s configuration.</p></li>
<li><p>You cannot use the <code class="docutils literal notranslate"><span class="pre">--allocate</span></code> flag with bridge networks.</p></li>
</ul>
<p class="rubric" id="example">Example</p>
<p>This example shows how to create a forward on a network named <code class="docutils literal notranslate"><span class="pre">bridge1</span></code>. The listen address is required, and the default target address is optional:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">create</span> <span class="n">bridge1</span> <span class="mf">192.0.2.1</span> <span class="n">target_address</span><span class="o">=</span><span class="mf">10.41.211.2</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-4-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-4-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>To create a network forward in a bridge network, send a POST request to the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}/forwards</span></code> endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">POST</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_address&gt;&quot;</span><span class="p">,</span>            <span class="c1"># required</span>
  <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward&gt;&quot;</span><span class="p">,</span>   <span class="c1"># optional</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;default_target_address&gt;&quot;</span><span class="p">,</span>  <span class="c1"># optional</span>
     <span class="s2">&quot;user.&lt;key&gt;&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;value&gt;&quot;</span>                        <span class="c1"># optional</span>
  <span class="p">},</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>                                        <span class="c1"># optional</span>
    <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward to this port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;tcp|udp&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target address&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target port or ports&gt;&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<ul class="simple">
<li><p>For <code class="docutils literal notranslate"><span class="pre">{networkName}</span></code>, specify the name of the bridge network on which to create the forward.</p></li>
<li><p>For <code class="docutils literal notranslate"><span class="pre">&lt;listen_address&gt;</span></code>, provide an IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number).</p>
<ul>
<li><p>With bridge networks, you cannot dynamically allocate the listen address. You must input a specific address.</p></li>
</ul>
</li>
<li><p>Optionally provide a description of the forward.</p></li>
<li><p>Optionally provide a default <code class="docutils literal notranslate"><span class="pre">target_address</span></code> as part of the <code class="docutils literal notranslate"><span class="pre">config</span></code> object (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the OVN network’s subnet; typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally provide custom <code class="docutils literal notranslate"><span class="pre">user.*</span></code> keys, also as part of the <code class="docutils literal notranslate"><span class="pre">config</span></code> object.</p></li>
<li><p>Optionally set up port specifications during forward creation. These specifications allow forwarding traffic from specific ports on the listen address to ports on a target address. For details on how to configure ports, see: <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">Configure ports</span></a>.</p></li>
</ul>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_post">the API reference</a> for more information.</p>
<p class="rubric" id="id2">Example</p>
<p>This example shows how to create a forward on a network named <code class="docutils literal notranslate"><span class="pre">bridge1</span></code>. The listen address is required, and the default target address is optional:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">POST</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">bridge1</span><span class="o">/</span><span class="n">forwards</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.2&quot;</span>
  <span class="p">}</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-4-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-4-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired bridge network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab. Click the <span class="guilabel">Create forward</span> button.</p>
<p>In the <span class="guilabel">Create a new forward</span> panel, only the <span class="guilabel">Listen address</span> field is required.</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_create_bridge.png"><img alt="Create a bridge network forward" src="../../_images/forward_create_bridge.png" style="width: 95%;" />
</a>
</figure>
<ul class="simple">
<li><p>For the <span class="guilabel">Listen address</span>, provide a listen IP address allowed by the <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a> (no port number).</p></li>
<li><p>Optionally provide a <span class="guilabel">Default target address</span> (no port number). Any traffic that does not match a port specification is forwarded to this address. This must be an IP address within the bridge network’s subnet; typically, the static IP address of an instance is used.</p></li>
</ul>
<p>You can optionally set up port specifications for the network forward by clicking the <span class="guilabel">Add port</span> button. These specifications allow forwarding traffic from specific ports on the listen address to ports on a target address. For details on how to configure this section, see: <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">Configure ports</span></a>.</p>
<p>Once you have finished setting up the network forward, click the <span class="guilabel">Create</span> button.</p>
</div></div>
</section>
<section id="forward-properties">
<h3>Forward properties<a class="headerlink" href="#forward-properties" title="Link to this heading">¶</a></h3>
<p>Network forwards have the following properties:</p>
<div class="configoption docutils container" id="network-forward-forward-properties:config">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">config</span></code></span><span class="shortdesc"><p>User-provided free-form key/value pairs</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-forward-properties:config"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">config</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string set</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The only supported keys are <code class="docutils literal notranslate"><span class="pre">target_address</span></code> and <code class="docutils literal notranslate"><span class="pre">user.*</span></code> custom keys.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">target_address</span></code> key is for the default target address of the network forward.
It must be an IP address within the subnet of the network the forward belongs to.</p>
</div>
</div>
<div class="configoption docutils container" id="network-forward-forward-properties:description">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">description</span></code></span><span class="shortdesc"><p>Description of the network forward</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-forward-properties:description"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">description</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="network-forward-forward-properties:listen_address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">listen_address</span></code></span><span class="shortdesc"><p>IP address to listen on</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-forward-properties:listen_address"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">listen_address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>See <a class="reference internal" href="#network-forwards-listen-addresses"><span class="std std-ref">Requirements for listen addresses</span></a>.</p>
</div>
</div>
<div class="configoption docutils container" id="network-forward-forward-properties:ports">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ports</span></code></span><span class="shortdesc"><p>List of port specifications</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-forward-properties:ports"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">ports</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>port list</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>See <a class="reference internal" href="#network-forwards-port-specifications"><span class="std std-ref">Configure ports</span></a>.</p>
</div>
</div>
</section>
</section>
<section id="configure-ports">
<span id="network-forwards-port-specifications"></span><h2>Configure ports<a class="headerlink" href="#configure-ports" title="Link to this heading">¶</a></h2>
<p>Once a forward is created on a network (whether bridge or OVN), it can be configured with port specifications. These specifications allow forwarding traffic from ports on the listen address to ports on a target address.</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-5-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-5-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-5-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-5-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-5-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-5-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-5-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-5-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><p>When using the CLI, you must first <a class="reference internal" href="#network-forward-create"><span class="std std-ref">create a network forward</span></a> before you can add port specifications to it.</p>
<p>Use the following command to add port specifications on a forward:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">port</span> <span class="n">add</span> <span class="o">&lt;</span><span class="n">network_name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">listen_address</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">protocol</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">listen_ports</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">target_address</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">target_ports</span><span class="o">&gt;</span><span class="p">]</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Use the network name and listen address of the forward for which you want to add port specifications.</p></li>
<li><p>Use either <code class="docutils literal notranslate"><span class="pre">tcp</span></code> or <code class="docutils literal notranslate"><span class="pre">udp</span></code> as the protocol.</p></li>
<li><p>For the listen ports, you can specify a single listen port, a port range, or a comma-separated set of ports/port ranges.</p></li>
<li><p>Specify a target address. This address must be within the network’s subnet, and it must be different from the forward’s default target address. Typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally specify a target port or ports. You can:</p>
<ul>
<li><p>Specify a single target port to forward traffic from all listen ports to this target port.</p></li>
<li><p>Specify a set of target ports with the same number of set items as the listen ports. This forwards traffic from the first listen port to the first target port, the second listen port to the second target port, and so on.</p></li>
</ul>
</li>
<li><p>If no target port is specified, the listen port value is used for the target port.</p></li>
<li><p>You can add multiple port configurations to the same network forward.</p></li>
</ul>
<p class="rubric" id="id3">Examples</p>
<p>The example below shows how to configure a forward with a single listen port. Since no target port is specified, the target port defaults to the value of the listen port:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">port</span> <span class="n">add</span> <span class="n">network1</span> <span class="mf">192.0.2.1</span> <span class="n">tcp</span> <span class="mi">22</span> <span class="mf">10.41.211.2</span>
</pre></div>
</div>
<p>The example below shows how to configure a forward with a set of listen ports mapped to a single target port. Traffic to the listen address at ports 80 and 90 through 100 is forwarded to port 443 of the target address:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">port</span> <span class="n">add</span> <span class="n">network1</span> <span class="mf">192.0.2.1</span> <span class="n">tcp</span> <span class="mi">80</span><span class="p">,</span><span class="mi">90</span><span class="o">-</span><span class="mi">100</span> <span class="mf">10.41.211.2</span> <span class="mi">443</span>
</pre></div>
</div>
<p>The example below shows how to configure a forward with a set of listen ports mapped to a set of target ports. Traffic to the listen address at port 22 is forwarded to port 22 of the target address, whereas traffic to port 80 is forwarded to port 443:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">network</span> <span class="n">forward</span> <span class="n">port</span> <span class="n">add</span> <span class="n">network1</span> <span class="mf">192.0.2.1</span> <span class="n">tcp</span> <span class="mi">22</span><span class="p">,</span><span class="mi">80</span> <span class="mf">10.41.211.2</span> <span class="mi">22</span><span class="p">,</span><span class="mi">443</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-5-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-5-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>Using the API, you can configure port specifications on a network forward at the time you <a class="reference internal" href="#network-forward-create"><span class="std std-ref">create the forward</span></a>, or by <a class="reference internal" href="#network-forward-edit"><span class="std std-ref">editing the forward</span></a> after creation.</p>
<p>In either case, you must configure the <code class="docutils literal notranslate"><span class="pre">ports</span></code> object shown below:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="p">{</span>
<span class="linenos"> 2</span>  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_address&gt;&quot;</span><span class="p">,</span>
<span class="linenos"> 3</span>  <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward&gt;&quot;</span><span class="p">,</span>
<span class="linenos"> 4</span>  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="linenos"> 5</span>     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;default_target_address&gt;&quot;</span><span class="p">,</span>
<span class="linenos"> 6</span>     <span class="s2">&quot;user.&lt;key&gt;&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;value&gt;&quot;</span>
<span class="linenos"> 7</span>  <span class="p">},</span>
<span class="hll"><span class="linenos"> 8</span>  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
</span><span class="hll"><span class="linenos"> 9</span>    <span class="p">{</span>
</span><span class="hll"><span class="linenos">10</span>      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward to this port&gt;&quot;</span><span class="p">,</span>
</span><span class="hll"><span class="linenos">11</span>      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_port&gt;&quot;</span><span class="p">,</span>
</span><span class="hll"><span class="linenos">12</span>      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;tcp|udp&gt;&quot;</span><span class="p">,</span>
</span><span class="hll"><span class="linenos">13</span>      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target address&gt;&quot;</span><span class="p">,</span>
</span><span class="hll"><span class="linenos">14</span>      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target port or ports&gt;&quot;</span>
</span><span class="hll"><span class="linenos">15</span>    <span class="p">}</span>
</span><span class="linenos">16</span>  <span class="p">]</span>
<span class="linenos">17</span><span class="p">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p>For <code class="docutils literal notranslate"><span class="pre">&quot;listen_port&quot;</span></code>, you can specify a single listen port, a port range, or a comma-separated set of ports/port ranges.</p></li>
<li><p>Use either <code class="docutils literal notranslate"><span class="pre">&quot;tcp&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;udp&quot;</span></code> as the <code class="docutils literal notranslate"><span class="pre">&quot;protocol&quot;</span></code>.</p></li>
<li><p>Specify a <code class="docutils literal notranslate"><span class="pre">&quot;target_address&quot;</span></code>. This address must be within the network’s subnet, and it must be different from the forward’s default target address that is configured in the <code class="docutils literal notranslate"><span class="pre">config</span></code> object. Typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally specify a target port or ports. You can:</p>
<ul>
<li><p>Specify a single target port to forward traffic from all listen ports to this target port.</p></li>
<li><p>Specify a set of target ports with the same number of set items as the listen ports. This forwards traffic from the first listen port to the first target port, the second listen port to the second target port, and so on.</p></li>
</ul>
</li>
<li><p>If no target port is specified, the listen port value is used for the target port.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">&quot;ports&quot;</span></code> JSON property is configured as an array (list) of objects. You can set multiple port configurations on the same network forward, each as a separate JSON object in the array.</p></li>
</ul>
<p class="rubric" id="id4">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
   <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;My web server forward&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;80,81,8080-8090&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;tcp&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;198.51.100.2&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;80,81,8080-8090&quot;</span>
   <span class="p">},</span>
   <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;My API server forward&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;3000&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;tcp&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;198.51.100.3&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;8080&quot;</span>
   <span class="p">}</span>
<span class="p">]</span>
</pre></div>
</div>
<p>In the example above, traffic to the network forward’s listen ports of 80, 81, or 8080-8090 is explicitly forwarded to the same ports on the target address. Traffic to the forward’s listen port of 3000 is explicitly forwarded to port 8080 on the target address.</p>
<p>More examples;</p>
<ul class="simple">
<li><p>If the <code class="docutils literal notranslate"><span class="pre">&quot;listen_port&quot;</span></code> is set to <code class="docutils literal notranslate"><span class="pre">&quot;22&quot;</span></code> and no <code class="docutils literal notranslate"><span class="pre">&quot;target_port</span></code>” is specified, the target port value defaults to <code class="docutils literal notranslate"><span class="pre">&quot;22&quot;</span></code>.</p></li>
<li><p>If the <code class="docutils literal notranslate"><span class="pre">&quot;listen_port&quot;</span></code> is set to <code class="docutils literal notranslate"><span class="pre">&quot;80,90-100&quot;</span></code> and the <code class="docutils literal notranslate"><span class="pre">&quot;target_port</span></code>” is set to <code class="docutils literal notranslate"><span class="pre">&quot;442&quot;</span></code>, all traffic to the listen address at ports 80 and 90 through 100 is forwarded to port 443 of the target address.</p></li>
<li><p>If the <code class="docutils literal notranslate"><span class="pre">&quot;listen_port&quot;</span></code> is set to <code class="docutils literal notranslate"><span class="pre">&quot;22,80&quot;</span></code> and the <code class="docutils literal notranslate"><span class="pre">&quot;target_port</span></code>” is set to <code class="docutils literal notranslate"><span class="pre">&quot;22,443&quot;</span></code>, all traffic to the listen address at port 22 is forwarded to port 22 of the target address, whereas traffic to port 80 is forwarded to port 443.</p></li>
</ul>
</div><div aria-labelledby="tab-5-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-5-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In the web UI, you can configure port specifications on a network forward at the time you <a class="reference internal" href="#network-forward-create"><span class="std std-ref">create the forward</span></a>, or by <a class="reference internal" href="#network-forward-edit"><span class="std std-ref">editing the forward</span></a> after creation.</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_create_port.png"><img alt="Configure a network forward's port specifications" src="../../_images/forward_create_port.png" style="width: 95%;" />
</a>
</figure>
<ul class="simple">
<li><p>For the <span class="guilabel">Listen port</span>, you can specify a single port, a port range, or a comma-separated set of ports/port ranges.</p></li>
<li><p>Select either <span class="guilabel">TCP</span> or <span class="guilabel">UDP</span> as the protocol.</p></li>
<li><p>Specify a <span class="guilabel">Target address</span>. This address must be within the network’s subnet, and it must be different from the forward’s <span class="guilabel">Default target address</span>. Typically, the static IP address of an instance is used.</p></li>
<li><p>Optionally specify a target port or ports. You can:</p>
<ul>
<li><p>Specify a single target port to forward traffic from all listen ports to this target port.</p></li>
<li><p>Specify a set of target ports with the same number of set items as the listen ports. This forwards traffic from the first listen port to the first target port, the second listen port to the second target port, and so on.</p></li>
</ul>
</li>
<li><p>If no target port is specified, the listen port value is used for the target port.</p></li>
</ul>
<p class="rubric" id="id5">Examples</p>
<ul class="simple">
<li><p>If the <span class="guilabel">Listen port</span> is set to <code class="docutils literal notranslate"><span class="pre">22</span></code> and no <span class="guilabel">Target port</span> is specified, the target port value defaults to 22.</p></li>
<li><p>If the <span class="guilabel">Listen port</span> is set to <code class="docutils literal notranslate"><span class="pre">80,90-100</span></code> and the <span class="guilabel">Target port</span> is set to <span class="guilabel">442</span>, all traffic to the listen address at ports 80 and 90 through 100 is forwarded to port 443 of the target address.</p></li>
<li><p>If the <span class="guilabel">Listen port</span> is set to <code class="docutils literal notranslate"><span class="pre">22,80</span></code> and the <span class="guilabel">Target port</span> is set to <code class="docutils literal notranslate"><span class="pre">22,443</span></code>, all traffic to the listen address at port 22 is forwarded to port 22 of the target address, whereas traffic to port 80 is forwarded to port 443.</p></li>
</ul>
</div></div>
<section id="port-properties">
<h3>Port properties<a class="headerlink" href="#port-properties" title="Link to this heading">¶</a></h3>
<p>Network forward ports have the following properties:</p>
<div class="configoption docutils container" id="network-forward-port-properties:description">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">description</span></code></span><span class="shortdesc"><p>Description of the port or ports</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-port-properties:description"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">description</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="network-forward-port-properties:listen_port">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">listen_port</span></code></span><span class="shortdesc"><p>Listen port or ports</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-port-properties:listen_port"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">listen_port</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>For example: <code class="docutils literal notranslate"><span class="pre">80,90-100</span></code></p>
</div>
</div>
<div class="configoption docutils container" id="network-forward-port-properties:protocol">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">protocol</span></code></span><span class="shortdesc"><p>Protocol for the port or ports</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-port-properties:protocol"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">protocol</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Possible values are <code class="docutils literal notranslate"><span class="pre">tcp</span></code> and <code class="docutils literal notranslate"><span class="pre">udp</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="network-forward-port-properties:target_address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">target_address</span></code></span><span class="shortdesc"><p>IP address to forward to</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-port-properties:target_address"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">target_address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This <code class="docutils literal notranslate"><span class="pre">target_address</span></code> must be within the subnet of the network the forward belongs to.
Also, it must be different from the forward’s default target address.</p>
</div>
</div>
<div class="configoption docutils container" id="network-forward-port-properties:target_port">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">target_port</span></code></span><span class="shortdesc"><p>Target port or ports</p>
</span><span class="anchor"><a class="reference external" href="#network-forward-port-properties:target_port"><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></a></span></div>
<div class="details docutils container">
<div class="table-wrapper fields docutils container">
<table class="fields docutils align-default">
<tbody>
<tr class="row-odd"><td><strong>Key: </strong></td>
<td><code class="docutils literal notranslate"><span class="pre">target_port</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>same as <code class="docutils literal notranslate"><span class="pre">listen_port</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>For example: <code class="docutils literal notranslate"><span class="pre">70,80-90</span></code> or <code class="docutils literal notranslate"><span class="pre">90</span></code></p>
</div>
</div>
</section>
</section>
<section id="edit-a-network-forward">
<span id="network-forward-edit"></span><h2>Edit a network forward<a class="headerlink" href="#edit-a-network-forward" title="Link to this heading">¶</a></h2>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-6-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-6-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-6-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-6-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-6-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-6-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-6-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-6-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><p>Use the following command to edit a network forward:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>lxc<span class="w"> </span>network<span class="w"> </span>forward<span class="w"> </span>edit<span class="w"> </span>&lt;network_name&gt;<span class="w"> </span>&lt;listen_address&gt;
</pre></div>
</div>
<p>This command opens the network forward in YAML format for editing.
You can edit both the general configuration and the port specifications.</p>
</div><div aria-labelledby="tab-6-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-6-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p class="rubric" id="partial-update">Partial update</p>
<p>To update a subset of the network forward configuration, send a PATCH request to the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}/forwards/{listenAddress}</span></code> endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">PATCH</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="p">{</span><span class="n">listenAddress</span><span class="p">}</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;default_target_address&gt;&quot;</span><span class="p">,</span>
     <span class="s2">&quot;user.&lt;key&gt;&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;value&gt;&quot;</span>
  <span class="p">},</span>
  <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward&gt;&quot;</span><span class="p">,</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward to this port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;tcp|udp&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target address&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target port or ports&gt;&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_patch">the API reference</a> for more information.</p>
<p class="rubric" id="id6">Example</p>
<p>Update only the default target address of a forward:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">PATCH</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovn1</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="mf">10.152.119.200</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.3&quot;</span>
  <span class="p">}</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p class="rubric" id="full-update">Full update</p>
<p>To replace the entire configuration of an existing network forward, send a PUT request to the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}/forwards/{listenAddress}</span></code> endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">PUT</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="p">{</span><span class="n">listenAddress</span><span class="p">}</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;default_target_address&gt;&quot;</span><span class="p">,</span>
     <span class="s2">&quot;user.&lt;key&gt;&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;value&gt;&quot;</span>
  <span class="p">},</span>
  <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward&gt;&quot;</span><span class="p">,</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;description of the forward to this port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;listen_port&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;tcp|udp&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target address&gt;&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;target port or ports&gt;&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p>Unlike a <code class="docutils literal notranslate"><span class="pre">PATCH</span></code> request, the <code class="docutils literal notranslate"><span class="pre">PUT</span></code> request replaces the entire configuration.</p>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_put">the API reference</a> for more information.</p>
<p class="rubric" id="id7">Example</p>
<p>When using PUT, take care to send any data should be kept in the configuration. Consider the following configuration for a network forward:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.152.119.200&quot;</span><span class="p">,</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
     <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.3&quot;</span><span class="p">,</span>
  <span class="p">},</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;80&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;tcp&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.4&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;443&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p>The following PUT request updates the entire configuration:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">PUT</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovntest</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="mf">10.152.119.200</span> <span class="o">--</span><span class="n">data</span> <span class="s1">&#39;{</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;80&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;tcp&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.5&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;443&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span><span class="s1">&#39;</span>
</pre></div>
</div>
<p>The forward’s configuration after the PUT update:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;listen_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.152.119.200&quot;</span><span class="p">,</span>
  <span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{},</span>
  <span class="s2">&quot;ports&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;listen_port&quot;</span><span class="p">:</span> <span class="s2">&quot;80&quot;</span><span class="p">,</span>
      <span class="s2">&quot;protocol&quot;</span><span class="p">:</span> <span class="s2">&quot;tcp&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_address&quot;</span><span class="p">:</span> <span class="s2">&quot;10.41.211.5&quot;</span><span class="p">,</span>
      <span class="s2">&quot;target_port&quot;</span><span class="p">:</span> <span class="s2">&quot;443&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Notice that the <code class="docutils literal notranslate"><span class="pre">config</span></code> object no longer contains any values. This is because none were sent as part of the PUT update.</p>
</div><div aria-labelledby="tab-6-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-6-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab. This tab shows you information about all forwards on the network. Click the <span class="guilabel">Edit</span> icon next to a forward to edit it:</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_edit_ex1.png"><img alt="Choose to edit a forward on a network" src="../../_images/forward_edit_ex1.png" style="width: 95%;" />
</a>
</figure>
<p>In the resulting screen, you can edit the forward’s general configuration as well as its port specifications:</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_edit_ex2.png"><img alt="Edit a forward on a network" src="../../_images/forward_edit_ex2.png" style="width: 95%;" />
</a>
</figure>
</div></div>
</section>
<section id="delete-a-network-forward">
<h2>Delete a network forward<a class="headerlink" href="#delete-a-network-forward" title="Link to this heading">¶</a></h2>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-7-Q0xJ" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-7-Q0xJ" name="Q0xJ" role="tab" tabindex="0">CLI</button><button aria-controls="panel-7-QVBJ" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-7-QVBJ" name="QVBJ" role="tab" tabindex="-1">API</button><button aria-controls="panel-7-VUk=" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-7-VUk=" name="VUk=" role="tab" tabindex="-1">UI</button></div><div aria-labelledby="tab-7-Q0xJ" class="sphinx-tabs-panel group-tab" id="panel-7-Q0xJ" name="Q0xJ" role="tabpanel" tabindex="0"><p>Use the following command to delete a network forward:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>lxc<span class="w"> </span>network<span class="w"> </span>forward<span class="w"> </span>delete<span class="w"> </span>&lt;network_name&gt;<span class="w"> </span>&lt;listen_address&gt;
</pre></div>
</div>
</div><div aria-labelledby="tab-7-QVBJ" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-7-QVBJ" name="QVBJ" role="tabpanel" tabindex="0"><p>To delete a network forward, send a DELETE request to the <code class="docutils literal notranslate"><span class="pre">/1.0/networks/{networkName}/forwards/{listenAddress}</span></code> endpoint:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">DELETE</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="p">{</span><span class="n">networkName</span><span class="p">}</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="p">{</span><span class="n">listenAddress</span><span class="p">}</span>
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">lxc</span> <span class="n">query</span> <span class="o">--</span><span class="n">request</span> <span class="n">DELETE</span> <span class="o">/</span><span class="mf">1.0</span><span class="o">/</span><span class="n">networks</span><span class="o">/</span><span class="n">ovn1</span><span class="o">/</span><span class="n">forwards</span><span class="o">/</span><span class="mf">192.0.2.21</span>
</pre></div>
</div>
<p>See <a class="reference external" href="/api/#/network-forwards/network_forward_delete">the API reference</a> for more information.</p>
</div><div aria-labelledby="tab-7-VUk=" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-7-VUk=" name="VUk=" role="tabpanel" tabindex="0"><p>In <a class="reference internal" href="../access_ui/#access-ui"><span class="std std-ref">the web UI</span></a>, select <span class="guilabel">Networks</span> in the left sidebar, then select the desired network. On the resulting screen, view the <span class="guilabel">Forwards</span> tab. This tab shows you information about all forwards on the network. Click the <span class="guilabel">Delete</span> icon next to a forward to delete it:</p>
<figure class="align-default">
<a class="reference internal image-reference" href="../../_images/forward_delete.png"><img alt="Delete a forward on a network" src="../../_images/forward_delete.png" style="width: 95%;" />
</a>
</figure>
</div></div>
</section>
</section>

        </article>
      </div>
      <footer>
        
   

<div class="related-pages">
  
  
      
  
  
  <a class="next-page" href="../network_zones/">
        <div class="page-info">
          <div class="context">
            <span>Next</span>
          </div>
          <div class="title">How to configure network zones</div>
        </div>
        <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
      </a>
    <a class="prev-page" href="../network_acls/">
        <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
        <div class="page-info">
          <div class="context">
            <span>Previous</span>
          </div>
          
            <div class="title">How to configure network ACLs</div>
          
        </div>
      </a>
</div>
<div class="bottom-of-page">
  <div class="left-details">
    <div class="copyright">
        &copy; 2014-2026 AGPL-3.0, LXD contributors 
    </div><div class="last-updated">
      Last updated on Feb 13, 2026</div>
  </div>
  <div class="right-details">
    
      <a href="" class="js-revoke-cookie-manager muted-link">Manage your tracker settings</a>
</div>

      </footer>
    </div>
    <aside class="toc-drawer">
      
<div class="toc-sticky toc-scroll">
   
    <div class="toc-title-container">
      <span class="toc-title">
       Contents
      </span>
    </div>
    <div class="toc-tree-container">
      <div class="toc-tree">
        <ul>
<li><a class="reference internal" href="#">How to configure network forwards</a><ul>
<li><a class="reference internal" href="#list-network-forwards">List network forwards</a></li>
<li><a class="reference internal" href="#show-a-network-forward">Show a network forward</a></li>
<li><a class="reference internal" href="#create-a-network-forward">Create a network forward</a><ul>
<li><a class="reference internal" href="#requirements-for-listen-addresses">Requirements for listen addresses</a></li>
<li><a class="reference internal" href="#create-a-forward-in-an-ovn-network">Create a forward in an OVN network</a></li>
<li><a class="reference internal" href="#create-a-forward-in-a-bridge-network">Create a forward in a bridge network</a></li>
<li><a class="reference internal" href="#forward-properties">Forward properties</a></li>
</ul>
</li>
<li><a class="reference internal" href="#configure-ports">Configure ports</a><ul>
<li><a class="reference internal" href="#port-properties">Port properties</a></li>
</ul>
</li>
<li><a class="reference internal" href="#edit-a-network-forward">Edit a network forward</a></li>
<li><a class="reference internal" href="#delete-a-network-forward">Delete a network forward</a></li>
</ul>
</li>
</ul>

      </div>
    </div>
   
    
    <div class="relatedlinks-title-container">
      <span class="relatedlinks-title">
       Related links
      </span>
    </div>
    <div class="relatedlinks-container">
      <div class="relatedlinks">
        
          <ul><li><a href="https://discuss.linuxcontainers.org/t/11801" target="_blank">Floating&#32;IP&#32;addresses</a></li></ul>
        
        
      </div>
    </div>
    
  </div>

    </aside>
  </div>
</div><script src="../../_static/jquery.js?v=5d32c60e"></script>
    <script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
    <script src="../../_static/documentation_options.js?v=a5603611"></script>
    <script src="../../_static/doctools.js?v=9a2dae69"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../../_static/scripts/furo.js?v=46bd48cc"></script>
    <script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
    <script src="../../_static/copybutton.js?v=b01cb6f2"></script>
    <script src="../../_static/config-options.js"></script>
    <script src="../../_static/design-tabs.js?v=f930bc37"></script>
    <script src="../../_static/tabs.js?v=3030b3cb"></script>
    <script src="../../_static/js/bundle.js?v=a4d88309"></script>
    <script src="../../_static/header-nav.js?v=e117ad08"></script>
    <script src="../../_static/github_issue_links.js?v=32bb732f"></script>
    
<script>
  const github_url = "https://github.com/canonical/lxd";
</script>
</body>
</html>