VyOS - zhovner/zaborona_help GitHub Wiki

1. Входимо в режим конфігурування

configure

2. Завантажуємо ключ та сертифікати в каталог /config/auth

curl -o /config/auth/zaborona-help.crt https://zaborona.help/zaborona-help.crt

curl -o /config/auth/zaborona-help.key https://zaborona.help/zaborona-help.key

curl -o /config/auth/zaborona-help-ca.crt https://zaborona.help/ca.crt

2. Створюємо новий openvpn інтерфейс в режимі клієнта (якщо в системі вже створено інтерфейс "vtun0", введіть інший інтерфейс, наприкалад "vtun1")

set interfaces openvpn vtun0 mode client

set interfaces openvpn vtun0 description --==ZABORONA==--

set interfaces openvpn vtun0 hash sha1

set interfaces openvpn vtun0 encryption aes128

set interfaces openvpn vtun0 remote-port 1196

set interfaces openvpn vtun0 remote-host srv0.vpn.zaboronahelp.pp.ua

set interfaces openvpn vtun0 openvpn-option "--nobind"

set interfaces openvpn vtun0 openvpn-option "--tun-mtu 1500"

set interfaces openvpn vtun0 openvpn-option "--mssfix 1450"

set interfaces openvpn vtun0 openvpn-option "--sndbuf 524288"

set interfaces openvpn vtun0 openvpn-option "--rcvbuf 524288"

set interfaces openvpn vtun0 openvpn-option "--verb 3"

set interfaces openvpn vtun0 tls cert-file /config/auth/zaborona-help.crt

set interfaces openvpn vtun0 tls key-file /config/auth/zaborona-help.key

set interfaces openvpn vtun0 tls ca-cert-file /config/auth/zaborona-help-ca.crt

3. Створюємо правило NAT (якщо в системі вже створено правило NAT за номером "1", введіть інший номер, наприклад "10")

set nat source rule 1 description --==ZABORONA==--

set nat source rule 1 outbound-interface vtun0

set nat source rule 1 translation address masquerade

4. Активуємо конфігурацію, зберігаємо її і виходимо з режиму конфігурування

commit

save

exit

P.S. Перевірити статус в якому знаходиться інтерфейс можно за допомогою команди

show interfaces openvpn vtun0 brief