mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 01:57:54 +00:00
36 lines
7.2 KiB
HTML
36 lines
7.2 KiB
HTML
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>systemd-networkd</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
|
},
|
|
options = {
|
|
processHtmlClass = "math"
|
|
}
|
|
}
|
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>systemd-networkd</h1><section class="post-metadata"><span>Date: <!-- -->2021-08-07 20:01:23 +08:00</span><span>Date modified: <!-- -->2021-08-07 20:06:47 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"></ol></nav><p>With a systemd-ful environment, you can run the network daemon (i.e., <code class="inline-verbatim">systemd-networkd</code>).
|
|
Once enabled, you can run <code class="inline-verbatim">networkctl</code> to list all of the network devices. </p><pre class="src-block"><code class="language-shell">networkctl
|
|
</code></pre><pre class="fixed-width">IDX LINK TYPE OPERATIONAL SETUP
|
|
1 lo loopback carrier unmanaged
|
|
2 enp1s0 ether routable configured
|
|
3 wlan0 wlan routable configured
|
|
|
|
3 links listed.</pre><p>
|
|
To configure network manager, you can create a network file in one of systemd unit file paths in the system.
|
|
Each of the device will be assigned an IP address.
|
|
You can either assign an IP address or dynamically assign them in some way.
|
|
One of the common ways to do dynamic IP addresses is installing a DHCP server (which is another thing to be configured).
|
|
Here's an example of configuring any wireless devices and assigning a dynamic IP addresses with <a href="https://wiki.archlinux.org/title/Network_configuration#DHCP">DHCP</a>.
|
|
</p><pre class="src-block"><code>[Match]
|
|
Type=wlan
|
|
|
|
[Network]
|
|
DHCP=yes
|
|
IPv6PrivacyExtensions=yes
|
|
|
|
[DHCPv4]
|
|
RouteMetric=1024
|
|
|
|
[DHCPv6]
|
|
RouteMetric=1024
|
|
</code></pre><section><h2>Backlinks</h2><ul><li><a href="/wiki/linux.network-configuration">Network configuration in Linux</a></li><li><a href="/wiki/linux.systemd">systemd</a></li></ul></section></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"2021-08-07 20:01:23 +08:00","date_modified":"2021-08-07 20:06:47 +08:00","language":"en","source":""},"title":"systemd-networkd","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With a systemd-ful environment, you can run the network daemon (i.e., "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd-networkd"}]},{"type":"text","value":").\nOnce enabled, you can run "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"networkctl"}]},{"type":"text","value":" to list all of the network devices. "}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"networkctl\n"}]}]},{"type":"element","tagName":"pre","properties":{"className":["fixed-width"]},"children":[{"type":"text","value":"IDX LINK TYPE OPERATIONAL SETUP\n 1 lo loopback carrier unmanaged\n 2 enp1s0 ether routable configured\n 3 wlan0 wlan routable configured\n\n3 links listed."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"\nTo configure network manager, you can create a network file in one of systemd unit file paths in the system.\nEach of the device will be assigned an IP address.\nYou can either assign an IP address or dynamically assign them in some way.\nOne of the common ways to do dynamic IP addresses is installing a DHCP server (which is another thing to be configured).\nHere's an example of configuring any wireless devices and assigning a dynamic IP addresses with "},{"type":"element","tagName":"a","properties":{"href":"https://wiki.archlinux.org/title/Network_configuration#DHCP"},"children":[{"type":"text","value":"DHCP"}]},{"type":"text","value":".\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"[Match]\nType=wlan\n\n[Network]\nDHCP=yes\nIPv6PrivacyExtensions=yes\n\n[DHCPv4]\nRouteMetric=1024\n\n[DHCPv6]\nRouteMetric=1024\n"}]}]}]},"backlinks":[{"path":"/linux.network-configuration","title":"Network configuration in Linux"},{"path":"/linux.systemd","title":"systemd"}]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["linux.systemd.network"]},"buildId":"Ie9t5zutrXP6Of75Cb5xF","assetPrefix":"/wiki","nextExport":false,"isFallback":false,"gsp":true}</script><script nomodule="" src="/wiki/_next/static/chunks/polyfills-99d808df29361cf7ffb1.js"></script><script src="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" async=""></script><script src="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" async=""></script><script src="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" async=""></script><script src="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" async=""></script><script src="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" async=""></script><script src="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" async=""></script><script src="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_buildManifest.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_ssgManifest.js" async=""></script></body></html> |