Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Linux_pictures/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405185448.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405190706.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405190710.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405190732.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405190745.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405190748.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191030.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191105.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/Pasted image 20250405191206.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/ssh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/ssh2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Linux_pictures/ubuntu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions application/app.py
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 13 additions & 0 deletions configs/client.txt
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions configs/gateway.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions configs/server.txt
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions report.md
Original file line number Diff line number Diff line change
@@ -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]]

Как видно из приложений выше - конфигурация всех машин настроена корректно. Запросы проходит, шлюз работает.