From 63d2255269d779407f6f552685d14f929667a7dc Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 12:25:14 +0500 Subject: [PATCH 01/28] Update README.md --- README.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/README.md b/README.md index 4e8249e..940ceb4 100644 --- a/README.md +++ b/README.md @@ -960,17 +960,7 @@ Ansible обычно уже использует /etc/ansible как рабоч 3. Создание файла инвентаря -Создайте инвентарь файла : /etc/ansible/hosts. - -Скачиваем файл с github: - -apt install dos2unix -y - -curl -O https://github.com/4bobus/laba/blob/main/files/hosts.txt /etc/ansible - -dos2unix /etc/ansible/hosts.txt - -Проверяем его наличие: +Создайте инвентарь файла : /etc/ansible/hosts. Открываем файл /etc/ansible/hosts

From 08fa955668a78e078daef10a2029f0852cbce686 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 12:30:54 +0500 Subject: [PATCH 02/28] Update README.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 940ceb4..4be5c45 100644 --- a/README.md +++ b/README.md @@ -676,7 +676,9 @@ ________________________________________________________________________________ - Потом на BR-SRV скачиваем скрипт, который выполнит за нас задание: -***curl -O https://github.com/4bobus/laba/blob/main/files/import_users.sh /opt*** +***cd /opt*** + +***curl -O https://github.com/4bobus/laba/blob/main/files/import_users.sh*** ***ls /opt*** @@ -1046,8 +1048,19 @@ ________________________________________________________________________________ 3. В домашней директории пользователя root создаём файл wiki.yml со следующим содержимым: -***nano ~/wiki.yml*** +- Чтобы вручную файл не заполнять просто скачиваем его с github: +***apt install dos2unix -y*** + +***cd ~/*** + +***curl -O https://github.com/4bobus/laba/blob/main/files/wiki.yml*** + +***dos2unix ~/wiki.yml*** + +- Проверяем его наличие: + +***nano ~/wiki.yml***

From 9ba0184d5c63eea16f503b738afe1c68fd1376ba Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:20:43 +0500 Subject: [PATCH 03/28] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4be5c45..343b777 100644 --- a/README.md +++ b/README.md @@ -678,7 +678,7 @@ ________________________________________________________________________________ ***cd /opt*** -***curl -O https://github.com/4bobus/laba/blob/main/files/import_users.sh*** +***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/import_users.sh*** ***ls /opt*** @@ -1054,7 +1054,7 @@ ________________________________________________________________________________ ***cd ~/*** -***curl -O https://github.com/4bobus/laba/blob/main/files/wiki.yml*** +***curl -O https://raw.githubusercontent.com/4bobus/laba/main/files/wiki.yml*** ***dos2unix ~/wiki.yml*** From 9b9ca4bdb00071c1d367add0d73296ee8b652bd3 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:22:01 +0500 Subject: [PATCH 04/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 343b777..6ee6d71 100644 --- a/README.md +++ b/README.md @@ -690,7 +690,7 @@ ________________________________________________________________________________ - Проверяем наличие скрипта: -***nano /import_users.sh*** +***nano /opt/import_users.sh***

From c15faef1fb3276e0f02715e333efacfcdb2c93c1 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:27:28 +0500 Subject: [PATCH 05/28] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 6ee6d71..fddaef8 100644 --- a/README.md +++ b/README.md @@ -964,6 +964,16 @@ Ansible обычно уже использует /etc/ansible как рабоч Создайте инвентарь файла : /etc/ansible/hosts. Открываем файл /etc/ansible/hosts +Скачиваем файл с github: + +apt install dos2unix -y + +cd /etc/ansible + +curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file + +dos2unix /etc/ansible/hosts.file +

From 2073fbddfcb25fe9d08c9bf738d581a4b08bdb91 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:29:17 +0500 Subject: [PATCH 06/28] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fddaef8..c8f12f3 100644 --- a/README.md +++ b/README.md @@ -964,15 +964,17 @@ Ansible обычно уже использует /etc/ansible как рабоч Создайте инвентарь файла : /etc/ansible/hosts. Открываем файл /etc/ansible/hosts -Скачиваем файл с github: +- Скачиваем файл с github: -apt install dos2unix -y +***apt install dos2unix -y*** -cd /etc/ansible +***cd /etc/ansible*** -curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file +***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file*** -dos2unix /etc/ansible/hosts.file +***dos2unix /etc/ansible/hosts.file*** + +- Проверяем его наличие:

