User Tools

Site Tools


настройка_сети_в_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
настройка_сети_в_linux [2026/03/30 11:13]
val [Файлы конфигурации Netplan и cloud-init]
настройка_сети_в_linux [2026/05/16 16:48] (current)
val [Использование NetworkManager]
Line 52: Line 52:
  
 # dhcpcd -k enp0s3 # dhcpcd -k enp0s3
 +
 +# pkill -KILL dhcpcd
 </​code>​ </​code>​
  
Line 101: Line 103:
  
 # ss -anptu # ss -anptu
-# ss -lnp | grep ':​80'​+# ss -lnp | grep sshd
  
 # количество подключений с каждого адреса (https://​serverfault.com/​questions/​421310/​check-the-number-of-active-connections-on-port-80) # количество подключений с каждого адреса (https://​serverfault.com/​questions/​421310/​check-the-number-of-active-connections-on-port-80)
Line 127: Line 129:
 172.16.1.X ​     server.corpX.un server 172.16.1.X ​     server.corpX.un server
 </​code><​code>​ </​code><​code>​
-# apt remove resolvconf+# ###apt remove resolvconf
  
 # cat /​etc/​resolv.conf # cat /​etc/​resolv.conf
Line 144: Line 146:
 === Статическая настройка параметров === === Статическая настройка параметров ===
 <​code>​ <​code>​
 +# ###apt install ifupdown
 +
 # cat /​etc/​network/​interfaces # cat /​etc/​network/​interfaces
 </​code><​code>​ </​code><​code>​
Line 212: Line 216:
  
 client1# :> /​etc/​resolv.conf client1# :> /​etc/​resolv.conf
-</​code>​ 
- 
-или [[Система безопасности UNIX#​Команда chattr]] 
  
-<​code>​ 
 client1# cat /etc/hosts client1# cat /etc/hosts
 </​code><​code>​ </​code><​code>​
Line 232: Line 232:
 auto eth0 auto eth0
 iface eth0 inet dhcp iface eth0 inet dhcp
 +</​code>​
 +
 +=== Отключение ifupdown ===
 +<​code>​
 +# apt purge ifupdown
 +
 +# rm /​etc/​network/​interfaces
 </​code>​ </​code>​
  
Line 241: Line 248:
   * [[https://​linuxconfig.org/​rhel-8-configure-static-ip-address|How to configure a static IP address on RHEL 8 / CentOS 8 Linux]]   * [[https://​linuxconfig.org/​rhel-8-configure-static-ip-address|How to configure a static IP address on RHEL 8 / CentOS 8 Linux]]
  
-  * Не работает с net.ifnames=0+  * ??? Не работает с net.ifnames=0 
 +  * [[#​Отключение ifupdown]]
  
 <​code>​ <​code>​
-# apt purge ifupdown 
- 
 # apt install network-manager # apt install network-manager
  
Line 277: Line 283:
 <​code>​ <​code>​
 # apt purge cloud-init # apt purge cloud-init
-</​code>​ 
  
-=== Отключение ifupdown === +# rm /​etc/​netplan/​50-cloud-init.yaml
-<​code>​ +
-apt purge ifupdown+
 </​code>​ </​code>​
  
Line 306: Line 309:
  
       nameservers:​       nameservers:​
 +        search: [isp.un]
         addresses: [172.16.1.254]         addresses: [172.16.1.254]
 </​code><​code>​ </​code><​code>​
Line 313: Line 317:
  
 # netplan apply # netplan apply
-</​code>​ 
- 
-=== Отключение Netpaln === 
- 
-  * [[https://​linuxconfig.org/​how-to-switch-back-networking-to-etc-network-interfaces-on-ubuntu-20-04-focal-fossa-linux|How to switch back networking to /​etc/​network/​interfaces on Ubuntu 20.04 Focal Fossa Linux]] 
- 
-<​code>​ 
-# apt install ifupdown net-tools 
- 
-ubuntu20/​22#​ rm /​etc/​netplan/​00-installer-config.yaml 
- 
-ubuntu24# rm /​etc/​netplan/​50-cloud-init.yaml 
 </​code>​ </​code>​
  
настройка_сети_в_linux.1774858398.txt.gz · Last modified: 2026/03/30 11:13 by val