diff --git a/Linux_pictures/3.png b/Linux_pictures/3.png new file mode 100644 index 0000000..b5c5b79 Binary files /dev/null and b/Linux_pictures/3.png differ diff --git a/Linux_pictures/Pasted image 20250405185448.png b/Linux_pictures/Pasted image 20250405185448.png new file mode 100644 index 0000000..1d8c223 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405185448.png differ diff --git a/Linux_pictures/Pasted image 20250405190706.png b/Linux_pictures/Pasted image 20250405190706.png new file mode 100644 index 0000000..c98ebfb Binary files /dev/null and b/Linux_pictures/Pasted image 20250405190706.png differ diff --git a/Linux_pictures/Pasted image 20250405190710.png b/Linux_pictures/Pasted image 20250405190710.png new file mode 100644 index 0000000..ce238ac Binary files /dev/null and b/Linux_pictures/Pasted image 20250405190710.png differ diff --git a/Linux_pictures/Pasted image 20250405190732.png b/Linux_pictures/Pasted image 20250405190732.png new file mode 100644 index 0000000..4ee1a8d Binary files /dev/null and b/Linux_pictures/Pasted image 20250405190732.png differ diff --git a/Linux_pictures/Pasted image 20250405190745.png b/Linux_pictures/Pasted image 20250405190745.png new file mode 100644 index 0000000..9b2b8f8 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405190745.png differ diff --git a/Linux_pictures/Pasted image 20250405190748.png b/Linux_pictures/Pasted image 20250405190748.png new file mode 100644 index 0000000..aff2633 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405190748.png differ diff --git a/Linux_pictures/Pasted image 20250405191004.png b/Linux_pictures/Pasted image 20250405191004.png new file mode 100644 index 0000000..da73370 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191004.png differ diff --git a/Linux_pictures/Pasted image 20250405191008.png b/Linux_pictures/Pasted image 20250405191008.png new file mode 100644 index 0000000..cad0e37 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191008.png differ diff --git a/Linux_pictures/Pasted image 20250405191016.png b/Linux_pictures/Pasted image 20250405191016.png new file mode 100644 index 0000000..e938c02 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191016.png differ diff --git a/Linux_pictures/Pasted image 20250405191030.png b/Linux_pictures/Pasted image 20250405191030.png new file mode 100644 index 0000000..cc55c67 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191030.png differ diff --git a/Linux_pictures/Pasted image 20250405191105.png b/Linux_pictures/Pasted image 20250405191105.png new file mode 100644 index 0000000..e72707f Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191105.png differ diff --git a/Linux_pictures/Pasted image 20250405191206.png b/Linux_pictures/Pasted image 20250405191206.png new file mode 100644 index 0000000..a5ac689 Binary files /dev/null and b/Linux_pictures/Pasted image 20250405191206.png differ diff --git a/Linux_pictures/ssh.png b/Linux_pictures/ssh.png new file mode 100644 index 0000000..57361c2 Binary files /dev/null and b/Linux_pictures/ssh.png differ diff --git a/Linux_pictures/ssh2.png b/Linux_pictures/ssh2.png new file mode 100644 index 0000000..c775dd7 Binary files /dev/null and b/Linux_pictures/ssh2.png differ diff --git a/Linux_pictures/ubuntu.png b/Linux_pictures/ubuntu.png new file mode 100644 index 0000000..5a7ea86 Binary files /dev/null and b/Linux_pictures/ubuntu.png differ diff --git a/application/app.py b/application/app.py new file mode 100644 index 0000000..9065eee --- /dev/null +++ b/application/app.py @@ -0,0 +1,23 @@ +from flask import Flask, request + +app = Flask(__name__) + +# Эндпоинт для GET-запроса +@app.route('/get', methods=['GET']) +def handle_get(): + return "This is a GET request response." + +# Эндпоинт для POST-запроса +@app.route('/post', methods=['POST']) +def handle_post(): + data = request.json + return f"Received POST data: {data}" + +# Эндпоинт для PUT-запроса +@app.route('/put', methods=['PUT']) +def handle_put(): + data = request.json + return f"Received PUT data: {data}" + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5000) diff --git a/configs/client.txt b/configs/client.txt new file mode 100644 index 0000000..42850e0 --- /dev/null +++ b/configs/client.txt @@ -0,0 +1,13 @@ +network: + ethernets: + enp0s3: # этот интерфейс используем для доступа с ноутбука + dhcp4: true + enp0s9: # этот интерфейс настравиваем на передачу запросов + dhcp4: no + addresses: [192.168.10.10/24] + gateway4: 192.168.10.1 + routes: + - to: 192.168.21.0/24 + via: 192.168.10.1 + metric: 50 + version: 2 \ No newline at end of file diff --git a/configs/gateway.txt b/configs/gateway.txt new file mode 100644 index 0000000..7222872 --- /dev/null +++ b/configs/gateway.txt @@ -0,0 +1,11 @@ +network: + ethernets: + enp0s3: # этот интерфейс используем для доступа с ноутбука + dhcp4: true + enp0s8: # этот интерфейс настравиваем на передачу запросов сервера + dhcp4: no + addresses: [192.168.21.1/24] + enp0s9: # этот интерфейс настравиваем на передачу запросов клиента + dhcp4: no + addresses: [192.168.10.1/24] + version: 2 diff --git a/configs/server.txt b/configs/server.txt new file mode 100644 index 0000000..92be410 --- /dev/null +++ b/configs/server.txt @@ -0,0 +1,13 @@ +network: + ethernets: + enp0s3: + dhcp4: true + enp0s8: + dhcp4: no + addresses: [192.168.21.10/24] + gateway4: 192.168.21.1 + routes: + - to: 192.168.10.0/24 + via: 192.168.21.1 + metric: 50 + version: 2 diff --git a/report.md b/report.md new file mode 100644 index 0000000..ce29477 --- /dev/null +++ b/report.md @@ -0,0 +1,66 @@ +Создадим вирутальную машину и настраиваем ее конфигурацию в Virtual Box. + +![[Pasted image 20250405185448.png]] + +Затем не забыв включить виртуализацию в Bios! запускаем ее и загружаем образ системы "Ubuntu server". Устанавливаем его и запускаем машину. + +![[ubuntu.png]] + +Клонируем машину два раза. Меняем hostname и user в соответствии с заданием, добавляя везде префикс: `bezverkhiy_` + +--- +Пример смены hostname на Linux B через подключение по ssh. + +![[ssh.png]] +![[ssh2.png]] + +Как видно, операция прошла успешно. + +--- +По итогу имеем три виртуальные машины с насроенными адаптерами. Изменяем интерфейсы каждой машины в соответсвии со своим днём рождения 🥳🥳🥳 + +![[3.png]] + +Конфигурационные файлы сетевых настроек виртуальных машин лежат в папке `configs`. + +--- +Разворачиваем Http сервер на виртуальной машине А на порту 5000. Его конфигурация прописана в файле server.txt. + +![[Pasted image 20250405191030.png]] + +Проверяем работу программы: + +![[Pasted image 20250405190706.png]] + +![[Pasted image 20250405190710.png]] + +Программа работает корректно. Настраиваем автозапуск: +![[Pasted image 20250405190732.png]] + +![[Pasted image 20250405190745.png]] + +![[Pasted image 20250405190748.png]] + +Как видно из приложений выше - служба работает корректно. + +--- +Настраиваем маршрутизацию через 5000 порт на gateway. + +![[Pasted image 20250405191004.png]] + +![[Pasted image 20250405191008.png]] + +После перезагрузки результат сохраняется. + +![[Pasted image 20250405191016.png]] + +--- +Настраиваем firewall на машине А для порта 5000. + +![[Pasted image 20250405191105.png]] + +И пробуем отправить запрос с клиента С на машину А. + +![[Pasted image 20250405191206.png]] + +Как видно из приложений выше - конфигурация всех машин настроена корректно. Запросы проходит, шлюз работает. \ No newline at end of file