notes/os/unix/admin/systemd/systemd-networkd.txt
Ihar Hancharenka c3db6946ae m
2025-08-01 13:44:36 +03:00

41 строка
941 B
Plaintext

https://www.freedesktop.org/software/systemd/man/latest/systemd-networkd.html
https://www.freedesktop.org/software/systemd/man/latest/networkctl.html
Articles:
https://habrahabr.ru/company/ruvds/blog/309010/
man systemd.network
systemctl enable/start systemd-networkd
/etc/systemd/network
*.network (units of network type)
Samples
[Match]
Name=en2sp...
#MACAddress, Driver, Type
[Network]
Description=Wired network
DHCP=yes
# static net settings:
Address=192.168.2.5/24
Gateway=192.168.2.42
DNS=192.168.2.42
#[Address]
#[Route]
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
/etc/systemd/system/systemd-networkd.service.d/
*.conf
[Service]
ExecStartPost=/bin/ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
ExecStopPost=/bin/rm -f /etc/resolv.conf
ExecStopPost=/usr/bin/touch /etc/resolv.conf
ExecStopPost=-/bin/cp -pf /etc/resolv/conf.bak /etc/resolv.conf
#- here just for ignoring any possible errors