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
Empty file added application/app.py
Empty file.
Empty file added configs/vmA.yaml
Empty file.
Empty file added configs/vmB.yaml
Empty file.
Empty file added configs/vmC.yaml
Empty file.
Binary file added pictures/flaskapp.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 pictures/iptables.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 pictures/net1.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 pictures/net2.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 pictures/net3.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 pictures/responses.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 pictures/tcpdump_get.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 pictures/tcpdump_post.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 pictures/tcpdump_put.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 pictures/user1.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 pictures/user2.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 pictures/user3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Отчёт по работе №1: Практика Linux (VirtualBox)

## Создание виртуальной машины
1. Создаём виртуальную машину на основе образа <ins>Ubuntu Server</ins>.
2. Клонируем её дважды и настраиваем сетевые адаптеры согласно заданию.
3. Запускаем все три машины и меняем на них hostname и user согласно заданию:
```shell
1. user=pasenko_1, hostname=pasenkoserver для vmA (server);
2. user=pasenko_2, hostname=pasenkogateway для vmB (gateway);
3. user=pasenko_3, hostname=pasenkoclient для vmC (client);
```

## Настройка netplan конфигов
1. Меняем netplan конфиги согласно заданию.
2. Применяем их при помощи:
```shell
sudo netplan apply
```
3. После настройки получаем:

![Netplan конфиг для vmA](pictures/net1.png)
![Netplan конфиг для vmB](pictures/net2.png)
![Netplan конфиг для vmC](pictures/net3.png)

Сами конфиги находятся в configs/, а скриншоты со всех VM в pictures/.

## Настройка VMs по отдельности
1. Начнём с vmA:
1. В app.py *(код приложен в application/)* создаём Flask приложение с тремя эндпоинтами (/get, /post, /put).
2. Под приложение пишем сервис, который будет запускать его через автозагрузку.

![Flask приложение и сервис для его запуска](pictures/flaskapp.png)

2. Перейдем к vmB:
Настраиваем iptables для маршрута пакетов от vmA до vmC и фильтрации пакетов по порту 5000.

![Настроенный iptables](pictures/iptables.png)

## Тестирование
1. Запустим приложение на vmA *(важно проверить, на каких адресах оно работает)*:
```shell
python3 app.py
```
2. Попробуем отправить запрос с vmC по всем роутам для проверки:

![Тестирование приложения с vmC](pictures/responses.png)

Как можно увидеть, vmA успешно отправляет ответ по всем видам запросов.
Дополнительно проверим логи передачи пакетов с vmC на vmA при помощи <ins>tcpdump</ins>:

![Логи по tcpdump, роут get](pictures/tcpdump_get.png)
![Логи по tcpdump, роут post](pictures/tcpdump_post.png)
![Логи по tcpdump, роут put](pictures/tcpdump_put.png)

Представленные скриншоты подтверждают работоспособность системы: все виртуальные машины успешно настроены, связь и фильтрация пакетов налажена, а Flask приложение отрабатывает все запросы.