This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
настройка_сети_в_linux [2022/05/26 10:56] val [Файлы конфигурации Ubuntu >= 18] |
настройка_сети_в_linux [2023/06/07 09:00] val [Файлы конфигурации Ubuntu >= 18] |
||
---|---|---|---|
Line 178: | Line 178: | ||
<code> | <code> | ||
+ | client1# dhclient eth0 | ||
+ | |||
client1# cat /etc/hostname | client1# cat /etc/hostname | ||
</code><code> | </code><code> | ||
Line 183: | Line 185: | ||
</code><code> | </code><code> | ||
client1# :> /etc/resolv.conf | client1# :> /etc/resolv.conf | ||
- | </code><code> | + | </code> |
+ | |||
+ | или [[Система безопасности UNIX#Команда chattr]] | ||
+ | |||
+ | <code> | ||
client1# cat /etc/hosts | client1# cat /etc/hosts | ||
</code><code> | </code><code> | ||
Line 237: | Line 243: | ||
addresses: [172.16.1.200+X/24] | addresses: [172.16.1.200+X/24] | ||
gateway4: 172.16.1.254 | gateway4: 172.16.1.254 | ||
+ | |||
+ | # routes: | ||
+ | # - to: default | ||
+ | # via: 172.16.1.254 | ||
+ | |||
# nameservers: | # nameservers: | ||
# addresses: [172.16.1.254] | # addresses: [172.16.1.254] | ||
Line 243: | Line 254: | ||
# netplan apply | # netplan apply | ||
+ | </code> | ||
+ | === systemd-resolved === | ||
+ | * [[https://wiki.archlinux.org/title/Systemd-resolved_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)|archlinux systemd-resolved (Русский)]] | ||
+ | |||
+ | <code> | ||
# cat /etc/resolv.conf | # cat /etc/resolv.conf | ||
</code><code> | </code><code> | ||
Line 249: | Line 265: | ||
nameserver 127.0.0.53 | nameserver 127.0.0.53 | ||
</code><code> | </code><code> | ||
+ | # resolvectl status | ||
+ | или | ||
+ | # systemd-resolve --status | ||
+ | |||
# cat /etc/systemd/resolved.conf | # cat /etc/systemd/resolved.conf | ||
</code><code> | </code><code> | ||
[Resolve] | [Resolve] | ||
DNS=172.16.1.254 | DNS=172.16.1.254 | ||
+ | </code><code> | ||
+ | # systemctl restart systemd-resolved | ||
</code> | </code> | ||
Line 275: | Line 297: | ||
# systemctl disable systemd-resolved.service | # systemctl disable systemd-resolved.service | ||
# systemctl stop systemd-resolved | # systemctl stop systemd-resolved | ||
+ | |||
+ | # rm /etc/resolv.conf # this is link | ||
</code> | </code> | ||
==== Файлы конфигурации CentOS/SL/RHEL ==== | ==== Файлы конфигурации CentOS/SL/RHEL ==== |