| Current Path : /snap/lxd/current/share/lxd-documentation/reference/devices_nic/ |
| Current File : //snap/lxd/current/share/lxd-documentation/reference/devices_nic/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="Type: nic" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/reference/devices_nic/" />
<meta property="og:site_name" content="LXD documentation" />
<meta property="og:description" content="Network devices, also referred to as Network Interface Controllers or NICs, supply a connection to a network. LXD supports several different types of network devices ( NIC types). nictype vs. netwo..." />
<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 devices, also referred to as Network Interface Controllers or NICs, supply a connection to a network. LXD supports several different types of network devices ( NIC types). nictype vs. netwo..." />
<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="Type: disk" href="../devices_disk/"><link rel="prev" title="Type: none" href="../devices_none/">
<link rel="canonical" href="/reference/devices_nic/">
<link rel="shortcut icon" href="../../_static/favicon.ico"><!-- Generated with Sphinx 7.4.7 and Furo 2025.12.19 -->
<title>Type: nic - 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/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 has-children"><a class="reference internal" href="../../howto/">How-to guides</a><input aria-label="Toggle navigation of How-to guides" 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>
<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="../../howto/initialize/">Initialize LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/access_ui/">Access the UI</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/server_expose/">Expose LXD to the network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/server_configure/">Configure the LXD server</a></li>
<li class="toctree-l3 has-children"><a class="reference internal" href="../../howto/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="../../howto/oidc_auth0/">How to configure Auth0</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../howto/oidc_ory/">How to configure Ory Hydra</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../howto/oidc_keycloak/">How to configure Keycloak</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../howto/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="../../howto/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="../../howto/instances_create/">Create instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_configure/">Configure instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/instances_troubleshoot/">Troubleshoot errors</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_ubuntu_pro_attach/">Auto attach Ubuntu Pro</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_access_files/">Access files</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/instances_routed_nic_vm/">Add a routed NIC to a VM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_backup/">Back up instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_migrate/">Migrate instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/import_machines_to_instances/">Import existing machines</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/images_remote/">Use remote images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/images_manage/">Manage images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/images_profiles/">Associate profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/images_copy/">Copy and import images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/projects_create/">Create and configure</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/projects_work/">Work with projects</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/storage_pools/">Manage pools</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_volumes/">Manage volumes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_buckets/">Manage buckets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_create_instance/">Create an instance in a pool</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_backup_volume/">Back up a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_move_volume/">Move or copy a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/storage_csi/">Use the LXD CSI driver with Kubernetes</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../networks/">Networking</a><input aria-label="Toggle navigation of Networking" 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>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_create/">Create a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_configure/">Configure a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_bgp/">Configure as BGP server</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_acls/">Configure network ACLs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_forwards/">Configure forwards</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_zones/">Configure network zones</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_bridge_resolved/">Integrate with resolved</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_ovn_setup/">Set up OVN</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_load_balancers/">Configure load balancers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/network_ovn_peers/">Configure peer routing</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/cluster_form/">Form a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_manage/">Manage a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_config_networks/">Configure networks</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_config_storage/">Configure storage</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_manage_instance/">Manage instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_groups/">Set up cluster groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_placement_groups/">Use placement groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/cluster_recover/">Recover a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/benchmark_performance/">Benchmark performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/logs_loki/">Send logs to Loki</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/disaster_recovery/">Recover instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/disaster_recovery_replication/">Disaster recovery with storage replication</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../howto/snap/">Manage the snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../howto/security_harden/">Harden security</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../howto/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="../../howto/network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/instances_troubleshoot/">Troubleshoot instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../howto/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="../../howto/auth_bearer/">How to authenticate to the LXD API using bearer tokens</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../howto/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 current has-children"><a class="reference internal" href="../">Reference</a><input aria-label="Toggle navigation of Reference" checked="" 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 class="current">
<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="../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="../release-notes/release-notes-6.7/">LXD 6.7</a></li>
<li class="toctree-l3"><a class="reference internal" href="../release-notes/release-notes-6.6/">LXD 6.6</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../releases-snap/">Releases and snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../remote_image_servers/">Remote image servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../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 current has-children"><a class="reference internal" href="../../explanation/instance_config/">Instance configuration</a><input aria-label="Toggle navigation of Instance configuration" checked="" 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 class="current">
<li class="toctree-l3"><a class="reference internal" href="../instance_properties/">Instance properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instance_options/">Instance options</a></li>
<li class="toctree-l3 current has-children"><a class="reference internal" href="../devices/">Devices</a><input aria-label="Toggle navigation of Devices" checked="" 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 class="current">
<li class="toctree-l4"><a class="reference internal" href="../standard_devices/">Standard devices</a></li>
<li class="toctree-l4"><a class="reference internal" href="../devices_none/">Type: <code class="docutils literal notranslate"><span class="pre">none</span></code></a></li>
<li class="toctree-l4 current current-page"><a class="current reference internal" href="#">Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../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="../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="../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="../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="../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="../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="../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="../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="../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="../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="../instance_units/">Units for storage and network limits</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../preseed_yaml_fields/">Preseed YAML file fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="../projects/">Project configuration</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../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="../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="../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="../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="../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="../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="../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="../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="../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="../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="../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="../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="../network_bridge/">Bridge network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ovn/">OVN network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_macvlan/">Macvlan network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_physical/">Physical network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_sriov/">SR-IOV network</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../cluster_member_config/">Cluster configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../placement_groups/">Placement group configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../server_settings/">Production server settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="../provided_metrics/">Provided metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../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="../driver_csi/">LXD CSI driver reference</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../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="../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="../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="../ovn-internals/">OVN implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../vm_live_migration_internals/">VM live migration implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../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/reference/devices_nic.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="type-nic">
<span id="devices-nic"></span><h1>Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code><a class="headerlink" href="#type-nic" title="Link to this heading">¶</a></h1>
<p class="youtube_link">
<a href="https://www.youtube.com/watch?v=W62eno28KMY" target="_blank">
<span title="LXD NIC devices" class="play_icon">▶</span>
<span title="LXD NIC devices">Watch on YouTube</span>
</a>
</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <code class="docutils literal notranslate"><span class="pre">nic</span></code> device type is supported for both containers and VMs.</p>
<p>NICs support hotplugging for both containers and VMs (with the exception of the <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> NIC type).</p>
</div>
<p>Network devices, also referred to as <em>Network Interface Controllers</em> or <em>NICs</em>, supply a connection to a network.
LXD supports several different types of network devices (<em>NIC types</em>).</p>
<section id="nictype-vs-network">
<h2><code class="docutils literal notranslate"><span class="pre">nictype</span></code> vs. <code class="docutils literal notranslate"><span class="pre">network</span></code><a class="headerlink" href="#nictype-vs-network" title="Link to this heading">¶</a></h2>
<p>When adding a network device to an instance, there are two methods to specify the type of device that you want to add: through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> device option or the <code class="docutils literal notranslate"><span class="pre">network</span></code> device option.</p>
<p>These two device options are mutually exclusive, and you can specify only one of them when you create a device.
However, note that when you specify the <code class="docutils literal notranslate"><span class="pre">network</span></code> option, the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option is derived automatically from the network type.</p>
<dl class="simple myst">
<dt><code class="docutils literal notranslate"><span class="pre">nictype</span></code></dt><dd><p>When using the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> device option, you can specify a network interface that is not controlled by LXD.
Therefore, you must specify all information that LXD needs to use the network interface.</p>
<p>When using this method, the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option must be specified when creating the device, and it cannot be changed later.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">network</span></code></dt><dd><p>When using the <code class="docutils literal notranslate"><span class="pre">network</span></code> device option, the NIC is linked to an existing <a class="reference internal" href="../../explanation/networks/#managed-networks"><span class="std std-ref">managed network</span></a>.
In this case, LXD has all required information about the network, and you need to specify only the network name when adding the device.</p>
<p>When using this method, LXD derives the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option automatically.
The value is read-only and cannot be changed.</p>
<p>Other device options that are inherited from the network are marked with a “yes” in the “Managed” field of the NIC-specific device options.
You cannot customize these options directly for the NIC if you’re using the <code class="docutils literal notranslate"><span class="pre">network</span></code> method.</p>
</dd>
</dl>
<p>See <a class="reference internal" href="../../explanation/networks/#networks"><span class="std std-ref">Networking setups</span></a> for more information.</p>
</section>
<section id="available-nic-types">
<h2>Available NIC types<a class="headerlink" href="#available-nic-types" title="Link to this heading">¶</a></h2>
<p>The following NICs can be added using the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> or <code class="docutils literal notranslate"><span class="pre">network</span></code> options:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#nic-bridged"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">bridged</span></code></span></a>: Uses an existing bridge on the host and creates a virtual device pair to connect the host bridge to the instance.</p></li>
<li><p><a class="reference internal" href="#nic-macvlan"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">macvlan</span></code></span></a>: Sets up a new network device based on an existing one, but using a different MAC address.</p></li>
<li><p><a class="reference internal" href="#nic-sriov"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">sriov</span></code></span></a>: Passes a virtual function of an SR-IOV-enabled physical network device into the instance.</p></li>
<li><p><a class="reference internal" href="#nic-physical"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">physical</span></code></span></a>: Passes a physical device from the host through to the instance.
The targeted device will vanish from the host and appear in the instance.</p></li>
</ul>
<p>The following NICs can be added using only the <code class="docutils literal notranslate"><span class="pre">network</span></code> option:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#nic-ovn"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">ovn</span></code></span></a>: Uses an existing OVN network and creates a virtual device pair to connect the instance to it.</p></li>
</ul>
<p>The following NICs can be added using only the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option:</p>
<ul class="simple">
<li><p><a class="reference internal" href="#nic-ipvlan"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">ipvlan</span></code></span></a>: Sets up a new network device based on an existing one, using the same MAC address but a different IP.</p></li>
<li><p><a class="reference internal" href="#nic-p2p"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">p2p</span></code></span></a>: Creates a virtual device pair, putting one side in the instance and leaving the other side on the host.</p></li>
<li><p><a class="reference internal" href="#nic-routed"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">routed</span></code></span></a>: Creates a virtual device pair to connect the host to the instance and sets up static routes and proxy ARP/NDP entries to allow the instance to join the network of a designated parent interface.</p></li>
</ul>
<p>The available device options depend on the NIC type and are listed in the following sections.</p>
<section id="nictype-bridged">
<span id="nic-bridged"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">bridged</span></code><a class="headerlink" href="#nictype-bridged" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option or the <code class="docutils literal notranslate"><span class="pre">network</span></code> option (see <a class="reference internal" href="../network_bridge/#network-bridge"><span class="std std-ref">Bridge network</span></a> for information about the managed <code class="docutils literal notranslate"><span class="pre">bridge</span></code> network).</p>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">bridged</span></code> NIC uses an existing bridge on the host and creates a virtual device pair to connect the host bridge to the instance.</p>
<section id="device-options">
<h4>Device options<a class="headerlink" href="#device-options" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">bridged</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:host_name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">host_name</span></code></span><span class="shortdesc"><p>Name of the interface inside the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:host_name"><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">host_name</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv4.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code></span><span class="shortdesc"><p>IPv4 address to assign to the instance through DHCP</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv4.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">ipv4.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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">none</span></code> to restrict all IPv4 traffic when <a class="configref reference internal" href="#device-nic-bridged-device-conf:security.ipv4_filtering"><code class="docutils literal notranslate"><span class="pre">security.ipv4_filtering</span></code></a> is set.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv4.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes</span></code></span><span class="shortdesc"><p>IPv4 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv4.routes"><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">ipv4.routes</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes for this NIC to add on the host.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv4.routes.external">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes.external</span></code></span><span class="shortdesc"><p>IPv4 static routes to route to NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv4.routes.external"><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">ipv4.routes.external</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes to route to the NIC and publish on the uplink network (BGP).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv6.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code></span><span class="shortdesc"><p>IPv6 address to assign to the instance through DHCP</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv6.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">ipv6.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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">none</span></code> to restrict all IPv6 traffic when <a class="configref reference internal" href="#device-nic-bridged-device-conf:security.ipv6_filtering"><code class="docutils literal notranslate"><span class="pre">security.ipv6_filtering</span></code></a> is set.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv6.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes</span></code></span><span class="shortdesc"><p>IPv6 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv6.routes"><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">ipv6.routes</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes for this NIC to add on the host.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:ipv6.routes.external">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes.external</span></code></span><span class="shortdesc"><p>IPv6 static routes to route to NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:ipv6.routes.external"><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">ipv6.routes.external</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes to route to the NIC and publish on the uplink network (BGP).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:limits.egress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></span><span class="shortdesc"><p>I/O limit for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:limits.egress"><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">limits.egress</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:limits.ingress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></span><span class="shortdesc"><p>I/O limit for incoming traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:limits.ingress"><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">limits.ingress</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:limits.max">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.max</span></code></span><span class="shortdesc"><p>I/O limit for both incoming and outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:limits.max"><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">limits.max</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option is the same as setting both <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.ingress"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></a> and <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.egress"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></a>.</p>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:limits.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.priority</span></code></span><span class="shortdesc"><p><code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:limits.priority"><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">limits.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic is used by the kernel queuing discipline (qdisc) to prioritize network packets.
Specify the value as a 32-bit unsigned integer.</p>
<p>The effect of this value depends on the particular qdisc implementation, for example, <code class="docutils literal notranslate"><span class="pre">SKBPRIO</span></code> or <code class="docutils literal notranslate"><span class="pre">QFQ</span></code>.
Consult the kernel qdisc documentation before setting this value.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:maas.subnet.ipv4">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv4</span></code></span><span class="shortdesc"><p>MAAS IPv4 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:maas.subnet.ipv4"><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">maas.subnet.ipv4</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:maas.subnet.ipv6">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv6</span></code></span><span class="shortdesc"><p>MAAS IPv6 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:maas.subnet.ipv6"><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">maas.subnet.ipv6</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>parent MTU</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:network">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">network</span></code></span><span class="shortdesc"><p>Managed network to link the device to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:network"><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">network</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>You can specify this option instead of specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:parent"><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">parent</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>if specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:queue.tx.length">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">queue.tx.length</span></code></span><span class="shortdesc"><p>Transmit queue length for the NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:queue.tx.length"><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">queue.tx.length</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:security.ipv4_filtering">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.ipv4_filtering</span></code></span><span class="shortdesc"><p>Whether to prevent the instance from spoofing an IPv4 address</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:security.ipv4_filtering"><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">security.ipv4_filtering</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">true</span></code> to prevent the instance from spoofing another instance’s IPv4 address.
This option enables <a class="configref reference internal" href="#device-nic-bridged-device-conf:security.mac_filtering"><code class="docutils literal notranslate"><span class="pre">security.mac_filtering</span></code></a>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:security.ipv6_filtering">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.ipv6_filtering</span></code></span><span class="shortdesc"><p>Whether to prevent the instance from spoofing an IPv6 address</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:security.ipv6_filtering"><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">security.ipv6_filtering</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">true</span></code> to prevent the instance from spoofing another instance’s IPv6 address.
This option enables <a class="configref reference internal" href="#device-nic-bridged-device-conf:security.mac_filtering"><code class="docutils literal notranslate"><span class="pre">security.mac_filtering</span></code></a>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:security.mac_filtering">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.mac_filtering</span></code></span><span class="shortdesc"><p>Whether to prevent the instance from spoofing a MAC address</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:security.mac_filtering"><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">security.mac_filtering</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">true</span></code> to prevent the instance from spoofing another instance’s MAC address.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:security.port_isolation">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.port_isolation</span></code></span><span class="shortdesc"><p>Whether to respect port isolation</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:security.port_isolation"><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">security.port_isolation</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">true</span></code> to prevent the NIC from communicating with other NICs in the network that have port isolation enabled.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to use for non-tagged traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">none</span></code> to remove the port from the default VLAN.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-bridged-device-conf:vlan.tagged">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan.tagged</span></code></span><span class="shortdesc"><p>VLAN IDs or VLAN ranges to join for tagged traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-bridged-device-conf:vlan.tagged"><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">vlan.tagged</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the VLAN IDs or ranges as a comma-delimited list.</p>
</div>
</div>
</section>
<section id="configuration-examples">
<h4>Configuration examples<a class="headerlink" href="#configuration-examples" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">bridged</span></code> network device to an instance, connecting to a LXD managed network:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc network create <network_name> --type=bridge
lxc config device add <instance_name> <device_name> nic network=<network_name>
</pre></div>
</div>
<p>Note that <code class="docutils literal notranslate"><span class="pre">bridge</span></code> is the type when creating a managed bridge network, while the device <code class="docutils literal notranslate"><span class="pre">nictype</span></code> that is required when connecting to an unmanaged bridge is <code class="docutils literal notranslate"><span class="pre">bridged</span></code>.</p>
<p>Add a <code class="docutils literal notranslate"><span class="pre">bridged</span></code> network device to an instance, connecting to an existing bridge interface with <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=bridged parent=<existing_bridge>
</pre></div>
</div>
<p>See <a class="reference internal" href="../../howto/network_create/#network-create"><span class="std std-ref">How to create a network</span></a> and <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-macvlan">
<span id="nic-macvlan"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">macvlan</span></code><a class="headerlink" href="#nictype-macvlan" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option or the <code class="docutils literal notranslate"><span class="pre">network</span></code> option (see <a class="reference internal" href="../network_macvlan/#network-macvlan"><span class="std std-ref">Macvlan network</span></a> for information about the managed <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> network).</p>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> NIC sets up a new network device based on an existing one, but using a different MAC address.</p>
<p>If you are using a <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> NIC, communication between the LXD host and the instances is not possible.
Both the host and the instances can talk to the gateway, but they cannot communicate directly.</p>
<section id="id1">
<h4>Device options<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:gvrp">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">gvrp</span></code></span><span class="shortdesc"><p>Whether to use GARP VLAN Registration Protocol</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:gvrp"><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">gvrp</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option specifies whether to register the VLAN using the GARP VLAN Registration Protocol.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:maas.subnet.ipv4">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv4</span></code></span><span class="shortdesc"><p>MAAS IPv4 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:maas.subnet.ipv4"><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">maas.subnet.ipv4</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:maas.subnet.ipv6">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv6</span></code></span><span class="shortdesc"><p>MAAS IPv6 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:maas.subnet.ipv6"><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">maas.subnet.ipv6</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>parent MTU</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:network">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">network</span></code></span><span class="shortdesc"><p>Managed network to link the device to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:network"><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">network</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>You can specify this option instead of specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:parent"><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">parent</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>if specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-macvlan-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to attach to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-macvlan-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id2">
<h4>Configuration examples<a class="headerlink" href="#id2" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> network device to an instance, connecting to a LXD managed network:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc network create <network_name> --type=macvlan parent=<existing_NIC>
lxc config device add <instance_name> <device_name> nic network=<network_name>
</pre></div>
</div>
<p>Add a <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> network device to an instance, connecting to an existing network interface with <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=macvlan parent=<existing_NIC>
</pre></div>
</div>
<p>See <a class="reference internal" href="../../howto/network_create/#network-create"><span class="std std-ref">How to create a network</span></a> and <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-sriov">
<span id="nic-sriov"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">sriov</span></code><a class="headerlink" href="#nictype-sriov" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option or the <code class="docutils literal notranslate"><span class="pre">network</span></code> option (see <a class="reference internal" href="../network_sriov/#network-sriov"><span class="std std-ref">SR-IOV network</span></a> for information about the managed <code class="docutils literal notranslate"><span class="pre">sriov</span></code> network).</p>
</div>
<p>An <code class="docutils literal notranslate"><span class="pre">sriov</span></code> NIC passes a virtual function of an SR-IOV-enabled physical network device into the instance.</p>
<p>An SR-IOV-enabled network device associates a set of virtual functions (VFs) with the single physical function (PF) of the network device.
PFs are standard PCIe functions.
VFs, on the other hand, are very lightweight PCIe functions that are optimized for data movement.
They come with a limited set of configuration capabilities to prevent changing properties of the PF.</p>
<p>Given that VFs appear as regular PCIe devices to the system, they can be passed to instances just like a regular physical device.</p>
<dl class="simple myst">
<dt>VF allocation</dt><dd><p>The <code class="docutils literal notranslate"><span class="pre">sriov</span></code> interface type expects to be passed the name of an SR-IOV enabled network device on the system via the <code class="docutils literal notranslate"><span class="pre">parent</span></code> property.
LXD then checks for any available VFs on the system.</p>
<p>By default, LXD allocates the first free VF it finds.
If it detects that either none are enabled or all currently enabled VFs are in use, it bumps the number of supported VFs to the maximum value and uses the first free VF.
If all possible VFs are in use or the kernel or card doesn’t support incrementing the number of VFs, LXD returns an error.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you need LXD to use a specific VF, use a <code class="docutils literal notranslate"><span class="pre">physical</span></code> NIC instead of a <code class="docutils literal notranslate"><span class="pre">sriov</span></code> NIC and set its <code class="docutils literal notranslate"><span class="pre">parent</span></code> option to the VF name.</p>
</div>
</dd>
</dl>
<section id="id3">
<h4>Device options<a class="headerlink" href="#id3" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">sriov</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:maas.subnet.ipv4">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv4</span></code></span><span class="shortdesc"><p>MAAS IPv4 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:maas.subnet.ipv4"><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">maas.subnet.ipv4</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:maas.subnet.ipv6">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv6</span></code></span><span class="shortdesc"><p>MAAS IPv6 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:maas.subnet.ipv6"><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">maas.subnet.ipv6</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:network">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">network</span></code></span><span class="shortdesc"><p>Managed network to link the device to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:network"><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">network</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>You can specify this option instead of specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:parent"><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">parent</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>if specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:security.mac_filtering">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.mac_filtering</span></code></span><span class="shortdesc"><p>Whether to prevent the instance from spoofing a MAC address</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:security.mac_filtering"><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">security.mac_filtering</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Set this option to <code class="docutils literal notranslate"><span class="pre">true</span></code> to prevent the instance from spoofing another instance’s MAC address.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-sriov-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to attach to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-sriov-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id4">
<h4>Configuration examples<a class="headerlink" href="#id4" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">sriov</span></code> network device to an instance, connecting to a LXD managed network:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc network create <network_name> --type=sriov parent=<sriov_enabled_NIC>
lxc config device add <instance_name> <device_name> nic network=<network_name>
</pre></div>
</div>
<p>Add a <code class="docutils literal notranslate"><span class="pre">sriov</span></code> network device to an instance, connecting to an existing SR-IOV-enabled interface with <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=sriov parent=<sriov_enabled_NIC>
</pre></div>
</div>
<p>See <a class="reference internal" href="../../howto/network_create/#network-create"><span class="std std-ref">How to create a network</span></a> and <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-physical">
<span id="nic-physical"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">physical</span></code><a class="headerlink" href="#nictype-physical" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>You can select this NIC type through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option or the <code class="docutils literal notranslate"><span class="pre">network</span></code> option (see <a class="reference internal" href="../network_physical/#network-physical"><span class="std std-ref">Physical network</span></a> for information about the managed <code class="docutils literal notranslate"><span class="pre">physical</span></code> network).</p></li>
<li><p>You can have only one <code class="docutils literal notranslate"><span class="pre">physical</span></code> NIC for each parent device.</p></li>
</ul>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">physical</span></code> NIC provides straight physical device pass-through from the host.
The targeted device will vanish from the host and appear in the instance (which means that you can have only one <code class="docutils literal notranslate"><span class="pre">physical</span></code> NIC for each targeted device).</p>
<section id="id5">
<h4>Device options<a class="headerlink" href="#id5" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">physical</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-physical-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:gvrp">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">gvrp</span></code></span><span class="shortdesc"><p>Whether to use GARP VLAN Registration Protocol</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:gvrp"><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">gvrp</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option specifies whether to register the VLAN using the GARP VLAN Registration Protocol.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:hwaddr"><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">hwaddr</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>parent MAC address</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Condition: </strong></td>
<td><span class="ignoreP"><p>container</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:maas.subnet.ipv4">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv4</span></code></span><span class="shortdesc"><p>MAAS IPv4 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:maas.subnet.ipv4"><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">maas.subnet.ipv4</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:maas.subnet.ipv6">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv6</span></code></span><span class="shortdesc"><p>MAAS IPv6 subnet to register the instance in</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:maas.subnet.ipv6"><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">maas.subnet.ipv6</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>parent MTU</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Condition: </strong></td>
<td><span class="ignoreP"><p>container</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:network">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">network</span></code></span><span class="shortdesc"><p>Managed network to link the device to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:network"><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">network</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>You can specify this option instead of specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:parent"><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">parent</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Required: </strong></td>
<td><span class="ignoreP"><p>if specifying the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> directly</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-physical-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to attach to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-physical-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Condition: </strong></td>
<td><span class="ignoreP"><p>container</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id6">
<h4>Configuration examples<a class="headerlink" href="#id6" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">physical</span></code> network device to an instance, connecting to an existing physical network interface with <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=physical parent=<physical_NIC>
</pre></div>
</div>
<p>Adding a <code class="docutils literal notranslate"><span class="pre">physical</span></code> network device to an instance using a managed network is not possible, because the <code class="docutils literal notranslate"><span class="pre">physical</span></code> managed network type is intended to be used only with OVN networks.</p>
<p>See <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-ovn">
<span id="nic-ovn"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">ovn</span></code><a class="headerlink" href="#nictype-ovn" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type only through the <code class="docutils literal notranslate"><span class="pre">network</span></code> option (see <a class="reference internal" href="../network_ovn/#network-ovn"><span class="std std-ref">OVN network</span></a> for information about the managed <code class="docutils literal notranslate"><span class="pre">ovn</span></code> network).</p>
</div>
<p>An <code class="docutils literal notranslate"><span class="pre">ovn</span></code> NIC uses an existing OVN network and creates a virtual device pair to connect the instance to it.</p>
<dl class="simple myst" id="devices-nic-hw-acceleration">
<dt>SR-IOV hardware acceleration</dt><dd><p>To use <code class="docutils literal notranslate"><span class="pre">acceleration=sriov</span></code>, you must have a compatible SR-IOV physical NIC that supports the Ethernet switch device driver model (<code class="docutils literal notranslate"><span class="pre">switchdev</span></code>) in your LXD host.
LXD assumes that the physical NIC (PF) is configured in <code class="docutils literal notranslate"><span class="pre">switchdev</span></code> mode and connected to the OVN integration OVS bridge, and that it has one or more virtual functions (VFs) active.</p>
<p>To achieve this, follow these basic prerequisite setup steps:</p>
<ol class="arabic">
<li><p>Set up PF and VF:</p>
<ol class="arabic simple">
<li><p>Activate some VFs on PF (called <code class="docutils literal notranslate"><span class="pre">enp9s0f0np0</span></code> in the following example, with a PCI address of <code class="docutils literal notranslate"><span class="pre">0000:09:00.0</span></code>) and unbind them.</p></li>
<li><p>Enable <code class="docutils literal notranslate"><span class="pre">switchdev</span></code> mode and <code class="docutils literal notranslate"><span class="pre">hw-tc-offload</span></code> on the PF.</p></li>
<li><p>Rebind the VFs.</p></li>
</ol>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>echo 4 > /sys/bus/pci/devices/0000:09:00.0/sriov_numvfs
for i in $(lspci -nnn | grep "Virtual Function" | cut -d' ' -f1); do echo 0000:$i > /sys/bus/pci/drivers/mlx5_core/unbind; done
devlink dev eswitch set pci/0000:09:00.0 mode switchdev
ethtool -K enp9s0f0np0 hw-tc-offload on
for i in $(lspci -nnn | grep "Virtual Function" | cut -d' ' -f1); do echo 0000:$i > /sys/bus/pci/drivers/mlx5_core/bind; done
</pre></div>
</div>
</li>
<li><p>Set up OVS by enabling hardware offload and adding the PF NIC to the integration bridge (normally called <code class="docutils literal notranslate"><span class="pre">br-int</span></code>):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ovs</span><span class="o">-</span><span class="n">vsctl</span> <span class="nb">set</span> <span class="n">open_vswitch</span> <span class="o">.</span> <span class="n">other_config</span><span class="p">:</span><span class="n">hw</span><span class="o">-</span><span class="n">offload</span><span class="o">=</span><span class="n">true</span>
<span class="n">systemctl</span> <span class="n">restart</span> <span class="n">openvswitch</span><span class="o">-</span><span class="n">switch</span>
<span class="n">ovs</span><span class="o">-</span><span class="n">vsctl</span> <span class="n">add</span><span class="o">-</span><span class="n">port</span> <span class="n">br</span><span class="o">-</span><span class="nb">int</span> <span class="n">enp9s0f0np0</span>
<span class="n">ip</span> <span class="n">link</span> <span class="nb">set</span> <span class="n">enp9s0f0np0</span> <span class="n">up</span>
</pre></div>
</div>
</li>
</ol>
</dd>
<dt>VDPA hardware acceleration</dt><dd><p>To use <code class="docutils literal notranslate"><span class="pre">acceleration=vdpa</span></code>, you must have a compatible VDPA physical NIC.
The setup is the same as for SR-IOV hardware acceleration, except that you must also enable the <code class="docutils literal notranslate"><span class="pre">vhost_vdpa</span></code> module and check that you have some available VDPA management devices :</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">modprobe</span> <span class="n">vhost_vdpa</span> <span class="o">&&</span> <span class="n">vdpa</span> <span class="n">mgmtdev</span> <span class="n">show</span>
</pre></div>
</div>
</dd>
</dl>
<section id="id7">
<h4>Device options<a class="headerlink" href="#id7" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">ovn</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:acceleration">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">acceleration</span></code></span><span class="shortdesc"><p>Enable hardware acceleration</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:acceleration"><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">acceleration</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><code class="docutils literal notranslate"><span class="pre">none</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Possible values are <code class="docutils literal notranslate"><span class="pre">none</span></code>, <code class="docutils literal notranslate"><span class="pre">sriov</span></code>, or <code class="docutils literal notranslate"><span class="pre">vdpa</span></code>.
See <a class="reference internal" href="#devices-nic-hw-acceleration"><span class="std std-ref">SR-IOV hardware acceleration</span></a> for more information.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:acceleration.parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">acceleration.parent</span></code></span><span class="shortdesc"><p>Physical function interfaces to allocate virtual functions from for hardware acceleration</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:acceleration.parent"><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">acceleration.parent</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Comma separated list of physical function (PF) interfaces to allocate virtual functions (VFs) from for hardware acceleration when <a class="configref reference internal" href="#device-nic-ovn-device-conf:acceleration"><code class="docutils literal notranslate"><span class="pre">acceleration</span></code></a> is enabled.
In <a class="configref reference internal" href="../projects/#project-restricted:restricted"><code class="docutils literal notranslate"><span class="pre">restricted</span></code></a> projects, it can only be used when <a class="configref reference internal" href="../projects/#project-restricted:restricted.virtual-machines.lowlevel"><code class="docutils literal notranslate"><span class="pre">restricted.virtual-machines.lowlevel</span></code></a> or <a class="configref reference internal" href="../projects/#project-restricted:restricted.containers.lowlevel"><code class="docutils literal notranslate"><span class="pre">restricted.containers.lowlevel</span></code></a> is set to <code class="docutils literal notranslate"><span class="pre">allow</span></code>.
If this is not specified, and <a class="configref reference internal" href="#device-nic-ovn-device-conf:acceleration"><code class="docutils literal notranslate"><span class="pre">acceleration</span></code></a> is enabled then all PFs connected to the OVS integration bridge are scanned for a free VF.
See <a class="reference internal" href="#devices-nic-hw-acceleration"><span class="std std-ref">SR-IOV hardware acceleration</span></a> for more information.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:host_name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">host_name</span></code></span><span class="shortdesc"><p>Name of the interface inside the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:host_name"><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">host_name</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv4.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code></span><span class="shortdesc"><p>IPv4 address to assign to the instance through DHCP</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv4.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">ipv4.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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv4.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes</span></code></span><span class="shortdesc"><p>IPv4 static routes to route for the NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv4.routes"><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">ipv4.routes</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes to route for this NIC.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv4.routes.external">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes.external</span></code></span><span class="shortdesc"><p>IPv4 static routes to route to NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv4.routes.external"><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">ipv4.routes.external</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes to route to the NIC and publish on the uplink network.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv6.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code></span><span class="shortdesc"><p>IPv6 address to assign to the instance through DHCP</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv6.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">ipv6.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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv6.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes</span></code></span><span class="shortdesc"><p>IPv6 static routes to route to the NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv6.routes"><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">ipv6.routes</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes to route to the NIC.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:ipv6.routes.external">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes.external</span></code></span><span class="shortdesc"><p>IPv6 static routes to route to NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:ipv6.routes.external"><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">ipv6.routes.external</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes to route to the NIC and publish on the uplink network.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:nested">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">nested</span></code></span><span class="shortdesc"><p>Parent NIC name to nest this NIC under</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:nested"><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">nested</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>See also <a class="configref reference internal" href="#device-nic-ovn-device-conf:vlan"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></a>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:network">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">network</span></code></span><span class="shortdesc"><p>Managed network to link the device to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:network"><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">network</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>Managed: </strong></td>
<td><span class="ignoreP"><p>yes</p>
</span></td>
</tr>
<tr class="row-even"><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="device-nic-ovn-device-conf:security.acls">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.acls</span></code></span><span class="shortdesc"><p>Network ACLs to apply</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:security.acls"><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">security.acls</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>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-separated list</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:security.acls.default.egress.action">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.acls.default.egress.action</span></code></span><span class="shortdesc"><p>Default action to use for egress traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:security.acls.default.egress.action"><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">security.acls.default.egress.action</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><code class="docutils literal notranslate"><span class="pre">reject</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The specified action is used for all egress traffic that doesn’t match any ACL rule.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:security.acls.default.egress.logged">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.acls.default.egress.logged</span></code></span><span class="shortdesc"><p>Whether to log egress traffic that doesn’t match any ACL rule</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:security.acls.default.egress.logged"><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">security.acls.default.egress.logged</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:security.acls.default.ingress.action">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.acls.default.ingress.action</span></code></span><span class="shortdesc"><p>Default action to use for ingress traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:security.acls.default.ingress.action"><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">security.acls.default.ingress.action</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><code class="docutils literal notranslate"><span class="pre">reject</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The specified action is used for all ingress traffic that doesn’t match any ACL rule.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:security.acls.default.ingress.logged">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">security.acls.default.ingress.logged</span></code></span><span class="shortdesc"><p>Whether to log ingress traffic that doesn’t match any ACL rule</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:security.acls.default.ingress.logged"><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">security.acls.default.ingress.logged</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
<tr class="row-even"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ovn-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to use when nesting</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ovn-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Managed: </strong></td>
<td><span class="ignoreP"><p>no</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>See also <a class="configref reference internal" href="#device-nic-ovn-device-conf:nested"><code class="docutils literal notranslate"><span class="pre">nested</span></code></a>.</p>
</div>
</div>
</section>
<section id="id8">
<h4>Configuration examples<a class="headerlink" href="#id8" title="Link to this heading">¶</a></h4>
<p>An <code class="docutils literal notranslate"><span class="pre">ovn</span></code> network device must be added using a managed network.
To do so:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc network create <network_name> --type=ovn network=<parent_network>
lxc config device add <instance_name> <device_name> nic network=<network_name>
</pre></div>
</div>
<p>See <a class="reference internal" href="../../howto/network_ovn_setup/#network-ovn-setup"><span class="std std-ref">How to set up OVN with LXD</span></a> for full instructions, and <a class="reference internal" href="../../howto/network_create/#network-create"><span class="std std-ref">How to create a network</span></a> and <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-ipvlan">
<span id="nic-ipvlan"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code><a class="headerlink" href="#nictype-ipvlan" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>This NIC type is available only for containers, not for virtual machines.</p></li>
<li><p>You can select this NIC type only through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option.</p></li>
<li><p>This NIC type does not support hotplugging.</p></li>
</ul>
</div>
<p>An <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> NIC sets up a new network device based on an existing one, using the same MAC address but a different IP.</p>
<p>If you are using an <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> NIC, communication between the LXD host and the instances is not possible.
Both the host and the instances can talk to the gateway, but they cannot communicate directly.</p>
<p>LXD currently supports IPVLAN in L2 and L3S mode.
In this mode, the gateway is automatically set by LXD, but the IP addresses must be manually specified using the <code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code> and/or <code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code> options before the container is started.</p>
<dl class="simple myst">
<dt>DNS</dt><dd><p>The name servers must be configured inside the container, because they are not set automatically.
To do this, set the following <code class="docutils literal notranslate"><span class="pre">sysctls</span></code>:</p>
<ul>
<li><p>When using IPv4 addresses:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">net</span><span class="o">.</span><span class="n">ipv4</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">forwarding</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
</li>
<li><p>When using IPv6 addresses:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">forwarding</span><span class="o">=</span><span class="mi">1</span>
<span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">proxy_ndp</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
</li>
</ul>
</dd>
</dl>
<section id="id9">
<h4>Device options<a class="headerlink" href="#id9" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:gvrp">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">gvrp</span></code></span><span class="shortdesc"><p>Whether to use GARP VLAN Registration Protocol</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:gvrp"><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">gvrp</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option specifies whether to register the VLAN using the GARP VLAN Registration Protocol.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv4.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code></span><span class="shortdesc"><p>IPv4 static addresses to add to the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv4.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">ipv4.address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static addresses to add to the instance.
In <code class="docutils literal notranslate"><span class="pre">l2</span></code> mode, you can specify them as CIDR values or singular addresses using a subnet of <code class="docutils literal notranslate"><span class="pre">/24</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv4.gateway">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.gateway</span></code></span><span class="shortdesc"><p>IPv4 gateway</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv4.gateway"><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">ipv4.gateway</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><code class="docutils literal notranslate"><span class="pre">auto</span></code> (<code class="docutils literal notranslate"><span class="pre">l3s</span></code>), <code class="docutils literal notranslate"><span class="pre">-</span></code> (<code class="docutils literal notranslate"><span class="pre">l2</span></code>)</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>In <code class="docutils literal notranslate"><span class="pre">l3s</span></code> mode, the option specifies whether to add an automatic default IPv4 gateway.
Possible values are <code class="docutils literal notranslate"><span class="pre">auto</span></code> and <code class="docutils literal notranslate"><span class="pre">none</span></code>.</p>
<p>In <code class="docutils literal notranslate"><span class="pre">l2</span></code> mode, this option specifies the IPv4 address of the gateway.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv4.host_table">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.host_table</span></code></span><span class="shortdesc"><p>Custom policy routing table ID to add IPv4 static routes to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv4.host_table"><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">ipv4.host_table</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The custom policy routing table is in addition to the main routing table.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv6.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code></span><span class="shortdesc"><p>IPv6 static addresses to add to the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv6.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">ipv6.address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static addresses to add to the instance.
In <code class="docutils literal notranslate"><span class="pre">l2</span></code> mode, you can specify them as CIDR values or singular addresses using a subnet of <code class="docutils literal notranslate"><span class="pre">/64</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv6.gateway">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.gateway</span></code></span><span class="shortdesc"><p>IPv6 gateway</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv6.gateway"><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">ipv6.gateway</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><code class="docutils literal notranslate"><span class="pre">auto</span></code> (<code class="docutils literal notranslate"><span class="pre">l3s</span></code>), <code class="docutils literal notranslate"><span class="pre">-</span></code> (<code class="docutils literal notranslate"><span class="pre">l2</span></code>)</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>In <code class="docutils literal notranslate"><span class="pre">l3s</span></code> mode, the option specifies whether to add an automatic default IPv6 gateway.
Possible values are <code class="docutils literal notranslate"><span class="pre">auto</span></code> and <code class="docutils literal notranslate"><span class="pre">none</span></code>.</p>
<p>In <code class="docutils literal notranslate"><span class="pre">l2</span></code> mode, this option specifies the IPv6 address of the gateway.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:ipv6.host_table">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.host_table</span></code></span><span class="shortdesc"><p>Custom policy routing table ID to add IPv6 static routes to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:ipv6.host_table"><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">ipv6.host_table</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The custom policy routing table is in addition to the main routing table.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:mode">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mode</span></code></span><span class="shortdesc"><p>IPVLAN mode</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:mode"><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">mode</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><code class="docutils literal notranslate"><span class="pre">l3s</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Possible values are <code class="docutils literal notranslate"><span class="pre">l2</span></code> and <code class="docutils literal notranslate"><span class="pre">l3s</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>The MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>parent MTU</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-ipvlan-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:parent"><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">parent</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="device-nic-ipvlan-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to attach to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-ipvlan-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id10">
<h4>Configuration examples<a class="headerlink" href="#id10" title="Link to this heading">¶</a></h4>
<p>Add an <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> network device to an instance, connecting to an existing network interface with <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc stop <instance_name>
lxc config device add <instance_name> <device_name> nic nictype=ipvlan parent=<existing_NIC>
</pre></div>
</div>
<p>Adding an <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> network device to an instance using a managed network is not possible.</p>
<p>See <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-p2p">
<span id="nic-p2p"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">p2p</span></code><a class="headerlink" href="#nictype-p2p" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type only through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option.</p>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">p2p</span></code> NIC creates a virtual device pair, putting one side in the instance and leaving the other side on the host.</p>
<section id="id11">
<h4>Device options<a class="headerlink" href="#id11" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">p2p</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:boot.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">boot.priority</span></code></span><span class="shortdesc"><p>Boot priority for VMs</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:boot.priority"><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">boot.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>A higher value for this option means that the VM boots first.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:host_name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">host_name</span></code></span><span class="shortdesc"><p>Name of the interface inside the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:host_name"><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">host_name</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>randomly assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:ipv4.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes</span></code></span><span class="shortdesc"><p>IPv4 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:ipv4.routes"><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">ipv4.routes</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes for this NIC to add on the host.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:ipv6.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes</span></code></span><span class="shortdesc"><p>IPv6 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:ipv6.routes"><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">ipv6.routes</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes for this NIC to add on the host.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:limits.egress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></span><span class="shortdesc"><p>I/O limit for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:limits.egress"><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">limits.egress</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:limits.ingress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></span><span class="shortdesc"><p>I/O limit for incoming traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:limits.ingress"><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">limits.ingress</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:limits.max">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.max</span></code></span><span class="shortdesc"><p>I/O limit for both incoming and outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:limits.max"><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">limits.max</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option is the same as setting both <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.ingress"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></a> and <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.egress"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></a>.</p>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:limits.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.priority</span></code></span><span class="shortdesc"><p><code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:limits.priority"><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">limits.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic is used by the kernel queuing discipline (qdisc) to prioritize network packets.
Specify the value as a 32-bit unsigned integer.</p>
<p>The effect of this value depends on the particular qdisc implementation, for example, <code class="docutils literal notranslate"><span class="pre">SKBPRIO</span></code> or <code class="docutils literal notranslate"><span class="pre">QFQ</span></code>.
Consult the kernel qdisc documentation before setting this value.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>kernel assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-p2p-device-conf:queue.tx.length">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">queue.tx.length</span></code></span><span class="shortdesc"><p>Transmit queue length for the NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-p2p-device-conf:queue.tx.length"><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">queue.tx.length</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id12">
<h4>Configuration examples<a class="headerlink" href="#id12" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">p2p</span></code> network device to an instance using <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=p2p
</pre></div>
</div>
<p>Adding a <code class="docutils literal notranslate"><span class="pre">p2p</span></code> network device to an instance using a managed network is not possible.</p>
<p>See <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
<section id="nictype-routed">
<span id="nic-routed"></span><h3><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">routed</span></code><a class="headerlink" href="#nictype-routed" title="Link to this heading">¶</a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can select this NIC type only through the <code class="docutils literal notranslate"><span class="pre">nictype</span></code> option.</p>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">routed</span></code> NIC creates a virtual device pair to connect the host to the instance and sets up static routes and proxy ARP/NDP entries to allow the instance to join the network of a designated parent interface.
For containers it uses a virtual Ethernet device pair, and for VMs it uses a TAP device.</p>
<p>This NIC type is similar in operation to <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code>, in that it allows an instance to join an external network without needing to configure a bridge and shares the host’s MAC address.
However, it differs from <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> because it does not need IPVLAN support in the kernel, and the host and the instance can communicate with each other.</p>
<p>This NIC type respects <code class="docutils literal notranslate"><span class="pre">netfilter</span></code> rules on the host and uses the host’s routing table to route packets, which can be useful if the host is connected to multiple networks.</p>
<dl class="simple myst">
<dt>IP addresses, gateways and routes</dt><dd><p>You must manually specify the IP addresses (using <code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code> and/or <code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code>) before the instance is started.</p>
<p>For containers, the NIC configures the following link-local gateway IPs on the host end and sets them as the default gateways in the container’s NIC interface:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>169.254.0.1
fe80::1
</pre></div>
</div>
<p>For VMs, the gateways must be configured manually or via a mechanism like <code class="docutils literal notranslate"><span class="pre">cloud-init</span></code> (see the <a class="reference internal" href="../../howto/instances_routed_nic_vm/#instances-routed-nic-vm"><span class="std std-ref">how to guide</span></a>).</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If your container image is configured to perform DHCP on the interface, it will likely remove the automatically added configuration.
In this case, you must configure the IP addresses and gateways manually or via a mechanism like <code class="docutils literal notranslate"><span class="pre">cloud-init</span></code>.</p>
</div>
<p>The NIC type configures static routes on the host pointing to the instance’s <code class="docutils literal notranslate"><span class="pre">veth</span></code> interface for all of the instance’s IPs.</p>
</dd>
<dt>Multiple IP addresses</dt><dd><p>Each NIC device can have multiple IP addresses added to it.</p>
<p>However, it might be preferable to use multiple <code class="docutils literal notranslate"><span class="pre">routed</span></code> NIC interfaces instead.
In this case, set the <code class="docutils literal notranslate"><span class="pre">ipv4.gateway</span></code> and <code class="docutils literal notranslate"><span class="pre">ipv6.gateway</span></code> values to <code class="docutils literal notranslate"><span class="pre">none</span></code> on any subsequent interfaces to avoid default gateway conflicts.
Also consider specifying a different host-side address for these subsequent interfaces using <code class="docutils literal notranslate"><span class="pre">ipv4.host_address</span></code> and/or <code class="docutils literal notranslate"><span class="pre">ipv6.host_address</span></code>.</p>
</dd>
</dl>
<dl class="simple myst" id="nic-routed-parent">
<dt>Parent interface</dt><dd><p>This NIC can operate with and without a <code class="docutils literal notranslate"><span class="pre">parent</span></code> network interface set.</p>
</dd>
<dd><p>With the <code class="docutils literal notranslate"><span class="pre">parent</span></code> network interface set, proxy ARP/NDP entries of the instance’s IPs are added to the parent interface, which allows the instance to join the parent interface’s network at layer 2.</p>
</dd>
<dd><p>To enable this, the following network configuration must be applied on the host via <code class="docutils literal notranslate"><span class="pre">sysctl</span></code>:</p>
<ul>
<li><p>When using IPv4 addresses:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">net</span><span class="o">.</span><span class="n">ipv4</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">forwarding</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
</li>
<li><p>When using IPv6 addresses:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.</span><span class="n">all</span><span class="o">.</span><span class="n">forwarding</span><span class="o">=</span><span class="mi">1</span>
<span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">forwarding</span><span class="o">=</span><span class="mi">1</span>
<span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.</span><span class="n">all</span><span class="o">.</span><span class="n">proxy_ndp</span><span class="o">=</span><span class="mi">1</span>
<span class="n">net</span><span class="o">.</span><span class="n">ipv6</span><span class="o">.</span><span class="n">conf</span><span class="o">.<</span><span class="n">parent</span><span class="o">>.</span><span class="n">proxy_ndp</span><span class="o">=</span><span class="mi">1</span>
</pre></div>
</div>
</li>
</ul>
</dd>
</dl>
<section id="id13">
<h4>Device options<a class="headerlink" href="#id13" title="Link to this heading">¶</a></h4>
<p>NIC devices of type <code class="docutils literal notranslate"><span class="pre">routed</span></code> have the following device options:</p>
<div class="configoption docutils container" id="device-nic-routed-device-conf:gvrp">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">gvrp</span></code></span><span class="shortdesc"><p>Whether to use GARP VLAN Registration Protocol</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:gvrp"><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">gvrp</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option specifies whether to register the VLAN using the GARP VLAN Registration Protocol.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:host_name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">host_name</span></code></span><span class="shortdesc"><p>Name of the interface inside the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:host_name"><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">host_name</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>randomly assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:hwaddr">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">hwaddr</span></code></span><span class="shortdesc"><p>MAC address of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:hwaddr"><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">hwaddr</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>randomly assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code></span><span class="shortdesc"><p>IPv4 static addresses to add to the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.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">ipv4.address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static addresses to add to the instance.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.gateway">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.gateway</span></code></span><span class="shortdesc"><p>Whether to add an automatic default IPv4 gateway</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.gateway"><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">ipv4.gateway</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><code class="docutils literal notranslate"><span class="pre">auto</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Possible values are <code class="docutils literal notranslate"><span class="pre">auto</span></code> and <code class="docutils literal notranslate"><span class="pre">none</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.host_address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.host_address</span></code></span><span class="shortdesc"><p>IPv4 address to add to the host-side <code class="docutils literal notranslate"><span class="pre">veth</span></code> interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.host_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">ipv4.host_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>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">169.254.0.1</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.host_table">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.host_table</span></code></span><span class="shortdesc"><p>Custom policy routing table ID to add IPv4 static routes to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.host_table"><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">ipv4.host_table</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The custom policy routing table is in addition to the main routing table.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.neighbor_probe">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.neighbor_probe</span></code></span><span class="shortdesc"><p>Whether to probe the parent network for IPv4 address availability</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.neighbor_probe"><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">ipv4.neighbor_probe</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv4.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv4.routes</span></code></span><span class="shortdesc"><p>IPv4 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv4.routes"><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">ipv4.routes</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv4 static routes for this NIC to add on the host (without L2 ARP/NDP proxy).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code></span><span class="shortdesc"><p>IPv6 static addresses to add to the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.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">ipv6.address</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static addresses to add to the instance.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.gateway">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.gateway</span></code></span><span class="shortdesc"><p>Whether to add an automatic default IPv6 gateway</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.gateway"><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">ipv6.gateway</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><code class="docutils literal notranslate"><span class="pre">auto</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Possible values are <code class="docutils literal notranslate"><span class="pre">auto</span></code> and <code class="docutils literal notranslate"><span class="pre">none</span></code>.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.host_address">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.host_address</span></code></span><span class="shortdesc"><p>IPv6 address to add to the host-side <code class="docutils literal notranslate"><span class="pre">veth</span></code> interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.host_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">ipv6.host_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>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">fe80::1</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.host_table">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.host_table</span></code></span><span class="shortdesc"><p>Custom policy routing table ID to add IPv6 static routes to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.host_table"><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">ipv6.host_table</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The custom policy routing table is in addition to the main routing table.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.neighbor_probe">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.neighbor_probe</span></code></span><span class="shortdesc"><p>Whether to probe the parent network for IPv6 address availability</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.neighbor_probe"><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">ipv6.neighbor_probe</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>bool</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:ipv6.routes">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">ipv6.routes</span></code></span><span class="shortdesc"><p>IPv6 static routes for the NIC to add on the host</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:ipv6.routes"><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">ipv6.routes</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify a comma-delimited list of IPv6 static routes for this NIC to add on the host (without L2 ARP/NDP proxy).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:limits.egress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></span><span class="shortdesc"><p>I/O limit for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:limits.egress"><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">limits.egress</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:limits.ingress">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></span><span class="shortdesc"><p>I/O limit for incoming traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:limits.ingress"><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">limits.ingress</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:limits.max">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.max</span></code></span><span class="shortdesc"><p>I/O limit for both incoming and outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:limits.max"><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">limits.max</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>This option is the same as setting both <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.ingress"><code class="docutils literal notranslate"><span class="pre">limits.ingress</span></code></a> and <a class="configref reference internal" href="#device-nic-bridged-device-conf:limits.egress"><code class="docutils literal notranslate"><span class="pre">limits.egress</span></code></a>.</p>
<p>Specify the limit in bit/s. Various suffixes are supported (see <a class="reference internal" href="../instance_units/#instances-limit-units"><span class="std std-ref">Units for storage and network limits</span></a>).</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:limits.priority">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">limits.priority</span></code></span><span class="shortdesc"><p><code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:limits.priority"><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">limits.priority</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">skb->priority</span></code> value for outgoing traffic is used by the kernel queuing discipline (qdisc) to prioritize network packets.
Specify the value as a 32-bit unsigned integer.</p>
<p>The effect of this value depends on the particular qdisc implementation, for example, <code class="docutils literal notranslate"><span class="pre">SKBPRIO</span></code> or <code class="docutils literal notranslate"><span class="pre">QFQ</span></code>.
Consult the kernel qdisc documentation before setting this value.</p>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:mtu">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">mtu</span></code></span><span class="shortdesc"><p>The MTU of the new interface</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:mtu"><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">mtu</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
<tr class="row-odd"><td><strong>Default: </strong></td>
<td><span class="ignoreP"><p>parent MTU</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:name">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">name</span></code></span><span class="shortdesc"><p>Name of the interface inside the instance</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:name"><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">name</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>kernel assigned</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:parent">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">parent</span></code></span><span class="shortdesc"><p>Name of the host device to join the instance to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:parent"><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">parent</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>string</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:queue.tx.length">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">queue.tx.length</span></code></span><span class="shortdesc"><p>Transmit queue length for the NIC</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:queue.tx.length"><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">queue.tx.length</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="configoption docutils container" id="device-nic-routed-device-conf:vlan">
<div class="basicinfo docutils container">
<span class="key"><code class="docutils literal notranslate"><span class="pre">vlan</span></code></span><span class="shortdesc"><p>VLAN ID to attach to</p>
</span><span class="anchor"><a class="reference external" href="#device-nic-routed-device-conf:vlan"><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">vlan</span></code></td>
</tr>
<tr class="row-even"><td><strong>Type: </strong></td>
<td><span class="ignoreP"><p>integer</p>
</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<section id="id14">
<h4>Configuration examples<a class="headerlink" href="#id14" title="Link to this heading">¶</a></h4>
<p>Add a <code class="docutils literal notranslate"><span class="pre">routed</span></code> network device to an instance using <code class="docutils literal notranslate"><span class="pre">nictype</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxc config device add <instance_name> <device_name> nic nictype=routed ipv4.address=192.0.2.2 ipv6.address=2001:db8::2
</pre></div>
</div>
<p>Adding a <code class="docutils literal notranslate"><span class="pre">routed</span></code> network device to an instance using a managed network is not possible.</p>
<p>See <a class="reference internal" href="../../howto/instances_configure/#instances-configure-devices"><span class="std std-ref">Configure devices</span></a> for more information.</p>
</section>
</section>
</section>
<section id="bridged-macvlan-or-ipvlan-for-connection-to-physical-network">
<h2><code class="docutils literal notranslate"><span class="pre">bridged</span></code>, <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> or <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> for connection to physical network<a class="headerlink" href="#bridged-macvlan-or-ipvlan-for-connection-to-physical-network" title="Link to this heading">¶</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">bridged</span></code>, <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> and <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> interface types can be used to connect to an existing physical network.</p>
<p><code class="docutils literal notranslate"><span class="pre">macvlan</span></code> effectively lets you fork your physical NIC, getting a second interface that is then used by the instance.
This method saves you from creating a bridge device and virtual Ethernet device pairs and usually offers better performance than a bridge.</p>
<p>The downside to this method is that <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> devices, while able to communicate between themselves and to the outside, cannot talk to their parent device.
This means that you can’t use <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> if you ever need your instances to talk to the host itself.</p>
<p>In such case, a <code class="docutils literal notranslate"><span class="pre">bridge</span></code> device is preferable.
A bridge also lets you use MAC filtering and I/O limits, which cannot be applied to a <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> device.</p>
<p><code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> is similar to <code class="docutils literal notranslate"><span class="pre">macvlan</span></code>, with the difference being that the forked device has IPs statically assigned to it and inherits the parent’s MAC address on the network.</p>
</section>
<section id="maas-integration">
<h2>MAAS integration<a class="headerlink" href="#maas-integration" title="Link to this heading">¶</a></h2>
<p>If you’re using MAAS to manage the physical network under your LXD host and want to attach your instances directly to a MAAS-managed network, LXD can be configured to interact with MAAS so that it can track your instances.</p>
<p>At the daemon level, you must configure <a class="configref reference internal" href="../../server/#server-miscellaneous:maas.api.url"><code class="docutils literal notranslate"><span class="pre">maas.api.url</span></code></a> and <a class="configref reference internal" href="../../server/#server-miscellaneous:maas.api.key"><code class="docutils literal notranslate"><span class="pre">maas.api.key</span></code></a>, and then set the NIC-specific <code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv4</span></code> and/or <code class="docutils literal notranslate"><span class="pre">maas.subnet.ipv6</span></code> keys on the instance or profile’s <code class="docutils literal notranslate"><span class="pre">nic</span></code> entry.</p>
<p>With this configuration, LXD registers all your instances with MAAS, giving them proper DHCP leases and DNS records.</p>
<p>If you set the <code class="docutils literal notranslate"><span class="pre">ipv4.address</span></code> or <code class="docutils literal notranslate"><span class="pre">ipv6.address</span></code> keys on the NIC, those are registered as static assignments in MAAS.</p>
</section>
</section>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="../devices_disk/">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Type: <code class="docutils literal notranslate"><span class="pre">disk</span></code></div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="../devices_none/">
<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">Type: <code class="docutils literal notranslate"><span class="pre">none</span></code></div>
</div>
</a>
</div>
<div class="bottom-of-page">
<div class="left-details">
<div class="copyright">
© 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="#">Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code></a><ul>
<li><a class="reference internal" href="#nictype-vs-network"><code class="docutils literal notranslate"><span class="pre">nictype</span></code> vs. <code class="docutils literal notranslate"><span class="pre">network</span></code></a></li>
<li><a class="reference internal" href="#available-nic-types">Available NIC types</a><ul>
<li><a class="reference internal" href="#nictype-bridged"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">bridged</span></code></a><ul>
<li><a class="reference internal" href="#device-options">Device options</a></li>
<li><a class="reference internal" href="#configuration-examples">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-macvlan"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">macvlan</span></code></a><ul>
<li><a class="reference internal" href="#id1">Device options</a></li>
<li><a class="reference internal" href="#id2">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-sriov"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">sriov</span></code></a><ul>
<li><a class="reference internal" href="#id3">Device options</a></li>
<li><a class="reference internal" href="#id4">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-physical"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">physical</span></code></a><ul>
<li><a class="reference internal" href="#id5">Device options</a></li>
<li><a class="reference internal" href="#id6">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-ovn"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">ovn</span></code></a><ul>
<li><a class="reference internal" href="#id7">Device options</a></li>
<li><a class="reference internal" href="#id8">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-ipvlan"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code></a><ul>
<li><a class="reference internal" href="#id9">Device options</a></li>
<li><a class="reference internal" href="#id10">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-p2p"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">p2p</span></code></a><ul>
<li><a class="reference internal" href="#id11">Device options</a></li>
<li><a class="reference internal" href="#id12">Configuration examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nictype-routed"><code class="docutils literal notranslate"><span class="pre">nictype</span></code>: <code class="docutils literal notranslate"><span class="pre">routed</span></code></a><ul>
<li><a class="reference internal" href="#id13">Device options</a></li>
<li><a class="reference internal" href="#id14">Configuration examples</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#bridged-macvlan-or-ipvlan-for-connection-to-physical-network"><code class="docutils literal notranslate"><span class="pre">bridged</span></code>, <code class="docutils literal notranslate"><span class="pre">macvlan</span></code> or <code class="docutils literal notranslate"><span class="pre">ipvlan</span></code> for connection to physical network</a></li>
<li><a class="reference internal" href="#maas-integration">MAAS integration</a></li>
</ul>
</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/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>