---
# System prepended metadata

title: Practice 5 and 6 OpenVpn L2 L3

---

# Practice 5 and 6 OpenVpn L2 L3

![](https://i.imgur.com/3WspVaS.png)
Настраиваем на Debian-RPi4 мост
![](https://i.imgur.com/L7UZn8b.png)
![](https://i.imgur.com/zaiqUV8.png)
## L3
nano /etc/resolf.conf
![](https://i.imgur.com/RKEmRxW.png)
sudo apt update
![](https://i.imgur.com/4bBZaJq.png)
Скачиваем с гитхаба клиент OpenVpn и ставим его на Kali

![](https://i.imgur.com/3DB1cMK.png)
![](https://i.imgur.com/C22dvzt.png)
![](https://i.imgur.com/1xlSgHf.png)

Редактируем конфиг сервера

![](https://i.imgur.com/oXqdOqm.png)
![](https://i.imgur.com/YQVdphP.png)
![](https://i.imgur.com/7YPXIUt.png)

![](https://i.imgur.com/OwRjhcl.png)

```
apt update -y
scp user@192.168.58.129:/home/user/client.ovpn ./client.conf
```
![](https://i.imgur.com/ALj8vrz.png)

`apt insatll openvpn`

![](https://i.imgur.com/IGso2b3.png)

```
mv client.conf /etc/openvpn/
openvpn /etc/openvpn/client.conf
```
![](https://i.imgur.com/vOTq9rx.png)

Прописываем ip route

![](https://i.imgur.com/s4O9CZ0.png)


![](https://i.imgur.com/RmZBmwG.png)

Создаем client 
`nano client [iroute 192.168.1.0 255.255.255.0]`

![](https://i.imgur.com/J3Yk4kG.png)


![](https://i.imgur.com/elZ9DYv.png)


![](https://i.imgur.com/guJD9XR.png)

![](https://i.imgur.com/gKmV2XG.png)

Результат работы

![](https://i.imgur.com/dPs8UgS.png)
 ## L2
 Настраиваем тоже самое на PRi4
 
```
cd /etc/opoenvpn/
nano server.conf[#dev tun;add(dev tap)]
service openvpn restart
```

 ![](https://i.imgur.com/3yZenI9.png)

```
nao /etc/openvpn/client.conf[#dev tun;add(dev tap)]
service openvpn restart
```

![](https://i.imgur.com/gNASAdS.png)

Добавляем tap0 в bridge

![](https://i.imgur.com/Y31ctfR.png)

`dhclient tap0`
 
![](https://i.imgur.com/IcZH51e.png)

Результат выполнения


![](https://i.imgur.com/cNe5JaI.png)

![](https://i.imgur.com/yCOvMpD.png)