From 568f4c265ef0b6b86e8c92007b9cd24130fb6a25 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:36:54 +0500 Subject: [PATCH 07/28] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c8f12f3..a0a9a2c 100644 --- a/README.md +++ b/README.md @@ -1509,6 +1509,14 @@ ________________________________________________________________________________ Добавьте конфигурацию для проксирования запросов в файл reverse-proxy.conf: +- Скачиваем файл с гит: + +***apt install dos2unix -y*** + +***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** + +- Проверяем его наличие: +

From 4c00ad78dc7b3d9eeb15b1877599efd16646afea Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:40:13 +0500 Subject: [PATCH 08/28] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a0a9a2c..de84c63 100644 --- a/README.md +++ b/README.md @@ -1501,22 +1501,24 @@ ________________________________________________________________________________ 2. Настройка Nginx как обратного прокси -Создадим конфигурационный файл для сайта в Nginx, в котором настроим виртуальные хосты: - -

- -

- -Добавьте конфигурацию для проксирования запросов в файл reverse-proxy.conf: +Создадим конфигурационный файл для сайта в Nginx, в котором настроим виртуальные хосты. Добавьте конфигурацию для проксирования запросов в файл reverse-proxy.conf: - Скачиваем файл с гит: ***apt install dos2unix -y*** +- Переходим в нужную директорию: + +cd /etc/nginx/sites-available + ***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** - Проверяем его наличие: +

+ +

+

From e80cad83a3306b9ba34f594d08dc8024a32d59cc Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:47:05 +0500 Subject: [PATCH 09/28] Update README.md --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index de84c63..aec141f 100644 --- a/README.md +++ b/README.md @@ -1503,13 +1503,11 @@ ________________________________________________________________________________ Создадим конфигурационный файл для сайта в Nginx, в котором настроим виртуальные хосты. Добавьте конфигурацию для проксирования запросов в файл reverse-proxy.conf: -- Скачиваем файл с гит: +- Скачиваем файл с гит в необходимую директорию: ***apt install dos2unix -y*** -- Переходим в нужную директорию: - -cd /etc/nginx/sites-available +***cd /etc/nginx/sites-available*** ***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** @@ -1956,12 +1954,22 @@ apt install rsyslog 2. Далее, создадим плейбук /etc/ansible/inventory.yml: +- Скачиваем его с github в необходимую директори: + +***apt install dos2unix -y*** + +***cd /etc/ansible*** + +***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/inventory.yml*** + +***dos2unix /etc/ansible/inventory.yml*** + +- Потом проверяем его содержимое: +

-со следующим содержимым: -

From f44608d001483ead433b2949bfc371516b327be8 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Sun, 22 Jun 2025 13:50:52 +0500 Subject: [PATCH 10/28] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index aec141f..2b0f5c2 100644 --- a/README.md +++ b/README.md @@ -2008,6 +2008,19 @@ apt install rsyslog

2. И создаём сам плейбук /etc/ansible/backup.yml: +> *ОБЯЗАТЕЛЬНО УСТАНОВИТЕ sudo НА HQ-RTR и BR-RTR* + +- Скачаем файл с github в нужную директорию: + +***apt install dos2unix -y*** + +***cd /etc/ansible*** + +***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/backup.yml*** + +***dos2unix /etc/ansible/backup.yml*** + +- Проверяем его содержимое:

From 3cb124eb0405ce707d3574ce879d1600e276d318 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 14:21:14 +0500 Subject: [PATCH 11/28] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2b0f5c2..77d47ce 100644 --- a/README.md +++ b/README.md @@ -1507,10 +1507,14 @@ ________________________________________________________________________________ ***apt install dos2unix -y*** +***apt install curl -y*** + ***cd /etc/nginx/sites-available*** ***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** +***dos2unix /etc/nginx/sites-available*** + - Проверяем его наличие:

