mirror of
https://github.com/clearlinux/clear-linux-documentation.git
synced 2026-05-14 02:43:43 +00:00
222 lines
11 KiB
HTML
222 lines
11 KiB
HTML
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en" data-content_root="../../">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<title>Combine multiple interfaces with network bonding — Documentation for Clear Linux* project</title>
|
|
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/bizstyle.css?v=5283bb3d" />
|
|
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
|
|
|
|
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
<script src="../../_static/doctools.js?v=9bcbadda"></script>
|
|
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
|
|
<script src="../../_static/copybutton.js?v=a56c686a"></script>
|
|
<script src="../../_static/bizstyle.js"></script>
|
|
<link rel="canonical" href="https://clearlinux.github.io/clear-linux-documentation/guides/network/network-bonding.html" />
|
|
<link rel="icon" href="../../_static/favicon.ico"/>
|
|
<link rel="author" title="About these documents" href="../../about.html" />
|
|
<link rel="index" title="Index" href="../../genindex.html" />
|
|
<link rel="search" title="Search" href="../../search.html" />
|
|
<link rel="next" title="Enable and configure SSH service" href="openssh-server.html" />
|
|
<link rel="prev" title="Firewall" href="firewall.html" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<!--[if lt IE 9]>
|
|
<script src="_static/css3-mediaqueries.js"></script>
|
|
<![endif]-->
|
|
</head><body>
|
|
<div class="related" role="navigation" aria-label="Related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="openssh-server.html" title="Enable and configure SSH service"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="firewall.html" title="Firewall"
|
|
accesskey="P">previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> »</li>
|
|
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Guides</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Combine multiple interfaces with network bonding</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<section id="combine-multiple-interfaces-with-network-bonding">
|
|
<span id="network-bonding"></span><h1>Combine multiple interfaces with network bonding<a class="headerlink" href="#combine-multiple-interfaces-with-network-bonding" title="Link to this heading">¶</a></h1>
|
|
<p>This guide describes how to configure systemd to use the <strong class="command">bonding</strong>
|
|
driver.</p>
|
|
<p>Network bonding combines multiple network interfaces into a single logical
|
|
interface to provide redundancy and bandwidth aggregation.</p>
|
|
<p>Clear Linux* OS includes the Linux <a class="reference external" href="https://www.kernel.org/doc/Documentation/networking/bonding.txt">Bonding driver</a> and <a class="reference external" href="https://www.kernel.org/doc/Documentation/networking/team.txt">Team driver</a> .</p>
|
|
<p>The example demonstrates how to:</p>
|
|
<ul class="simple">
|
|
<li><p>Bond all four ports of a quad-port NIC in 802.3ad mode.</p></li>
|
|
<li><p>Enable jumbo frames to optimize large data transfers on the local network.</p></li>
|
|
</ul>
|
|
<p>Your NICs and network switch must support 802.3ad mode and jumbo frames. The
|
|
example explains how to configure your NICs for both features. Your switch may
|
|
require additional configuration. See your switch documentation for details.</p>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>You must run all commands in this guide as root.</p>
|
|
</div>
|
|
<ol class="arabic">
|
|
<li><p>Log in and get root privileges.</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">sudo -s</span>
|
|
</pre></div>
|
|
</div>
|
|
</li>
|
|
<li><p>Create the <code class="file docutils literal notranslate"><span class="pre">/etc/systemd/network</span></code> directory.</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/systemd/network
|
|
</pre></div>
|
|
</div>
|
|
<p>The <code class="file docutils literal notranslate"><span class="pre">/etc/systemd/network</span></code> directory contains configuration files and
|
|
network settings for the virtual device and its underlying physical
|
|
interfaces.</p>
|
|
</li>
|
|
<li><p>Configure systemd to create a virtual network device called <cite>bond1</cite>. Use a
|
|
text editor to create a file named <code class="file docutils literal notranslate"><span class="pre">30-bond1.netdev</span></code>.</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">[NetDev]</span>
|
|
<span class="go">Name=bond1</span>
|
|
<span class="go">Kind=bond</span>
|
|
|
|
<span class="go">[Bond]</span>
|
|
<span class="go">Mode=802.3ad</span>
|
|
<span class="go">TransmitHashPolicy=layer3+4</span>
|
|
<span class="go">MIIMonitorSec=1s</span>
|
|
<span class="go">LACPTransmitRate=fast</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>Refer to the <a class="reference external" href="https://www.freedesktop.org/software/systemd/man/systemd.netdev.html">systemd.netdev</a> manpage for <code class="file docutils literal notranslate"><span class="pre">30-bond1.netdev</span></code> file
|
|
syntax. This example is based on Example 9 on the manpage. Modify the
|
|
example for your configuration.</p>
|
|
</li>
|
|
<li><p>Configure the slave interfaces. Create a text file named
|
|
<code class="file docutils literal notranslate"><span class="pre">30-bond1-enp1s0.network</span></code>. Assign the slave interfaces to the virtual
|
|
<cite>bond1</cite> device and use the syntax shown in <a class="reference external" href="https://www.freedesktop.org/software/systemd/man/systemd.network.html">systemd.network</a>.</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">[Match]</span>
|
|
<span class="go">Name=enp1s0f*</span>
|
|
|
|
<span class="go">[Network]</span>
|
|
<span class="go">Bond=bond1</span>
|
|
|
|
<span class="go">[Link]</span>
|
|
<span class="go">MTUBytes=9000</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>The example bonds all four ports of a quad-port NIC as a slave of <cite>bond1</cite>.
|
|
The example uses a wildcard match because the NIC names are in the range
|
|
<cite>enp1s0f0-enp1s0f3</cite>. If your NIC names are not wildcard-compatible, create
|
|
a separate <code class="file docutils literal notranslate"><span class="pre">.network</span></code> file for each NIC.</p>
|
|
<p>For best results, do not assign addresses or DHCP support to the individual
|
|
NICs.</p>
|
|
<p>The <cite>MTUBytes</cite> setting enables jumbo frames of up to 9000 bytes. Your
|
|
switch may require additional configuration to support this setting.</p>
|
|
</li>
|
|
<li><p>Configure the bonded interface in a file named <code class="file docutils literal notranslate"><span class="pre">30-bond1.network</span></code>.</p>
|
|
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">[Match]</span>
|
|
<span class="go">Name=bond1</span>
|
|
|
|
<span class="go">[Network]</span>
|
|
<span class="go">BindCarrier=enp1s0f0 enp1s0f1 enp1s0f2 enp1s0f3</span>
|
|
<span class="go">Address=192.168.1.201/24</span>
|
|
|
|
<span class="go">[Link]</span>
|
|
<span class="go">MTUBytes=9000</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><cite>bond1</cite> is a virtual interface with no physical link status.</p>
|
|
<p><cite>BindCarrier</cite> indicates that the <cite>bond1</cite> link status is determined by the
|
|
status of the listed slave devices.</p>
|
|
<p><cite>Address</cite> contains an IP address that you assign to the logical interface.
|
|
DHCP bonded interfaces are complex and outside the scope of this example.</p>
|
|
<p><cite>MTUBytes</cite> must be set to 9000 on all slave interfaces and on the bonded
|
|
interface for successful jumbo frames operation. If <cite>MTUBytes</cite> is not the
|
|
same on all interfaces, then the lowest value is used.</p>
|
|
</li>
|
|
<li><p>Apply the new network configuration with the command:</p>
|
|
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>systemctl<span class="w"> </span>restart<span class="w"> </span>systemd-networkd
|
|
</pre></div>
|
|
</div>
|
|
<p>The <cite>MTUBytes</cite> settings do not take effect until you reboot or manually
|
|
apply the settings with a utility such as ifconfig.</p>
|
|
</li>
|
|
</ol>
|
|
</section>
|
|
|
|
|
|
<div class="clearer"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
|
<div class="sphinxsidebarwrapper">
|
|
<p class="logo"><a href="../../index.html">
|
|
<img class="logo" src="../../_static/clearlinux.png" alt="Logo of Clear Linux* Project Docs"/>
|
|
</a></p>
|
|
<div>
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="firewall.html"
|
|
title="previous chapter">Firewall</a></p>
|
|
</div>
|
|
<div>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="openssh-server.html"
|
|
title="next chapter">Enable and configure SSH service</a></p>
|
|
</div>
|
|
<div role="note" aria-label="source link">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="../../_sources/guides/network/network-bonding.rst.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
</div>
|
|
<search id="searchbox" style="display: none" role="search">
|
|
<h3 id="searchlabel">Quick search</h3>
|
|
<div class="searchformwrapper">
|
|
<form class="search" action="../../search.html" method="get">
|
|
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|
<input type="submit" value="Go" />
|
|
</form>
|
|
</div>
|
|
</search>
|
|
<script>document.getElementById('searchbox').style.display = "block"</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related" role="navigation" aria-label="Related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../../genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="openssh-server.html" title="Enable and configure SSH service"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="firewall.html" title="Firewall"
|
|
>previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> »</li>
|
|
<li class="nav-item nav-item-1"><a href="../index.html" >Guides</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Combine multiple interfaces with network bonding</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer" role="contentinfo">
|
|
© Copyright 2022 Intel Corporation. All Rights Reserved..
|
|
Last updated on Nov 04, 2024.
|
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
|
|
</div>
|
|
</body>
|
|
</html> |