From b6441314bc002e474c0fb11786da9bd142fec2c7 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 14:22:18 +0500 Subject: [PATCH 12/28] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 77d47ce..67e44af 100644 --- a/README.md +++ b/README.md @@ -968,6 +968,8 @@ Ansible обычно уже использует /etc/ansible как рабоч ***apt install dos2unix -y*** +***apt install curl -y*** + ***cd /etc/ansible*** ***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file*** From 1d06168d5ff9613009d809496a20dea75afcdca6 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 14:23:45 +0500 Subject: [PATCH 13/28] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 67e44af..6905165 100644 --- a/README.md +++ b/README.md @@ -1063,8 +1063,7 @@ ________________________________________________________________________________ 3. В домашней директории пользователя root создаём файл wiki.yml со следующим содержимым: - Чтобы вручную файл не заполнять просто скачиваем его с github: - -***apt install dos2unix -y*** +> !dos2unix и curl на BR-SRV уже скачаны! ***cd ~/*** From 515fbf2fc7b62bd8ae88ae9445240fd891901e08 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 14:26:28 +0500 Subject: [PATCH 14/28] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6905165..145f80f 100644 --- a/README.md +++ b/README.md @@ -1960,8 +1960,7 @@ apt install rsyslog 2. Далее, создадим плейбук /etc/ansible/inventory.yml: - Скачиваем его с github в необходимую директори: - -***apt install dos2unix -y*** +> !dos2unix и curl на BR-SRV уже скачаны! ***cd /etc/ansible*** @@ -2016,8 +2015,7 @@ apt install rsyslog > *ОБЯЗАТЕЛЬНО УСТАНОВИТЕ sudo НА HQ-RTR и BR-RTR* - Скачаем файл с github в нужную директорию: - -***apt install dos2unix -y*** +> !dos2unix и curl на BR-SRV уже скачаны! ***cd /etc/ansible*** From 0568890ed604c1c3e7520f8f6ed91be65674cabd Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 15:24:29 +0500 Subject: [PATCH 15/28] add nftables.confj --- files/hq-rtr/nftables.conf | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 files/hq-rtr/nftables.conf diff --git a/files/hq-rtr/nftables.conf b/files/hq-rtr/nftables.conf new file mode 100755 index 0000000..ae4a670 --- /dev/null +++ b/files/hq-rtr/nftables.conf @@ -0,0 +1,45 @@ +#!/usr/sbin/nft -f + +flush ruleset + +table inet filter { + chain input { + type filter hook input priority 0; policy drop; + log prefix "Dropped Input: " level debug + iif lo accept + ct state established,related accept + tcp dport { 22,514,53,80,443,2024,445,139,88 } accept + udp dport { 53,123,500,4500,88,137 } accept + ip protocol icmp accept + ip protocol esp accept + ip protocol gre accept + ip protocol ospf accept + } + chain forward { + type filter hook forward priority 0; policy drop; + log prefix "Dropped forward: " level debug + iif lo accept + ct state established,related accept + tcp dport { 22,514,53,80,443,2024,445,139,88 } accept + udp dport { 53,123,500,4500,88,137 } accept + ip protocol icmp accept + ip protocol esp accept + ip protocol gre accept + ip protocol ospf accept + } + chain output { + type filter hook output priority 0; policy accept; + } +} + +table inet nat { + chain prerouting { + type nat hook prerouting priority filter; policy accept + ip daddr 172.16.4.2 tcp dport 2024 dnat ip to 192.168.100.2:2024 + } + chain postrouting { + type nat hook postrouting priority srcnat + + oif "ens18" ip saddr { 192.168.100.0/26, 192.168.10.0/28 } masquerade + } +} From f7fab617d9b4285aab10833a939bc5ba30f5af26 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 15:38:56 +0500 Subject: [PATCH 16/28] add nftables.conf 2 --- files/br-rtr/nftables.conf | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 files/br-rtr/nftables.conf diff --git a/files/br-rtr/nftables.conf b/files/br-rtr/nftables.conf new file mode 100755 index 0000000..c504fd2 --- /dev/null +++ b/files/br-rtr/nftables.conf @@ -0,0 +1,46 @@ +#!/usr/sbin/nft -f + +flush ruleset + +table inet filter { + chain input { + type filter hook input priority 0; policy drop; + log prefix "Dropped Input: " level debug + iif lo accept + ct state established,related accept + tcp dport { 22,514,53,80,443,2024,445,139,88 } accept + udp dport { 53,123,500,4500,88,137 } accept + ip protocol icmp accept + ip protocol esp accept + ip protocol gre accept + ip protocol ospf accept + } + chain forward { + type filter hook forward priority 0; policy drop; + log prefix "Dropped forward: " level debug + iif lo accept + ct state established,related accept + tcp dport { 22,514,53,80,443,2024,445,139,88 } accept + udp dport { 53,123,500,4500,88,137 } accept + ip protocol icmp accept + ip protocol esp accept + ip protocol gre accept + ip protocol ospf accept + } + chain output { + type filter hook output priority 0; policy accept; + } +} + +table inet nat { + chain prerouting { + type nat hook prerouting priority filter; policy accept + ip daddr 172.16.5.2 tcp dport 2024 dnat ip to 192.168.200.2:2024 + ip daddr 172.16.5.2 tcp dport 80 dnat ip to 192.168.200.2:8080 + } + chain postrouting { + type nat hook postrouting priority srcnat + + oif "ens18" ip saddr { 192.168.200.0/27 } masquerade + } +} From a585fdd54b5bf21ead89505d738b2f88815036ae Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 15:57:27 +0500 Subject: [PATCH 17/28] Update README.md --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 145f80f..c942164 100644 --- a/README.md +++ b/README.md @@ -1689,7 +1689,14 @@ ________________________________________________________________________________

*HQ-RTR*

-Отредактируем nftables под текст задания: +Скачаем готовый nftables.conf с github: +> !dos2unix и curl на HQ-RTR уже скачаны! + +curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hq-rtr/nftables.conf + +dos2unix /etc/nftables.conf + +Проверяем содержимое файла /etc/nftables.conf:

@@ -1703,10 +1710,24 @@ ________________________________________________________________________________

*BR-RTR *

+Скачаем готовый nftables.conf с github: + +apt install dos2unix -y + +apt install curl -y + +curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/br-rtr/nftables.conf + +dos2unix /etc/nftables.conf + +Проверяем содержимое файла /etc/nftables.conf: +

+Не забываем применять: +

From 7af40df4fc7896e66e8628a80554ae47fdd37255 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 15:58:47 +0500 Subject: [PATCH 18/28] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c942164..7395b4b 100644 --- a/README.md +++ b/README.md @@ -1692,9 +1692,9 @@ ________________________________________________________________________________ Скачаем готовый nftables.conf с github: > !dos2unix и curl на HQ-RTR уже скачаны! -curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hq-rtr/nftables.conf +***curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hq-rtr/nftables.conf*** -dos2unix /etc/nftables.conf +***dos2unix /etc/nftables.conf*** Проверяем содержимое файла /etc/nftables.conf: @@ -1712,13 +1712,13 @@ dos2unix /etc/nftables.conf Скачаем готовый nftables.conf с github: -apt install dos2unix -y +***apt install dos2unix -y*** -apt install curl -y +***apt install curl -y*** -curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/br-rtr/nftables.conf +***curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/br-rtr/nftables.conf*** -dos2unix /etc/nftables.conf +***dos2unix /etc/nftables.conf*** Проверяем содержимое файла /etc/nftables.conf: From b44285b4f50d1682549219f5727142a3eb93f9f3 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 15:59:51 +0500 Subject: [PATCH 19/28] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7395b4b..f4caa6d 100644 --- a/README.md +++ b/README.md @@ -1689,20 +1689,20 @@ ________________________________________________________________________________

*HQ-RTR*

-Скачаем готовый nftables.conf с github: +- Скачаем готовый nftables.conf с github: > !dos2unix и curl на HQ-RTR уже скачаны! ***curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hq-rtr/nftables.conf*** ***dos2unix /etc/nftables.conf*** -Проверяем содержимое файла /etc/nftables.conf: +- Проверяем содержимое файла /etc/nftables.conf:

-Не забываем применять: +- Не забываем применять:

@@ -1710,7 +1710,7 @@ ________________________________________________________________________________

*BR-RTR *

-Скачаем готовый nftables.conf с github: +- Скачаем готовый nftables.conf с github: ***apt install dos2unix -y*** @@ -1720,13 +1720,13 @@ ________________________________________________________________________________ ***dos2unix /etc/nftables.conf*** -Проверяем содержимое файла /etc/nftables.conf: +- Проверяем содержимое файла /etc/nftables.conf:

-Не забываем применять: +- Не забываем применять:

From 1ab7256b2cd86cf6845497e336b30ab81770102a Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:02:37 +0500 Subject: [PATCH 20/28] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f4caa6d..b65a519 100644 --- a/README.md +++ b/README.md @@ -1697,6 +1697,7 @@ ________________________________________________________________________________ ***dos2unix /etc/nftables.conf*** - Проверяем содержимое файла /etc/nftables.conf: +> !меняем префикс(маску) ip-адреса в соответствии со своим заданием!

@@ -1721,6 +1722,7 @@ ________________________________________________________________________________ ***dos2unix /etc/nftables.conf*** - Проверяем содержимое файла /etc/nftables.conf: +> !меняем префикс(маску) ip-адреса в соответствии со своим заданием!

From fe355ae4237c1ba960dcb07c3d98aaf86f068a15 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:05:47 +0500 Subject: [PATCH 21/28] Update README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b65a519..b4a5b9a 100644 --- a/README.md +++ b/README.md @@ -1985,9 +1985,7 @@ apt install rsyslog - Скачиваем его с github в необходимую директори: > !dos2unix и curl на BR-SRV уже скачаны! -***cd /etc/ansible*** - -***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/inventory.yml*** +***curl -o /etc/ansible https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/inventory.yml*** ***dos2unix /etc/ansible/inventory.yml*** @@ -2040,9 +2038,7 @@ apt install rsyslog - Скачаем файл с github в нужную директорию: > !dos2unix и curl на BR-SRV уже скачаны! -***cd /etc/ansible*** - -***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/backup.yml*** +***curl -o /etc/ansible https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/backup.yml*** ***dos2unix /etc/ansible/backup.yml*** From 95dbf69d59b367db343c69d677143415c2ac9757 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:12:09 +0500 Subject: [PATCH 22/28] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4a5b9a..afb247a 100644 --- a/README.md +++ b/README.md @@ -670,15 +670,15 @@ ________________________________________________________________________________

Выполните импорт пользователей из файла users.csv. Файл будет располагаться на виртуальной машине BR-SRV в папке /opt

-- Сначала скачаем необходимую утилиту на BR-SRV: +- Сначала скачаем необходимую утилиту на *BR-SRV*: ***apt install dos2unix -y*** -- Потом на BR-SRV скачиваем скрипт, который выполнит за нас задание: +***apt install curl -y*** -***cd /opt*** +- Потом на BR-SRV скачиваем скрипт, который выполнит за нас задание, в нужную директорию: -***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/import_users.sh*** +***curl -o /opt https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/import_users.sh*** ***ls /opt*** From ec0ea749b69eccb97884f6393f85c5d03fd60a8e Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:14:54 +0500 Subject: [PATCH 23/28] Update README.md --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index afb247a..98dc0b5 100644 --- a/README.md +++ b/README.md @@ -964,15 +964,10 @@ Ansible обычно уже использует /etc/ansible как рабоч Создайте инвентарь файла : /etc/ansible/hosts. Открываем файл /etc/ansible/hosts -- Скачиваем файл с github: +- Скачиваем файл с github, в нужную директорию: +> !dos2unix и curl на BR-SRV уже скачаны! -***apt install dos2unix -y*** - -***apt install curl -y*** - -***cd /etc/ansible*** - -***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file*** +***curl -o /etc/ansible https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hosts.file*** ***dos2unix /etc/ansible/hosts.file*** From ce7aaf45c1243d2ac4b7c17d7ac0bd7d4c99c495 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:18:37 +0500 Subject: [PATCH 24/28] Update README.md --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 98dc0b5..1eedd18 100644 --- a/README.md +++ b/README.md @@ -1490,24 +1490,22 @@ ________________________________________________________________________________ ***apt install nginx -y*** -Запустите и активируйте Nginx: +2. Запустите и активируйте Nginx: ***systemctl start nginx*** ***systemctl enable nginx*** -2. Настройка Nginx как обратного прокси +3. Настройка Nginx как обратного прокси Создадим конфигурационный файл для сайта в Nginx, в котором настроим виртуальные хосты. Добавьте конфигурацию для проксирования запросов в файл reverse-proxy.conf: -- Скачиваем файл с гит в необходимую директорию: +- Скачиваем файл с github в необходимую директорию: ***apt install dos2unix -y*** ***apt install curl -y*** -***cd /etc/nginx/sites-available*** - -***curl -O https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** +***curl -o /etc/nginx/sites-available https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** ***dos2unix /etc/nginx/sites-available*** @@ -1521,15 +1519,15 @@ ________________________________________________________________________________

-Сохраните файл и закройте редактор. +> Сохраните файл и закройте редактор. -Создайте символическую ссылку на этот файл в папке sites-enabled для активации конфигурации: +- Создайте символическую ссылку на этот файл в папке sites-enabled для активации конфигурации:

-Проверьте конфигурацию Nginx на наличие синтаксических ошибок: +- Проверьте конфигурацию Nginx на наличие синтаксических ошибок:

@@ -1537,9 +1535,9 @@ ________________________________________________________________________________ > на hq-rtr в файле /etc/resolv.conf должно быть прописано dns 192.168.100.2 -*Если конфигурация правильная, вы увидите сообщение syntax is ok.* +> *Если конфигурация правильная, вы увидите сообщение syntax is ok.* -Перезагрузите Nginx, чтобы применить изменения: +- Перезагрузите Nginx, чтобы применить изменения: ***systemctl reload nginx*** From 5792e789f2e619a60debd52d65c46d716bc4e087 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:19:34 +0500 Subject: [PATCH 25/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1eedd18..5660d80 100644 --- a/README.md +++ b/README.md @@ -1507,7 +1507,7 @@ ________________________________________________________________________________ ***curl -o /etc/nginx/sites-available https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/reverse-proxy.conf*** -***dos2unix /etc/nginx/sites-available*** +***dos2unix /etc/nginx/sites-available/reverse-proxy.conf*** - Проверяем его наличие: From 8644fc7eab5b0fc8e53995482a86b02752b6b869 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:20:28 +0500 Subject: [PATCH 26/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5660d80..8cb880c 100644 --- a/README.md +++ b/README.md @@ -682,7 +682,7 @@ ________________________________________________________________________________ ***ls /opt*** -***dos2unix ~/import_users*** +***dos2unix /opt/import_users.sh***

From 44af68a74d3b5cbf66315fec1b3f97afa80f3eb6 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:22:30 +0500 Subject: [PATCH 27/28] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8cb880c..4eb2ebd 100644 --- a/README.md +++ b/README.md @@ -1057,12 +1057,11 @@ ________________________________________________________________________________ 3. В домашней директории пользователя root создаём файл wiki.yml со следующим содержимым: -- Чтобы вручную файл не заполнять просто скачиваем его с github: +- Чтобы вручную файл не заполнять просто скачиваем его с github в нужную директорию: > !dos2unix и curl на BR-SRV уже скачаны! -***cd ~/*** -***curl -O https://raw.githubusercontent.com/4bobus/laba/main/files/wiki.yml*** +***curl -o ~/ https://raw.githubusercontent.com/4bobus/laba/main/files/wiki.yml*** ***dos2unix ~/wiki.yml*** From 844febea0e56f557d6255f34ac7d00b8be400b53 Mon Sep 17 00:00:00 2001 From: 4bobus Date: Mon, 23 Jun 2025 16:26:37 +0500 Subject: [PATCH 28/28] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4eb2ebd..9ddf817 100644 --- a/README.md +++ b/README.md @@ -1681,7 +1681,7 @@ ________________________________________________________________________________

*HQ-RTR*

-- Скачаем готовый nftables.conf с github: +- Скачаем готовый nftables.conf с github, укажем путь для замены нашего nftables: > !dos2unix и curl на HQ-RTR уже скачаны! ***curl -o /etc/nftables.conf https://raw.githubusercontent.com/4bobus/laba/refs/heads/main/files/hq-rtr/nftables.conf*** @@ -1703,7 +1703,7 @@ ________________________________________________________________________________

*BR-RTR *

-- Скачаем готовый nftables.conf с github: +- Скачаем готовый nftables.conf с github, укажем путь для замены нашего nftables: ***apt install dos2unix -y***