Error linux route delete command failed could not execute external program

I am getting the above error in instances where my OpenVPN provider resets the connection and changes the ip address of the tun0 device. I am using OpenVPN 2.1.1 i686-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan 5 2010.

mr-4

OpenVpn Newbie
Posts: 6
Joined: Fri Aug 20, 2010 11:16 pm

«could not execute external program» (chroot-ed environment)

I am getting the above error in instances where my OpenVPN provider resets the connection and changes the ip address of the tun0 device. I am using OpenVPN 2.1.1 i686-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan 5 2010.

When the connection is reset, but the ip address is not changed all is well.

I am also getting an error when I terminate OpenVPN (service openvpn stop). I need to mention that I am running OpenVPN in chrooted environment (uid:gid is _openvpn:_openvpn). The root (/) directory is in /var/lib/openvpn

I first thought that it may be a permission problem, but that does not appear to be the case (see below). Any ideas?

Here are my logs (xxx is my openvpn provider external ip address, yyy is my local network internal ip address, zzz is the ip address of the local tun device as assigned by my service provider):

————connection reset, ip (tun0) changed———————
Aug 19 04:44:51 test1 openvpn[6415]: NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.
Aug 19 04:44:51 test1 openvpn[6415]: /sbin/ip route del 239.0.0.0/8
Aug 19 04:44:51 test1 openvpn[6415]: ERROR: Linux route delete command failed: could not execute external program
Aug 19 04:44:51 test1 openvpn[6415]: /sbin/ip route del xxx.xxx.xxx.xxx/32
Aug 19 04:44:51 test1 openvpn[6415]: ERROR: Linux route delete command failed: could not execute external program
Aug 19 04:44:51 test1 openvpn[6415]: /sbin/ip route del 0.0.0.0/1
Aug 19 04:44:51 test1 openvpn[6415]: ERROR: Linux route delete command failed: could not execute external program
Aug 19 04:44:51 test1 openvpn[6415]: /sbin/ip route del 128.0.0.0/1
Aug 19 04:44:51 test1 openvpn[6415]: ERROR: Linux route delete command failed: could not execute external program
Aug 19 04:44:51 test1 openvpn[6415]: Closing TUN/TAP interface
———————————————————————

————service openvpn stop executed——————————
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip route del 239.0.0.0/8
Aug 20 13:04:42 test1 openvpn[1589]: ERROR: Linux route delete command failed: could not execute external program
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip route del yyy.yyy.yyy.yyy/29
Aug 20 13:04:42 test1 openvpn[1589]: ERROR: Linux route delete command failed: could not execute external program
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip route del xxx.xxx.xxx.xxx/32
Aug 20 13:04:42 test1 openvpn[1589]: ERROR: Linux route delete command failed: could not execute external program
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip route del 0.0.0.0/1
Aug 20 13:04:42 test1 openvpn[1589]: ERROR: Linux route delete command failed: could not execute external program
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip route del 128.0.0.0/1
Aug 20 13:04:42 test1 openvpn[1589]: ERROR: Linux route delete command failed: could not execute external program
Aug 20 13:04:42 test1 openvpn[1589]: Closing TUN/TAP interface
Aug 20 13:04:42 test1 openvpn[1589]: /sbin/ip addr del dev tun0 zzz.zzz.zzz.zzz/24
Aug 20 13:04:42 test1 openvpn[1589]: Linux ip addr del failed: could not execute external program
———————————————————————

————connection reset, ip (tun0) NOT changed———————
Aug 18 03:18:23 test1 openvpn[6415]: OPTIONS IMPORT: timers and/or timeouts modified
Aug 18 03:18:23 test1 openvpn[6415]: OPTIONS IMPORT: —ifconfig/up options modified
Aug 18 03:18:23 test1 openvpn[6415]: OPTIONS IMPORT: route options modified
Aug 18 03:18:23 test1 openvpn[6415]: OPTIONS IMPORT: route-related options modified
Aug 18 03:18:23 test1 openvpn[6415]: OPTIONS IMPORT: —ip-win32 and/or —dhcp-option options modified
Aug 18 03:18:23 test1 openvpn[6415]: Preserving previous TUN/TAP instance: tun0
Aug 18 03:18:23 test1 openvpn[6415]: Initialization Sequence Completed
———————————————————————

-bash-4.1# ls -las /var/lib/openvpn/sbin/
total 240
4 drwxr-x—. 2 _openvpn root 4096 Aug 18 01:22 .
4 drwxr-x—. 3 _openvpn root 4096 Aug 18 01:22 ..
232 -rwxr-x—. 1 root _openvpn 233244 Aug 18 01:22 ip


User avatar

ecrist

Forum Team
Posts: 236
Joined: Wed Nov 26, 2008 10:33 pm
Location: Northern Minnesota, USA
Contact:

Re: «could not execute external program» (chroot-ed environm

Post

by ecrist » Sun Aug 22, 2010 1:15 pm

The error seems pretty straight-forward to me, especially since you claim you’re running OpenVPN in a chroot environment. It would appear that your route change commands aren’t able to be executed. Part of this is likely due to the change in privileges due to the user and group change to _openvpn. Does the _openvpn user or group have access to the route command, and rights to change the routing table? Also, does the route command exist within the chroot environment?


mr-4

OpenVpn Newbie
Posts: 6
Joined: Fri Aug 20, 2010 11:16 pm

Re: «could not execute external program» (chroot-ed environm

Post

by mr-4 » Sun Aug 22, 2010 8:52 pm

ecrist wrote:The error seems pretty straight-forward to me, especially since you claim you’re running OpenVPN in a chroot environment. It would appear that your route change commands aren’t able to be executed. Part of this is likely due to the change in privileges due to the user and group change to _openvpn. Does the _openvpn user or group have access to the route command, and rights to change the routing table? Also, does the route command exist within the chroot environment?

I think it has (see the last part of my initial post):

Code: Select all

-bash-4.1# ls -las /var/lib/openvpn/sbin/
total 240
4 drwxr-x---. 2 _openvpn root 4096 Aug 18 01:22 .
4 drwxr-x---. 3 _openvpn root 4096 Aug 18 01:22 ..
232 -rwxr-x---. 1 root _openvpn 233244 Aug 18 01:22 ip

The ‘ip’ program, which is used by OpenVPN to alter the parameters/routing table is present and available to the new root (/var/lib/openvpn) — see above — and it has the correct permissions (rwx as directory owner and rx on the ‘ip’ file as well), at least this is what I think (I stand to be corrected on this as I don’t claim to be an expert in OpenVPN, hence my initial post in this thread).


User avatar

ecrist

Forum Team
Posts: 236
Joined: Wed Nov 26, 2008 10:33 pm
Location: Northern Minnesota, USA
Contact:

Re: «could not execute external program» (chroot-ed environm

Post

by ecrist » Mon Aug 23, 2010 2:37 am

chroot yourself into that dir and try to execute the command. I’ll bet you find you don’t have access to change the routing tables.


mr-4

OpenVpn Newbie
Posts: 6
Joined: Fri Aug 20, 2010 11:16 pm

Re: «could not execute external program» (chroot-ed environm

Post

by mr-4 » Mon Aug 23, 2010 1:56 pm

ecrist wrote:chroot yourself into that dir and try to execute the command. I’ll bet you find you don’t have access to change the routing tables.

How bizarre!

I did try to chroot and I couldn’t, let alone execute ANY command. I tried ‘chroot /var/lib/openvpn’ and it failed with ‘chroot: failed to run command `/bin/bash’: No such file or directory’.

So, I created /var/lib/openvpn/bin and copied ‘bash’ in it, then altered ALL the necessary permissions (enabled o+r+x recursively on /var/lib/openvpn just to make sure) and still no go (note that with the above command I am trying to chroot as root!).

When I try ‘chroot —userspec=_openvpn:_openvpn /var/lib/openvpn’ I get ‘chroot: invalid user’. I get the same message when try ‘chroot —userspec=root:root /var/lib/openvpn’, which I find rather bizarre!

I also tried the numerical values, i.e. ‘chroot —userspec=499:499 /var/lib/openvpn’ (499 = _openvpn in /etc/passwd) — no go: ‘chroot: failed to run command `/bin/bash’: No such file or directory’ error message. I also tried ‘chroot —userspec=0:0 /var/lib/openvpn’ (0 = root) — same error message.

I did also try ‘chroot —userspec=450:450 /var/lib/openvpn’ (450 does NOT correspond to any user registered in /etc/passwd!) — same error message as above, so clearly the numerical values in —userspec are ignored. I also tried —userspec=root, —userspec=_openvpn — same effect: ‘chroot: invalid user’!

As a last resort I tried ‘chroot /var/lib/openvpn /sbin/ip’ — that did not work either (‘chroot: failed to run command `/sbin/ip’: No such file or directory’ error message). What am I missing here?!

All files seem to be present and the permissions were set to o+r+x on all files and directories below and including /var/lib/openvpn, so that should allow me access to anything in these directories, isn’t that right?

When I try ‘su — _openvpn’ (I altered etc/passwd with ‘usermod -d /var/lib/openvpn -s /bin/bash _openvpn’ before that to make sure _openvpn has the right access) I get into /var/lib/openvpn and from there I could happily execute ‘sbin/ip’ — no problems!

So what seems to be wrong?


User avatar

ecrist

Forum Team
Posts: 236
Joined: Wed Nov 26, 2008 10:33 pm
Location: Northern Minnesota, USA
Contact:

Re: «could not execute external program» (chroot-ed environm

Post

by ecrist » Tue Aug 24, 2010 1:26 pm

The problem you’re running in to right now is that your user shell isn’t available inside the chroot. In addition, you need to execute the ip script with it’s relative path once in the chroot. For example, if you’ve got a directory, /chroot, and a script, /chroot/ip.sh, when you chroot yourself, you need to run ‘chroot /ip.sh’ since your new root is within /chroot.

Also, I really don’t think you’re going to be able to change the system routing table from within the chroot.


mr-4

OpenVpn Newbie
Posts: 6
Joined: Fri Aug 20, 2010 11:16 pm

Re: «could not execute external program» (chroot-ed environm

Post

by mr-4 » Thu Aug 26, 2010 2:20 pm

ecrist wrote:The problem you’re running in to right now is that your user shell isn’t available inside the chroot. In addition, you need to execute the ip script with it’s relative path once in the chroot. For example, if you’ve got a directory, /chroot, and a script, /chroot/ip.sh, when you chroot yourself, you need to run ‘chroot /ip.sh’ since your new root is within /chroot.

Well, that is precisely what I am doing — executing /sbin/ip (this is a program, not a script!) as the directory structure is (using your example above) /chroot/sbin/ip, with the appropriate permissions. As for not having the shell (bin/bash or /bin/sh) available — read my previous post — they ARE available in the chrooted tree.

ecrist wrote:
Also, I really don’t think you’re going to be able to change the system routing table from within the chroot.

I decided, as a test, to temporarily remove the chroot restrictions and run openvpn to be constrained just by its own uid:gid (which is _openvpn:_openvpn).

I am getting similar errors:

Code: Select all

Aug 26 04:44:58 test1 openvpn[1582]: NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.
Aug 26 04:44:58 test1 openvpn[1582]: /sbin/ip route del 239.0.0.0/8
Aug 26 04:44:58 test1 openvpn[1582]: ERROR: Linux route delete command failed: external program exited with error status: 2
Aug 26 04:44:58 test1 openvpn[1582]: /sbin/ip route del xxx.xxx.xxx.xxx/32
Aug 26 04:44:58 test1 openvpn[1582]: ERROR: Linux route delete command failed: external program exited with error status: 2
Aug 26 04:44:58 test1 openvpn[1582]: /sbin/ip route del 0.0.0.0/1
Aug 26 04:44:58 test1 openvpn[1582]: ERROR: Linux route delete command failed: external program exited with error status: 2
Aug 26 04:44:58 test1 openvpn[1582]: /sbin/ip route del 128.0.0.0/1
Aug 26 04:44:58 test1 openvpn[1582]: ERROR: Linux route delete command failed: external program exited with error status: 2
Aug 26 04:44:58 test1 openvpn[1582]: Closing TUN/TAP interface
Aug 26 04:44:58 test1 openvpn[1582]: /sbin/ip addr del dev tun0 zzz.zzz.zzz.zzz/24
Aug 26 04:44:58 test1 openvpn[1582]: Linux ip addr del failed: external program exited with error status: 2
Aug 26 04:45:01 test1 openvpn[1582]: Note: Cannot ioctl TUNSETIFF tun0: Operation not permitted (errno=1)

As evident, the program executes this time, but it fails with ‘error status: 2’. What does that mean?
Same question for the last error: ‘Operation not permitted (errno=1)’?


User avatar

ecrist

Forum Team
Posts: 236
Joined: Wed Nov 26, 2008 10:33 pm
Location: Northern Minnesota, USA
Contact:

Re: «could not execute external program» (chroot-ed environm

Post

by ecrist » Thu Aug 26, 2010 2:29 pm

mr-4 wrote:As evident, the program executes this time, but it fails with ‘error status: 2’. What does that mean?
Same question for the last error: ‘Operation not permitted (errno=1)’?

You’d have to look at the man page for the command. I’m guessing user _openvpn doesn’t have permissions to change the routing table.


Приветствую.

Каждую ночь происходит неизвестное, после чего openvpn падает со следующей информацией:

Jul 25 01:58:50 ts0 openvpn[31833]: event_wait : Interrupted system call (code=4)
Jul 25 01:58:50 ts0 openvpn[31833]: TCP/UDP: Closing socket
Jul 25 01:58:50 ts0 openvpn[31833]: /usr/bin/ip route del 10.0.0.0/24
Jul 25 01:58:50 ts0 openvpn[31833]: ERROR: Linux route delete command failed: could not execute external program
Jul 25 01:58:50 ts0 openvpn[31833]: /usr/bin/ip route del 10.0.2.0/24
Jul 25 01:58:50 ts0 openvpn[31833]: ERROR: Linux route delete command failed: could not execute external program
Jul 25 01:58:50 ts0 openvpn[31833]: /usr/bin/ip route del 10.0.1.0/24
Jul 25 01:58:50 ts0 openvpn[31833]: ERROR: Linux route delete command failed: could not execute external program
Jul 25 01:58:50 ts0 openvpn[31833]: Closing TUN/TAP interface
Jul 25 01:58:50 ts0 openvpn[31833]: /usr/bin/ip addr del dev tun0 local 10.0.0.1 peer 10.0.0.2
Jul 25 01:58:50 ts0 openvpn[31833]: Linux ip addr del failed: could not execute external program
Jul 25 01:58:50 ts0 openvpn[31833]: SIGHUP[hard,] received, process restarting
Jul 25 01:58:50 ts0 openvpn[31833]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/server.conf
Jul 25 01:58:50 ts0 openvpn[31833]: Use —help for more information.

Что это может быть, ума не приложу. Может кто-то сталкивался?

Спасибо.


Записан


А что перед этим? Может провайдер передёргивает сеть?


Записан


А что перед этим? Может провайдер передёргивает сеть?

Да не, ничего нет.

Мне интересно, почему он не может выполнить команду и прочитать конфиг. Такое ощущение, что что-то с chroot связано, он же у нас чрутован.


Записан


Я вижу в логе отключение интерфейса, через который идёт openvpn.Мне кажется, что  так-как интерфейс упал, то он слишком рано лезет его восстанавливать, не дождавшись поднятия интерфейса, ну а потом уже «не рыпается».


Записан


Jul 25 01:58:50 ts0 openvpn[31833]: /usr/bin/ip addr del dev tun0 local 10.0.0.1 peer 10.0.0.2
Jul 25 01:58:50 ts0 openvpn[31833]: Linux ip addr del failed: could not execute external program
Jul 25 01:58:50 ts0 openvpn[31833]: SIGHUP[hard,] received, process restarting
Jul 25 01:58:50 ts0 openvpn[31833]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/server.conf

А вот это, может быть связано с chroot


Записан


А вот это, может быть связано с chroot

Дело еще в том, что это guest в KVM, десктоп Cinnamon, на который поставили openvpn. Соответственно, все это крутится под NetworkManager, который непредсказуем.

Есть где-нибудь информация, как безболезненно перейти с NM на etcnet, чтобы в KVM это продолжило работать? Или достаточно просто etcnet поставить?


Записан


Теоретически — поставить etcnet , передать управление ему и настроить.


Записан


Теоретически — поставить etcnet , передать управление ему и настроить.

Проверил, в конфиге CONFMETHOD=etcnet

Тогда вообще непонятно, что с сетью происходит. Кстати, systemctl почему-то не хочет перезапускать openvpn, повисает на старте, как будто не форкается. А если запусттиь напрямую /etc/init.d/openvpn start, то всё в порядке.


Записан


Кстати, systemctl почему-то не хочет перезапускать openvpn

Не надо средствами systemd делать.
 Для systemd штатное управление сети ни через NetworkManager и не через etcnet — у него есть своя служба (не помню — типа networking). Делайте через acc.


Записан



Записан


Вот тут что-то есть:

Спасибо.

Похоже, дело в этом еще. Почему-то ask-password запускается и хочет пароль, когда я из удаленного ssh перезапускаю openvpn с помощью systemctl:

[pid  3016] stat(«/run/systemd/ask-password-block», {st_mode=S_IFDIR|0700, st_size=60, …}) = 0
[pid  3016] mknod(«/run/systemd/ask-password-block/136:1», S_IFIFO|0600) = -1 EEXIST (File exists)
[pid  3016] open(«/run/systemd/ask-password-block/136:1», O_RDONLY|O_NOCTTY|O_NONBLOCK|O_CLOEXEC) = 3
[pid  3016] stat(«/run/systemd», {st_mode=S_IFDIR|0755, st_size=420, …}) = 0
[pid  3016] mkdir(«/run/systemd/ask-password», 0755) = -1 EEXIST (File exists)
[pid  3016] stat(«/run/systemd/ask-password», {st_mode=S_IFDIR|0755, st_size=40, …}) = 0

Осталось найти, почему он это хочет и как ему это оторвать. Все-таки на desktop-е запускать ovpn не самая лучшая идея, но и выносить его в host тоже не хочется.


Записан


Нашел такое:

systemd-ask-password-plymouth.path                                                        loaded active waiting   Forward Password Requests to Plymouth Directory Watch

Но почему к нему идет обращение при запуске openvpn, не очень понятно. Как и не нашел еще, как от этого отучить его.


Записан


Удалил plymouth, стало запускаться. Посмотрим, будет ли оно теперь падать или нет.


Записан


Содержание

  1. Не может подключится сервер к openVPN серверу
  2. Маршрут
  3. OpenVPN Support Forum
  4. [Solved] Routing not working, can’t connect to lan devices
  5. [Solved] Routing not working, can’t connect to lan devices
  6. Re: Routing not working, can’t connect to lan devices
  7. Re: Routing not working, can’t connect to lan devices
  8. OpenVPN Support Forum
  9. [Solved]CCD
  10. [Solved]CCD
  11. Re: CCD
  12. Re: CCD
  13. Re: CCD
  14. Re: CCD
  15. Re: CCD
  16. Re: CCD
  17. Re: CCD
  18. Re: CCD
  19. Re: CCD
  20. Re: CCD
  21. Не запускается OpenVPN

Не может подключится сервер к openVPN серверу

Входные данные: Первый сервер, далее vpn_1 Второй сервер, далее vpn_2. Все сервера работают под Debian 10 и настроены по этому мануалу: https://www.8host.com/blog/nastrojka-servera-openvpn-v-debian-10/

После того как поднял несколько серверов с openVPN проверял работоспособность. К каждому VPN серверу клиент может подключиться.

Теперь пытаюсь vpn_1 сервер подключить к vpn_2 серверу, после чего терминал зависает, логи:

server_vpn1#: openvpn —client —config ./config.ovpn

Схема, которую хочу получить: client1->vpn_1->vpn_2->internet

Что-то не работает разметка сообщений. Только code работает

Спасибо за ответ, очень информативный.

p.s теги не работают, копирую примеры с разметки тоже самое.

Вот видишь, ты уже совершенствуешься, респект. Конфиги не читал, хоть и стало красиво. Вангую, терминал виснет потому, что сервер1 получает дефолтный маршрут и начинает гнать трафик к клиенту через сервер2, что, конечно, ломает существующее подключение.

Маршрут

Походу так и есть, проверил логи на server_2 и там показывает что клиент подключился, проблема с маршрутом, только не понимаю как исправить это.

После того как закрыл подключение к server_2 vpn и когда вернулся терминал к работе остался этот маршрут:

Логи при подключении к server_2

Возможно, проблема в том Что используются все tun0, укажи другой.

Менял на tun0,1,2, тоже самое.

только не понимаю как исправить это.

Проблему с чем? Вы можете описать чего достичь хотите?

Получилось подключится server_1 -> server_2 и трафик ходит правильно server_1 -> server_2 -> internet. Вот только перестал подключаться клиент к server_1:

Когда пытаюсь подключится к серверу в логах есть информация о клиенте:

Когда разорвал соединение между server_1 и server_2 клиент подключится автоматично:

p.s. openvpn писал что должен добавить к конфигурации float, не вникал зачем это.

Мне кажется что после подключения server_1 -> server_2, client не может подключится к server_1, так как теперь весь трафик ходит через server_2.

Думал что весь трафик пересылается к серверу_2 и поэтому подменил сертификаты с client_сервера_2 к конфигу client_server_1.ovpn, но тогда начал получать логи типа: Authenticate/Decrypt packet error: packet HMAC authentication failed

Схема, которую хочу получить: client1->vpn_1->vpn_2->internet

Покажите с сервер 1 выхлопы

# ip r s table all

Сегодня переключился на Ubuntu на клиенской машине и попытался подключится, оказывается тут больше логов чем на windows:

После того как добавил —float, клиент подключился, но без интернета.

Логи с server_1:

client local ip wlo1: 192.168.0.129

Стало лучше, частично появился интернет. Телеграм работает, вайбер — нет. Так же с сайтами: 2ip.ru — нет google — да speedtest.net — нет linux.org.ru — да

И это подключение получается только с параметром float, без него будет ошибка:

в конфиги ovpn mssfix 1200 пишу от балды с перезакладом но вполне должно работать

Спасибо Вам! На linux’e Все работает отлично. Есть только странные логи на сервере (каждую секунду такие логи кидает):

несмотря на логи с packet dropped все работает на Ubuntu.

Пытался так же подключится с windows и mac к серверу_1, но проблема все еще привствует. server log:

client windows log part 1:

TLS Error: TLS key negotiation failed

Как бэ намекает.

Тот же конфиг на Ubuntu работает, а на остальных система нет.

Проблема присутствует только тогда, когда server_1 подключен к server_2 для Windows

Тот же конфиг на Ubuntu работает, а на остальных система нет.

У вас пути до сертов &etc как прописаны, полный путь или нет? Попробуйте для начала прописать полные пути.

Проблема присутствует только тогда, когда server_1 подключен к server_2 для Windows

Не распарсил. Поясните плиз.

Проблема с подключением клиента к сервер_1, есть только в случае, если server_1 подключен к server_2. Клиент на виндовсе не может подключиться к впн. Так только я отключаю подключение между серверами, клиент автоматически подключается к сервер_1.

У вас пути до сертов &etc как прописаны, полный путь или нет? Попробуйте для начала прописать полные пути.

Вы говорите о сертификатах в конфиге? — есла да, сертификаты находятся вместе с конфигом внутри.

На всякий случай уточню, когда проверяете у вас случайно server_1 и клиент не в одной локалке находятся?

Нет, все в разных сетях. Сервера имеют выделенный ИР в разных сетях, а клиент выходит с роутера с обычного домашнего провайдера.

Клиент спокойно подключается к отдельным серверам без проблем (когда нет подключения между server_1 и server_2)

Вот смущает это:
—cipher set to ‘AES-256-CBC’ but missing in —data-ciphers (AES-256-GCM:AES-128-GCM)
У вас версии openssl и openvpn между офтопик и онтопик не сильно разные ?

Здравствуй, здравствуй, anc мордастый 😉 /Шутка/
Не смущайтесь, это всего лишь эхо …

Ну и по отдельности все же работает. Клиент с виндовс может подключиться к server_1 или server_2.

Есть идеи у Вас?

На всякий случай обобщу текущую ситуацию:
1. На любых других системах кроме виндоус работает.
2. Подобная ситуация возникает только на виндоус. Тут уточняющий вопрос, на любой или это конкретная машинка?
3. В случае если разорвать тунель между сервер1 и сервер2 то начинает работать и на этой винде
4. Винда так же как и другие клиенты находиться «где-то в инете»
5. Сервер1 и Сервер2 с 09.08.21 09:54:08 не перезагружались.

Почти все верно, на apple mac тоже не работает, вместе с виндой.

Ничего не вижу 🙁 Давайте ещё раз выхлопы посмотрим с server1:
ip r s table all
ip ru
iptables-save

Я нашел мануал тот что мне нужно, на основе первого мануала, может ресетнуть сервера и еще раз попытаться, только по нормальному мануалу сделать: https://gist.github.com/gushmazuko/a74debe24bcabb0bbedf5695cb703a12 ?

В мануале уже видно, что разница в конфигах есть, а у меня ее нет. Может поэтому различные проблемы с подключением и с логами Bad packet..

Источник

OpenVPN Support Forum

Community Support Forum

[Solved] Routing not working, can’t connect to lan devices

[Solved] Routing not working, can’t connect to lan devices

Post by robster » Sat Nov 11, 2017 2:42 pm

I set up my openVPN server and clients are able to connect.

I would like to enable the clients to access the other devices in my lan.

Therefor I enabled IP Forwarding and added the push route in my openvpn.conf, which looks like:

My goal is that clients will be members of the 192.168.0.0 subnet and access other devices in that subnet.

When my client connects this is the log:

Once connected my client can access the internet and gets the WAN IP of my server, but the client is not able to connect to other lan devices.

What am I missing here? Where can I continue looking?

Any help is very much appriciated!

Re: Routing not working, can’t connect to lan devices

Post by TinCanTech » Sat Nov 11, 2017 3:04 pm

NOTE:

  • Your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.

Never use 192.168.0.0/24 or 192.168.1.0/24 (or other common subnets) for your OpenVPN Server LAN

  • You are advised to change your server LAN to a more unique RFC1918 compliant subnet.
    For example: 192.168.143.0/24

That could be the reason ..

Please post your client log at —verb 4

Re: Routing not working, can’t connect to lan devices

Post by robster » Sat Nov 11, 2017 7:36 pm

Thanks for the advice. I will change the subnet at some point. But for now it would be too much effort and I consider it rather a last option before I go crazy

This is the server log at verbose 4 when my client connects.

Источник

OpenVPN Support Forum

Community Support Forum

[Solved]CCD

[Solved]CCD

Post by corsairetc » Wed May 06, 2015 10:11 am

Hello,
I have working configuration with ccd directive, but I am only able to ping from server LAN (192.168.2.0) to client LAN (192.168.10.0) to client (192.168.10.1) not to other hosts in LAN 192.168.10.0

I solved previous thread topic18746.html

Re: CCD

Post by Traffic » Wed May 06, 2015 10:30 am

The least you could do is post your new configs ..

Re: CCD

Post by corsairetc » Wed May 06, 2015 11:04 am

Re: CCD

Post by maikcat » Wed May 06, 2015 11:12 am

did you enabled ip forwarding on your client?

also please post your current configs used & contents of ccd files.

Re: CCD

Post by corsairetc » Wed May 06, 2015 11:38 am

Re: CCD

Post by maikcat » Wed May 06, 2015 12:11 pm

reconnect and check if your client has .22 ip

also use the full path to your ccd directory in your server config

Re: CCD

Post by corsairetc » Wed May 06, 2015 12:34 pm

Re: CCD

Post by maikcat » Wed May 06, 2015 12:49 pm

the ifconfig-push line should be entered in your ccd file not server.conf.

Re: CCD

Post by corsairetc » Mon May 11, 2015 4:59 am

Re: CCD

Post by maikcat » Mon May 11, 2015 5:27 am

ok from a pc on your client side try to:

ping clients lan ip
ping client vpn ip
ping servers vpn ip
ping servers lan ip

post the results please.

Re: CCD

Post by corsairetc » Tue May 12, 2015 5:36 am

ping clients lan ip — pass
ping client vpn ip — pass
ping servers vpn ip — pass
ping servers lan ip — pass

Now it start ping from server to pc in client vpn lan and reverse.

Last thing which I need is hoe to provide my own dnmasq dhcp&dns to vpn.

Источник

Не запускается OpenVPN

Добрый день! Пытаюсь настроить OpenVPN на удаленном сервере. После всех настроек, при запуске сервиса выдает сбой. В логе видны некоторые ошибки, но их природа не вполне понятна, ровно как и способ их устранения. Если кто сталкивался с таким, буду очень благодарен за помощь. Версия openvpn 2.3.2, дистр CentOS 6.5. Лог прилагается

Tue Oct 7 22:58:24 2014 event_wait : Interrupted system call (code=4) Tue Oct 7 22:58:24 2014 /sbin/ip route del 10.84.84.0/24 RTNETLINK answers: Operation not permitted Tue Oct 7 22:58:24 2014 ERROR: Linux route delete command failed: external program exited with error status: 2 Tue Oct 7 22:58:24 2014 Closing TUN/TAP interface Tue Oct 7 22:58:24 2014 /sbin/ip addr del dev tun0 local 10.84.84.1 peer 10.84.84.2 RTNETLINK answers: Operation not permitted Tue Oct 7 22:58:24 2014 Linux ip addr del failed: external program exited with error status: 2 Tue Oct 7 22:58:25 2014 SIGTERM[hard,] received, process exiting Tue Oct 7 22:58:26 2014 OpenVPN 2.3.2 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Sep 12 2013 Tue Oct 7 22:58:26 2014 Diffie-Hellman initialized with 2048 bit key Tue Oct 7 22:58:26 2014 Socket Buffers: R=[124928->131072] S=[124928->131072] Tue Oct 7 22:58:26 2014 ROUTE_GATEWAY 37.1.216.211 Tue Oct 7 22:58:26 2014 TUN/TAP device tun0 opened Tue Oct 7 22:58:26 2014 TUN/TAP TX queue length set to 100 Tue Oct 7 22:58:26 2014 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0 Tue Oct 7 22:58:26 2014 /sbin/ip link set dev tun0 up mtu 1500 Tue Oct 7 22:58:26 2014 /sbin/ip addr add dev tun0 local 10.84.84.1 peer 10.84.84.2 Tue Oct 7 22:58:26 2014 /sbin/ip route add 10.84.84.0/24 via 10.84.84.2 Tue Oct 7 22:58:26 2014 GID set to openvpn Tue Oct 7 22:58:26 2014 UID set to openvpn Tue Oct 7 22:58:26 2014 UDPv4 link local (bound): [undef] Tue Oct 7 22:58:26 2014 UDPv4 link remote: [undef] Tue Oct 7 22:58:26 2014 MULTI: multi_init called, r=256 v=256 Tue Oct 7 22:58:26 2014 IFCONFIG POOL: base=10.84.84.4 size=62, ipv6=0 Tue Oct 7 22:58:26 2014 IFCONFIG POOL LIST Tue Oct 7 22:58:26 2014 Initialization Sequence Completed

Источник

So I set up OpenVPN following this guide, https://www.highlnk.com/2013/12/configuring-openvpn-on-pfsense/

For Tunnel Network, I put «10.0.8.0/24» and I set local network to «192.168.10.0/24» (My LAN interface already uses subnet 192.168.10 …so I am not sure if I that will cause a conflict). Everything else is set up in the way of the guide except for the Dynamic DNS part (I am using same static IP assigned to pfsense WAN…that shouldnt cause a conflict I would think). Now the first time I tried connecting I used this command on my arch linux computer «sudo openvpn —config myconfignamehere.ovpn» and it worked out fine, I used wireshark to check if my data was encrypted and I used the route command to check my IPs and gateways, no errors in terminal either. Now its been a few days (Only I connect) when I use the same command I still get connected to the VPN and encryption is fine but I get this error message

ERROR: Linux route delete command failed: external program exited with error status: 2

Here is the full output when running the command I listed above,

sudo openvpn --config myconfigfile.ovpn 
[sudo] password for joobala: 
Tue Jan 20 21:58:14 2015 OpenVPN 2.3.6 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Dec  2 2014
Tue Jan 20 21:58:14 2015 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Enter Auth Username: *****************************
Enter Auth Password: ******************************
Tue Jan 20 21:58:19 2015 Control Channel Authentication: tls-auth using INLINE static key file
Tue Jan 20 21:58:19 2015 UDPv4 link local (bound): [undef]
Tue Jan 20 21:58:19 2015 UDPv4 link remote: [AF_INET]MYEXTERNALIPHERE:1194
Tue Jan 20 21:58:19 2015 [myconfigfile] Peer Connection Initiated with [AF_INET]MYEXTERNALIPHERE:1194
Tue Jan 20 21:58:21 2015 TUN/TAP device tun0 opened
Tue Jan 20 21:58:21 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Jan 20 21:58:21 2015 /usr/bin/ip link set dev tun0 up mtu 1500
Tue Jan 20 21:58:21 2015 /usr/bin/ip addr add dev tun0 local 10.0.8.6 peer 10.0.8.5
RTNETLINK answers: File exists
Tue Jan 20 21:58:21 2015 ERROR: Linux route add command failed: external program exited with error status: 2
Tue Jan 20 21:58:21 2015 Initialization Sequence Completed

.ovpn config file

dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA1
tls-client
client
remote MYEXTERNALIP 1194 udp
lport 0
verify-x509-name "myconfigfile" name
auth-user-pass
auth-nocache
ns-cert-type server
comp-lzo adaptive

 <ca>-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----</ca> 
 <cert>-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----</cert> 
 <key>-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----</key> 
 <tls-auth>#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----</tls-auth> 
 key-direction 1

Now I dont know if this is client or server related, I tried looking for /usr/bin/ip link but nothing on the client machine….I also read online somewhere that this has to do with the server. Anyway, whats the fix?

После того как поднял несколько серверов с openVPN проверял работоспособность. К каждому VPN серверу клиент может подключиться.

Теперь пытаюсь vpn_1 сервер подключить к vpn_2 серверу, после чего терминал зависает, логи:

Sat Jul 31 18:17:29 2021 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 28 2021
Sat Jul 31 18:17:29 2021 library versions: OpenSSL 1.1.1d  10 Sep 2019, LZO 2.10
Sat Jul 31 18:17:29 2021 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sat Jul 31 18:17:29 2021 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sat Jul 31 18:17:29 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]server_vpn2:1194
Sat Jul 31 18:17:29 2021 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Jul 31 18:17:29 2021 UDP link local: (not bound)
Sat Jul 31 18:17:29 2021 UDP link remote: [AF_INET]server_vpn2:1194
Sat Jul 31 18:17:29 2021 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Jul 31 18:17:29 2021 TLS: Initial packet from [AF_INET]server_vpn2:1194, sid=9ddc72fa ddd275ca
Sat Jul 31 18:17:29 2021 VERIFY OK: depth=1, CN=Easy-RSA CA
Sat Jul 31 18:17:29 2021 VERIFY KU OK
Sat Jul 31 18:17:29 2021 Validating certificate extended key usage
Sat Jul 31 18:17:29 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Sat Jul 31 18:17:29 2021 VERIFY EKU OK
Sat Jul 31 18:17:29 2021 VERIFY OK: depth=0, CN=server
Sat Jul 31 18:17:30 2021 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Sat Jul 31 18:17:30 2021 [server] Peer Connection Initiated with [AF_INET]server_vpn2:1194
Sat Jul 31 18:17:31 2021 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Sat Jul 31 18:17:31 2021 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,block-outside-dns,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5,peer-id 0,cipher AES-256-GCM'
Sat Jul 31 18:17:31 2021 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:4: block-outside-dns (2.4.7)
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: route options modified
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: peer-id set
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: adjusting link_mtu to 1624
Sat Jul 31 18:17:31 2021 OPTIONS IMPORT: data channel crypto options modified
Sat Jul 31 18:17:31 2021 Data Channel: using negotiated cipher 'AES-256-GCM'
Sat Jul 31 18:17:31 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:17:31 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:17:31 2021 ROUTE_GATEWAY server_vpn1/255.255.255.0 IFACE=eth0 HWADDR=22:54:00:fc:3b:b1
Sat Jul 31 18:17:31 2021 TUN/TAP device tun0 opened
Sat Jul 31 18:17:31 2021 TUN/TAP TX queue length set to 100
Sat Jul 31 18:17:31 2021 /sbin/ip link set dev tun0 up mtu 1500
Sat Jul 31 18:17:31 2021 /sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Sat Jul 31 18:17:31 2021 /sbin/ip route add server_vpn2/32 via server_vpn1
Sat Jul 31 18:17:31 2021 /sbin/ip route add 0.0.0.0/1 via 10.8.0.5
Sat Jul 31 18:17:31 2021 /sbin/ip route add 128.0.0.0/1 via 10.8.0.5
Sat Jul 31 18:17:31 2021 /sbin/ip route add 10.8.0.1/32 via 10.8.0.5
Sat Jul 31 18:17:31 2021 GID set to nogroup
Sat Jul 31 18:17:31 2021 UID set to nobody
Sat Jul 31 18:17:31 2021 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sat Jul 31 18:17:31 2021 Initialization Sequence Completed
Sat Jul 31 18:21:34 2021 [server] Inactivity timeout (--ping-restart), restarting
Sat Jul 31 18:21:34 2021 SIGUSR1[soft,ping-restart] received, process restarting
Sat Jul 31 18:21:34 2021 Restart pause, 5 second(s)
Sat Jul 31 18:21:39 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]server_vpn2:1194
Sat Jul 31 18:21:39 2021 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Jul 31 18:21:39 2021 UDP link local: (not bound)
Sat Jul 31 18:21:39 2021 UDP link remote: [AF_INET]server_vpn2:1194
Sat Jul 31 18:21:39 2021 TLS: Initial packet from [AF_INET]server_vpn2:1194, sid=c839268b 87b99781
Sat Jul 31 18:21:39 2021 VERIFY OK: depth=1, CN=Easy-RSA CA
Sat Jul 31 18:21:39 2021 VERIFY KU OK
Sat Jul 31 18:21:39 2021 Validating certificate extended key usage
Sat Jul 31 18:21:39 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Sat Jul 31 18:21:39 2021 VERIFY EKU OK
Sat Jul 31 18:21:39 2021 VERIFY OK: depth=0, CN=server
Sat Jul 31 18:21:39 2021 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Sat Jul 31 18:21:39 2021 [server] Peer Connection Initiated with [AF_INET]server_vpn2:1194
Sat Jul 31 18:21:40 2021 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Sat Jul 31 18:21:40 2021 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,block-outside-dns,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5,peer-id 0,cipher AES-256-GCM'
Sat Jul 31 18:21:40 2021 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:4: block-outside-dns (2.4.7)
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: route options modified
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: peer-id set
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: adjusting link_mtu to 1624
Sat Jul 31 18:21:40 2021 OPTIONS IMPORT: data channel crypto options modified
Sat Jul 31 18:21:40 2021 Data Channel: using negotiated cipher 'AES-256-GCM'
Sat Jul 31 18:21:40 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:21:40 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:21:40 2021 Preserving previous TUN/TAP instance: tun0
Sat Jul 31 18:21:40 2021 Initialization Sequence Completed
Sat Jul 31 18:26:02 2021 [server] Inactivity timeout (--ping-restart), restarting
Sat Jul 31 18:26:02 2021 SIGUSR1[soft,ping-restart] received, process restarting
Sat Jul 31 18:26:02 2021 Restart pause, 5 second(s)
Sat Jul 31 18:26:07 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]server_vpn2:1194
Sat Jul 31 18:26:07 2021 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Jul 31 18:26:07 2021 UDP link local: (not bound)
Sat Jul 31 18:26:07 2021 UDP link remote: [AF_INET]server_vpn2:1194
Sat Jul 31 18:26:07 2021 TLS: Initial packet from [AF_INET]server_vpn2:1194, sid=a3b0f535 1ec34abd
Sat Jul 31 18:26:07 2021 VERIFY OK: depth=1, CN=Easy-RSA CA
Sat Jul 31 18:26:07 2021 VERIFY KU OK
Sat Jul 31 18:26:07 2021 Validating certificate extended key usage
Sat Jul 31 18:26:07 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Sat Jul 31 18:26:07 2021 VERIFY EKU OK
Sat Jul 31 18:26:07 2021 VERIFY OK: depth=0, CN=server
Sat Jul 31 18:26:07 2021 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Sat Jul 31 18:26:07 2021 [server] Peer Connection Initiated with [AF_INET]server_vpn2:1194
Sat Jul 31 18:26:08 2021 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Sat Jul 31 18:26:08 2021 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 208.67.222.222,dhcp-option DNS 208.67.220.220,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5,peer-id 1,cipher AES-256-GCM'
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: route options modified
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: peer-id set
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: adjusting link_mtu to 1624
Sat Jul 31 18:26:08 2021 OPTIONS IMPORT: data channel crypto options modified
Sat Jul 31 18:26:08 2021 Data Channel: using negotiated cipher 'AES-256-GCM'
Sat Jul 31 18:26:08 2021 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:26:08 2021 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sat Jul 31 18:26:08 2021 Preserving previous TUN/TAP instance: tun0
Sat Jul 31 18:26:08 2021 NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.
Sat Jul 31 18:26:08 2021 /sbin/ip route del 10.8.0.1/32
Sat Jul 31 18:26:08 2021 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 31 18:26:08 2021 /sbin/ip route del server_vpn2/32
Sat Jul 31 18:26:08 2021 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 31 18:26:08 2021 /sbin/ip route del 0.0.0.0/1
Sat Jul 31 18:26:08 2021 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 31 18:26:08 2021 /sbin/ip route del 128.0.0.0/1
Sat Jul 31 18:26:08 2021 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 31 18:26:08 2021 Closing TUN/TAP interface
Sat Jul 31 18:26:08 2021 /sbin/ip addr del dev tun0 local 10.8.0.6 peer 10.8.0.5
Sat Jul 31 18:26:08 2021 Linux ip addr del failed: external program exited with error status: 2
Sat Jul 31 18:26:09 2021 ROUTE_GATEWAY server_vpn1/255.255.255.0 IFACE=eth0 HWADDR=22:54:00:fc:3b:b1
Sat Jul 31 18:26:09 2021 ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Sat Jul 31 18:26:09 2021 Exiting due to fatal error[.code]


Конфиг vpn_1 и vpn_2 server.conf:
port 1194 / 443 (vpn_2)
 
proto udp / tcp (vpn_2)

dev tun

ca ca.crt
cert vpn_1.crt
key vpn_1.key  

dh dh.pem

server 10.8.0.0 255.255.255.0

push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
push "block-outside-dns"

keepalive 10 120

tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-256-CBC
auth SHA256

user nobody
group nogroup

persist-key
persist-tun

verb 0

explicit-exit-notify 1
client

dev tun

proto tcp

remote server_vpn1 443

resolv-retry infinite

nobind

user nobody
group nogroup

persist-key
persist-tun

remote-cert-tls server

cipher AES-256-CBC
auth SHA256
key-direction 1


script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

verb 3

<ca>
...
</ca>
<cert>
...
</cert>
<key>
...
</key>
<tls-auth>
...
</tls-auth>

Что-то не работает разметка сообщений. Только code работает

Содержание

  1. Не может подключится сервер к openVPN серверу
  2. Маршрут
  3. OpenVPN Support Forum
  4. [Solved] Routing not working, can’t connect to lan devices
  5. [Solved] Routing not working, can’t connect to lan devices
  6. Re: Routing not working, can’t connect to lan devices
  7. Re: Routing not working, can’t connect to lan devices
  8. OpenVPN Support Forum
  9. ERROR: Linux route add command failed: external program exited with error status: 1
  10. ERROR: Linux route add command failed: external program exited with error status: 1

Не может подключится сервер к openVPN серверу

Входные данные: Первый сервер, далее vpn_1 Второй сервер, далее vpn_2. Все сервера работают под Debian 10 и настроены по этому мануалу: https://www.8host.com/blog/nastrojka-servera-openvpn-v-debian-10/

После того как поднял несколько серверов с openVPN проверял работоспособность. К каждому VPN серверу клиент может подключиться.

Теперь пытаюсь vpn_1 сервер подключить к vpn_2 серверу, после чего терминал зависает, логи:

server_vpn1#: openvpn —client —config ./config.ovpn

Схема, которую хочу получить: client1->vpn_1->vpn_2->internet

Что-то не работает разметка сообщений. Только code работает

Спасибо за ответ, очень информативный.

p.s теги не работают, копирую примеры с разметки тоже самое.

Вот видишь, ты уже совершенствуешься, респект. Конфиги не читал, хоть и стало красиво. Вангую, терминал виснет потому, что сервер1 получает дефолтный маршрут и начинает гнать трафик к клиенту через сервер2, что, конечно, ломает существующее подключение.

Маршрут

Походу так и есть, проверил логи на server_2 и там показывает что клиент подключился, проблема с маршрутом, только не понимаю как исправить это.

После того как закрыл подключение к server_2 vpn и когда вернулся терминал к работе остался этот маршрут:

Логи при подключении к server_2

Возможно, проблема в том Что используются все tun0, укажи другой.

Менял на tun0,1,2, тоже самое.

только не понимаю как исправить это.

Проблему с чем? Вы можете описать чего достичь хотите?

Получилось подключится server_1 -> server_2 и трафик ходит правильно server_1 -> server_2 -> internet. Вот только перестал подключаться клиент к server_1:

Когда пытаюсь подключится к серверу в логах есть информация о клиенте:

Когда разорвал соединение между server_1 и server_2 клиент подключится автоматично:

p.s. openvpn писал что должен добавить к конфигурации float, не вникал зачем это.

Мне кажется что после подключения server_1 -> server_2, client не может подключится к server_1, так как теперь весь трафик ходит через server_2.

Думал что весь трафик пересылается к серверу_2 и поэтому подменил сертификаты с client_сервера_2 к конфигу client_server_1.ovpn, но тогда начал получать логи типа: Authenticate/Decrypt packet error: packet HMAC authentication failed

Схема, которую хочу получить: client1->vpn_1->vpn_2->internet

Покажите с сервер 1 выхлопы

# ip r s table all

Сегодня переключился на Ubuntu на клиенской машине и попытался подключится, оказывается тут больше логов чем на windows:

После того как добавил —float, клиент подключился, но без интернета.

Логи с server_1:

client local ip wlo1: 192.168.0.129

Стало лучше, частично появился интернет. Телеграм работает, вайбер — нет. Так же с сайтами: 2ip.ru — нет google — да speedtest.net — нет linux.org.ru — да

И это подключение получается только с параметром float, без него будет ошибка:

в конфиги ovpn mssfix 1200 пишу от балды с перезакладом но вполне должно работать

Спасибо Вам! На linux’e Все работает отлично. Есть только странные логи на сервере (каждую секунду такие логи кидает):

несмотря на логи с packet dropped все работает на Ubuntu.

Пытался так же подключится с windows и mac к серверу_1, но проблема все еще привствует. server log:

client windows log part 1:

TLS Error: TLS key negotiation failed

Как бэ намекает.

Тот же конфиг на Ubuntu работает, а на остальных система нет.

Проблема присутствует только тогда, когда server_1 подключен к server_2 для Windows

Тот же конфиг на Ubuntu работает, а на остальных система нет.

У вас пути до сертов &etc как прописаны, полный путь или нет? Попробуйте для начала прописать полные пути.

Проблема присутствует только тогда, когда server_1 подключен к server_2 для Windows

Не распарсил. Поясните плиз.

Проблема с подключением клиента к сервер_1, есть только в случае, если server_1 подключен к server_2. Клиент на виндовсе не может подключиться к впн. Так только я отключаю подключение между серверами, клиент автоматически подключается к сервер_1.

У вас пути до сертов &etc как прописаны, полный путь или нет? Попробуйте для начала прописать полные пути.

Вы говорите о сертификатах в конфиге? — есла да, сертификаты находятся вместе с конфигом внутри.

На всякий случай уточню, когда проверяете у вас случайно server_1 и клиент не в одной локалке находятся?

Нет, все в разных сетях. Сервера имеют выделенный ИР в разных сетях, а клиент выходит с роутера с обычного домашнего провайдера.

Клиент спокойно подключается к отдельным серверам без проблем (когда нет подключения между server_1 и server_2)

Вот смущает это:
—cipher set to ‘AES-256-CBC’ but missing in —data-ciphers (AES-256-GCM:AES-128-GCM)
У вас версии openssl и openvpn между офтопик и онтопик не сильно разные ?

Здравствуй, здравствуй, anc мордастый 😉 /Шутка/
Не смущайтесь, это всего лишь эхо …

Ну и по отдельности все же работает. Клиент с виндовс может подключиться к server_1 или server_2.

Есть идеи у Вас?

На всякий случай обобщу текущую ситуацию:
1. На любых других системах кроме виндоус работает.
2. Подобная ситуация возникает только на виндоус. Тут уточняющий вопрос, на любой или это конкретная машинка?
3. В случае если разорвать тунель между сервер1 и сервер2 то начинает работать и на этой винде
4. Винда так же как и другие клиенты находиться «где-то в инете»
5. Сервер1 и Сервер2 с 09.08.21 09:54:08 не перезагружались.

Почти все верно, на apple mac тоже не работает, вместе с виндой.

Ничего не вижу 🙁 Давайте ещё раз выхлопы посмотрим с server1:
ip r s table all
ip ru
iptables-save

Я нашел мануал тот что мне нужно, на основе первого мануала, может ресетнуть сервера и еще раз попытаться, только по нормальному мануалу сделать: https://gist.github.com/gushmazuko/a74debe24bcabb0bbedf5695cb703a12 ?

В мануале уже видно, что разница в конфигах есть, а у меня ее нет. Может поэтому различные проблемы с подключением и с логами Bad packet..

Хотел бы поблагодарить «anc» за Ваше время и за помощь!

Источник

OpenVPN Support Forum

Community Support Forum

[Solved] Routing not working, can’t connect to lan devices

[Solved] Routing not working, can’t connect to lan devices

Post by robster » Sat Nov 11, 2017 2:42 pm

I set up my openVPN server and clients are able to connect.

I would like to enable the clients to access the other devices in my lan.

Therefor I enabled IP Forwarding and added the push route in my openvpn.conf, which looks like:

My goal is that clients will be members of the 192.168.0.0 subnet and access other devices in that subnet.

When my client connects this is the log:

Once connected my client can access the internet and gets the WAN IP of my server, but the client is not able to connect to other lan devices.

What am I missing here? Where can I continue looking?

Any help is very much appriciated!

Re: Routing not working, can’t connect to lan devices

Post by TinCanTech » Sat Nov 11, 2017 3:04 pm

NOTE:

  • Your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.

Never use 192.168.0.0/24 or 192.168.1.0/24 (or other common subnets) for your OpenVPN Server LAN

  • You are advised to change your server LAN to a more unique RFC1918 compliant subnet.
    For example: 192.168.143.0/24

That could be the reason ..

Please post your client log at —verb 4

Re: Routing not working, can’t connect to lan devices

Post by robster » Sat Nov 11, 2017 7:36 pm

Thanks for the advice. I will change the subnet at some point. But for now it would be too much effort and I consider it rather a last option before I go crazy

This is the server log at verbose 4 when my client connects.

Источник

OpenVPN Support Forum

Community Support Forum

ERROR: Linux route add command failed: external program exited with error status: 1

ERROR: Linux route add command failed: external program exited with error status: 1

Post by radu » Tue Oct 25, 2016 6:05 pm

I have a configuration that allowed me to route all traffic through VPN for about a year, but after a dd-wrt update I just couldn’t make it work anymore, was failing to add route. Unortunately had a TP-Link when it worked, did a restore to original firmware and they blocked custom firmware; ow new client router also says «Linux route add command failed» but » external program exited with error status: 1″ instead of status: 2, as TP-Link did:

State
Client: CONNECTED SUCCESS
Local Address: 10.1.1.2
Remote Address: 10.1.1.2

Status
VPN Client Stats
TUN/TAP read bytes 17171
TUN/TAP write bytes 0
TCP/UDP read bytes 3735
TCP/UDP write bytes 23022
Auth read bytes 64
pre-compress bytes 7914
post-compress bytes 7988
pre-decompress bytes 0
post-decompress bytes 0

Log
Clientlog:
20161025 20:20:17 I OpenVPN 2.3.12 arm-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Oct 18 2016
20161025 20:20:17 I library versions: OpenSSL 1.0.2j 26 Sep 2016 LZO 2.09
20161025 20:20:17 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:16
20161025 20:20:17 W WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
20161025 20:20:17 W NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
20161025 20:20:17 W WARNING: file ‘/tmp/openvpncl/client.key’ is group or others accessible
20161025 20:20:17 Socket Buffers: R=[87380->87380] S=[16384->16384]
20161025 20:20:17 I Attempting to establish TCP connection with [AF_INET]82.xx.xx.48:443 [nonblock]
20161025 20:20:18 I TCP connection established with [AF_INET]82.xx.xx.48:443
20161025 20:20:18 I TCPv4_CLIENT link local: [undef]
20161025 20:20:18 I TCPv4_CLIENT link remote: [AF_INET]82.xx.xx.48:443
20161025 20:20:18 TLS: Initial packet from [AF_INET]82.xx.xx.48:443 sid=7e483803 e26adfea
20161025 20:20:18 VERIFY OK: depth=1 C=xx ST=xx L=xxx O=Radu OU=HomeServer CN=HomeServer name=HomeServer emailAddress=xx@xx.com
20161025 20:20:18 VERIFY OK: depth=0 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=NightHawk name=NightHawk emailAddress=xx@oxx.com
20161025 20:20:18 NOTE: —mute triggered.
20161025 20:20:18 1 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:18 W WARNING: this cipher’s block size is less than 128 bit (64 bit). Consider using a —cipher with a larger block size.
20161025 20:20:18 Data Channel Encrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
20161025 20:20:18 Data Channel Decrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
20161025 20:20:18 W WARNING: this cipher’s block size is less than 128 bit (64 bit). Consider using a —cipher with a larger block size.
20161025 20:20:18 Data Channel Decrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
20161025 20:20:18 Control Channel: TLSv1.2 cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384 1024 bit RSA
20161025 20:20:18 I [NightHawk] Peer Connection Initiated with [AF_INET]82.xx.xx.48:443
20161025 20:20:20 SENT CONTROL [NightHawk]: ‘PUSH_REQUEST’ (status=1)
20161025 20:20:20 PUSH: Received control message: ‘PUSH_REPLY route 192.168.1.1 255.255.255.0 redirect-gateway def1 dhcp-option DNS 193.xx.xx.1 route-gateway 10.1.1.1 topology subnet ping 10 ping-restart 120 socket-flags TCP_NODELAY ifconfig 10.1.1.2 255.255.255.0’
20161025 20:20:20 OPTIONS IMPORT: timers and/or timeouts modified
20161025 20:20:20 NOTE: —mute triggered.
20161025 20:20:20 5 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:20 I TUN/TAP device tun1 opened
20161025 20:20:20 TUN/TAP TX queue length set to 100
20161025 20:20:20 I do_ifconfig tt->ipv6=1 tt->did_ifconfig_ipv6_setup=0
20161025 20:20:20 I /sbin/ifconfig tun1 10.1.1.2 netmask 255.255.255.0 mtu 1500 broadcast 10.1.1.255
20161025 20:20:20 /sbin/route add -net 82.79.46.48 netmask 255.255.255.255 gw 192.168.0.1
20161025 20:20:20 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.1.1.1
20161025 20:20:20 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.1.1.1
20161025 20:20:20 /sbin/route add -net 192.168.1.1 netmask 255.255.255.0 gw 10.1.1.1
20161025 20:20:20 W ERROR: Linux route add command failed: external program exited with error status: 1
20161025 20:20:20 I Initialization Sequence Completed
20161025 20:20:22 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
20161025 20:20:22 D MANAGEMENT: CMD ‘state’
20161025 20:20:22 MANAGEMENT: Client disconnected

This would be the server log:
20161025 20:20:17 I TCP connection established with [AF_INET]95.xx.xx.1:60182
20161025 20:20:18 95.91.250.1:60182 TLS: Initial packet from [AF_INET]95.xx.xx.1:60182 sid=ca05dfea e5bb0e4e
20161025 20:20:18 95.91.250.1:60182 VERIFY OK: depth=1 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=HomeServer name=HomeServer emailAddress=xx@xx.com
20161025 20:20:18 95.91.250.1:60182 VERIFY OK: depth=0 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=Archer name=Archer emailAddress=xx@xx.com
20161025 20:20:18 95.91.250.1:60182 NOTE: —mute triggered.
20161025 20:20:18 95.91.250.1:60182 5 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:18 I 95.91.250.1:60182 [Archer] Peer Connection Initiated with [AF_INET]95.xx.xx.1:60182
20161025 20:20:18 I Archer/95.xx.xx.1:60182 MULTI_sva: pool returned IPv4=10.1.1.2 IPv6=(Not enabled)
20161025 20:20:18 Archer/95.xx.xx.1:60182 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_044afbfeb0c46a9ca6edba6296966941.tmp
20161025 20:20:18 Archer/95.xx.xx.1:60182 MULTI: Learn: 10.1.1.2 -> Archer/95.xx.xx.1:60182
20161025 20:20:18 Archer/95.xx.xx.1:60182 MULTI: primary virtual IP for Archer/95.xx.xx.1:60182: 10.1.1.2
20161025 20:20:20 Archer/95.xx.xx.1:60182 PUSH: Received control message: ‘PUSH_REQUEST’
20161025 20:20:20 I Archer/95.xx.xx.1:60182 send_push_reply(): safe_cap=940
20161025 20:20:20 Archer/95.xx.xx.1:60182 SENT CONTROL [Archer]: ‘PUSH_REPLY route 192.168.1.1 255.255.255.0 redirect-gateway def1 dhcp-option DNS 193.xx.xx.1 route-gateway 10.1.1.1 topology subnet ping 10 ping-restart 120 socket-flags TCP_NODELAY ifconfig 10.1.1.2 255.255.255.0’ (status=1)

Here are the configs (firewall and IP v6 off):

SERVER CONFIG (Home Location router); LAN IP: 192.168.1.1

Start Type: System
Config as: Server
Server Mode: Router (TUN)
Network: 10.1.1.0
Netmask: 255.255.255.0
Port: 443
Tunnel Protocol: TCP
Encryptions Cipher: Blowfish CBC
Hash Algorithm: SHA1
Advanced Options: Disable

Additional Config:
push «route 192.168.1.0 255.255.255.0»
push «dhcp-option DNS [provider dns]»
push «dhcp-option DNS [2nd provider dns]»
push «redirect-gateway def1»
server 10.1.1.0 255.255.255.0
dev tun0
proto tcp-server
keepalive 10 120
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem

CLIENT CONFIG (roaming location router); LAN IP: 192.168.2.1

Server IP/Name: [ddns link]
Port: 443
Tunnel Device: TUN
Tunnel Protocol: TCP
Encryption Cipher: Blowfish CBC
Hash Algorithm: SHA1
Advanced Options: Disable

Источник

  • Печать

Страницы: [1]   Вниз

Тема: Не могу подключиться к своему Openvpn  (Прочитано 6743 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
S_POWER

Развернул OpenVPN  на своём Ubuntu server 16.04, сделал всё по инструкции, служба работает, в ifconfig появился tun0, но клиент под windows не соеденяется. По разному менял настройки, всё равно результата нет.

Конфиг сервера

Конфиг клиента

Лог сервера

Лог клиента

Клиентские ключи, а так же ca.crt и ta.key в папке конфига клиента, серверные понятное дело на месте.
ipv4_forwarding включен
сервер за роутером, порт 1194 переброшен
openssl не трогал.
Если можно объясните попроще что не так, пользуюсь ubuntu меньше месяца,поэтому даже не понимаю в чём может быть проблема, помимо неправильных конфигов.

« Последнее редактирование: 04 Октября 2016, 07:59:49 от SATAN_POWER »


Оффлайн
kalek

ls -l /etc/openvpn/keys/?


Оффлайн
S_POWER

root@ubuntuserver:~# ls -l /etc/openvpn/keys/
итого 40
-rw-r--r-- 1 root root 4250 окт  3 02:14 01.pem
-rw-r--r-- 1 root root 1403 окт  3 02:13 ca.crt
-rw------- 1 root root  916 окт  3 02:13 ca.key
-rw-r--r-- 1 root root  245 окт  3 02:14 dh1024.pem
-rw-r--r-- 1 root root 4250 окт  3 02:14 server.crt
-rw-r--r-- 1 root root  733 окт  3 02:14 server.csr
-rw------- 1 root root  916 окт  3 02:14 server.key
-rw-r--r-- 1 root root  636 окт  3 02:15 ta.key

« Последнее редактирование: 04 Октября 2016, 08:01:26 от SATAN_POWER »


Оффлайн
kalek

Еще

routeи

ifconfig
Кроме того стоит выполнить

sudo chmod 600 /etc/openvpn/keys/ta.keyчтоб на него не ругалось.


Оффлайн
S_POWER

root@ubuntuserver:~# route
Таблица маршутизации ядра протокола IP
Destination Gateway Genmask Flags Metric Ref Use Iface
default         192.168.1.1     0.0.0.0         UG    100    0        0 enp2s4
10.0.0.0        *               255.255.255.0   U     0      0        0 tun0
10.15.0.0       10.0.0.2        255.255.255.0   UG    0      0        0 tun0
link-local      *               255.255.0.0     U     1000   0        0 tun0
192.168.1.0     *               255.255.255.0   U     100    0        0 enp2s4

root@ubuntuserver:~# ifconfig
enp2s4    Link encap:Ethernet  HWaddr 00:16:17:b6:a0:cd
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd4d:2151:7a64:0:94a0:da2f:63db:be44/64 Scope:Общий
          inet6 addr: fd4d:2151:7a64:0:99bd:f3a5:c1e2:19e1/64 Scope:Общий
          inet6 addr: fe80::216:17ff:feb6:a0cd/64 Scope:Link
          inet6 addr: fd4d:2151:7a64:0:311e:cd55:6df7:d5c4/64 Scope:Общий
          inet6 addr: fd4d:2151:7a64:0:216:17ff:feb6:a0cd/64 Scope:Общий
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15516809 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19105302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17641284188 (17.6 GB)  TX bytes:19876678193 (19.8 GB)

lo        Link encap:Локальная петля (Loopback)
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:353323 errors:0 dropped:0 overruns:0 frame:0
          TX packets:353323 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1157858637 (1.1 GB)  TX bytes:1157858637 (1.1 GB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.0.0.1  P-t-P:10.0.0.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Оффлайн
kalek

Судя по логу

Mon Oct  3 04:14:32 2016 217.118.78.105:54617 CRL: cannot read: /etc/openvpn/keys/01.pem
Mon Oct  3 04:14:32 2016 217.118.78.105:54617 TLS_ERROR: BIO read tls_read_plaintext error: error:14089086:SSL routines:ssl3_get_client_certificate:certificate verify failed
ругается на список отзыва сертификатов.
Для проверки можно попробовать его отключить — закомментировать строчку

crl-verify /etc/openvpn/keys/01.pemЕсли заведется, дальше надо смотреть, все ли в порядке с этим файлом.


Оффлайн
S_POWER

Спасибо!
Крайне удивлён, но заработало!
Что интересно я не генерировал список отзыва, 01.pem появился после генерации ключей сервера, 02.pem после генерации ключей клиента.
Возможно ли что в список 01 был занесён текущий клиент, из за того что я генерировал ключи 2 раза?
Можно ли где то посмотреть список всех выданных сертификатов?


  • Печать

Страницы: [1]   Вверх

I have setup OpenVPN server and client successfully. However it all works great when I run it as root but I would like to run them with the reduced privileges of user «nobody» and group «nogroup». These are options in the config files:

Server.conf

;It's a good idea to reduce the OpenVPN
;daemon's privileges after initialization.
;You can uncomment this out on
;non-Windows systems.
;user nobody
;group nogroup

However when I enable them, I get the following errors in the connection log:


Thu Jan 21 10:22:52 2016 TUN/TAP device tun0 opened
Thu Jan 21 10:22:52 2016 TUN/TAP TX queue length set to 100
Thu Jan 21 10:22:52 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Thu Jan 21 10:22:52 2016 /sbin/ip link set dev tun0 up mtu 1500
Thu Jan 21 10:22:52 2016 /sbin/ip addr add dev tun0 local 10.8.0.6 peer 10.8.0.5
Thu Jan 21 10:22:52 2016 /sbin/ip route add 192.168.1.98/32 via 192.168.1.254
Thu Jan 21 10:22:52 2016 ERROR: Linux route add command failed: external program exited with error status: 2
Thu Jan 21 10:22:52 2016 /sbin/ip route add 0.0.0.0/1 via 10.8.0.5
Thu Jan 21 10:22:52 2016 /sbin/ip route add 128.0.0.0/1 via 10.8.0.5
Thu Jan 21 10:22:52 2016 /sbin/ip route add 10.8.0.1/32 via 10.8.0.5
Thu Jan 21 10:22:52 2016 GID set to nogroup
Thu Jan 21 10:22:52 2016 UID set to nobody
Thu Jan 21 10:22:52 2016 Initialization Sequence Completed

I know this is because the user «nobody» does not have privileges to delete routes. When I close the connection, I get this:


Thu Jan 21 10:23:00 2016 event_wait : Interrupted system call (code=4)
Thu Jan 21 10:23:00 2016 /sbin/ip route del 10.8.0.1/32
Thu Jan 21 10:23:00 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
Thu Jan 21 10:23:00 2016 /sbin/ip route del 192.168.1.98/32
Thu Jan 21 10:23:00 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
Thu Jan 21 10:23:00 2016 /sbin/ip route del 0.0.0.0/1
Thu Jan 21 10:23:00 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
Thu Jan 21 10:23:00 2016 /sbin/ip route del 128.0.0.0/1
Thu Jan 21 10:23:00 2016 ERROR: Linux route delete command failed: external program exited with error status: 2
Thu Jan 21 10:23:00 2016 Closing TUN/TAP interface
Thu Jan 21 10:23:00 2016 /sbin/ip addr del dev tun0 local 10.8.0.6 peer 10.8.0.5
Thu Jan 21 10:23:00 2016 Linux ip addr del failed: external program exited with error status: 2
Thu Jan 21 10:23:00 2016 SIGINT[hard,] received, process exiting

So the question is, how do I give the required permissions to the user «nobody» and group «nogroup»?

I’m trying to connect throught ovpn but I have the following error, don’t know why:

I have ubuntu-gnome and I’m connected throught wifi.

.ovpn:

client
remote gateway.xxx.com 1194
dev tun
proto udp
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca ca-cert.pem
cert client-xxx-cert.pem
key client-xxx-key.pem
ns-cert-type server
comp-lzo
verb 3
auth-user-pass
redirect-gateway def1

Connection error:

sudo openvpn --config gateway.xxxx.com.ovpn
Mon Jun 19 23:25:55 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Feb  2 2016
Mon Jun 19 23:25:55 2017 library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Enter Auth Username: ******
Enter Auth Password: ******
Mon Jun 19 23:25:58 2017 WARNING: file 'client-xxxx-key.pem' is group or others accessible
Mon Jun 19 23:25:58 2017 Socket Buffers: R=[212992->212992] S=[212992->212992]
Mon Jun 19 23:25:59 2017 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Mon Jun 19 23:25:59 2017 UDPv4 link local: [undef]
Mon Jun 19 23:25:59 2017 UDPv4 link remote: [AF_INET]xx.xxx.xxx.xxx:xxxx
Mon Jun 19 23:25:59 2017 TLS: Initial packet from [AF_INET]xx.xxx.xxx.xxx:xxxx, sid=359b3959 c62dbda9
Mon Jun 19 23:25:59 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Jun 19 23:25:59 2017 VERIFY OK: depth=1, C=ES, L=xxx, O=xxx, OU=xxx, CN=ca.gateway.xxx.com, emailAddress=xxx@gateway.xxx.com, O=xxx, ST=xxx
Mon Jun 19 23:25:59 2017 VERIFY OK: nsCertType=SERVER
Mon Jun 19 23:25:59 2017 VERIFY OK: depth=0, C=ES, ST=xxx, L=xxx, O=xxx, O=xxx, OU=xxx, CN=gateway.xxx.com, emailAddress=security@gateway.xxx.com
Mon Jun 19 23:26:01 2017 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 19 23:26:01 2017 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 19 23:26:01 2017 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 19 23:26:01 2017 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 19 23:26:01 2017 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Jun 19 23:26:01 2017 [gateway.xxx.com] Peer Connection Initiated with [AF_INET]91.126.210.222:1194
Mon Jun 19 23:26:04 2017 SENT CONTROL [gateway.xxx.com]: 'PUSH_REQUEST' (status=1)
Mon Jun 19 23:26:04 2017 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS xxx.xxx.xx.xx,dhcp-option WINS 192.168.47.3,dhcp-option DOMAIN xxx.com,route 192.168.47.0 255.255.255.0,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.18 10.8.0.17'
Mon Jun 19 23:26:04 2017 OPTIONS IMPORT: timers and/or timeouts modified
Mon Jun 19 23:26:04 2017 OPTIONS IMPORT: --ifconfig/up options modified
Mon Jun 19 23:26:04 2017 OPTIONS IMPORT: route options modified
Mon Jun 19 23:26:04 2017 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Mon Jun 19 23:26:04 2017 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=wlxc4e9841c8867 HWADDR=c4:e9:84:1c:88:67
Mon Jun 19 23:26:04 2017 TUN/TAP device tun0 opened
Mon Jun 19 23:26:04 2017 TUN/TAP TX queue length set to 100
Mon Jun 19 23:26:04 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Mon Jun 19 23:26:04 2017 /sbin/ip link set dev tun0 up mtu 1500
Mon Jun 19 23:26:04 2017 /sbin/ip addr add dev tun0 local 10.8.0.18 peer 10.8.0.17
Mon Jun 19 23:26:04 2017 /sbin/ip route add xx.xx.xxx.xxx/32 via 192.168.1.1
RTNETLINK answers: File exists
Mon Jun 19 23:26:04 2017 ERROR: Linux route add command failed: external program exited with error status: 2
Mon Jun 19 23:26:04 2017 /sbin/ip route add 0.0.0.0/1 via 10.8.0.17
Mon Jun 19 23:26:04 2017 /sbin/ip route add 128.0.0.0/1 via 10.8.0.17
Mon Jun 19 23:26:04 2017 /sbin/ip route add 192.168.47.0/24 via 10.8.0.17
Mon Jun 19 23:26:04 2017 /sbin/ip route add 10.8.0.1/32 via 10.8.0.17
Mon Jun 19 23:26:04 2017 GID set to nogroup
Mon Jun 19 23:26:04 2017 UID set to nobody
Mon Jun 19 23:26:04 2017 Initialization Sequence Completed
^CMon Jun 19 23:26:23 2017 event_wait : Interrupted system call (code=4)
Mon Jun 19 23:26:23 2017 /sbin/ip route del 10.8.0.1/32
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 /sbin/ip route del 192.168.47.0/24
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 /sbin/ip route del 91.126.210.222/32
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 /sbin/ip route del 0.0.0.0/1
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 /sbin/ip route del 128.0.0.0/1
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 ERROR: Linux route delete command failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 Closing TUN/TAP interface
Mon Jun 19 23:26:23 2017 /sbin/ip addr del dev tun0 local 10.8.0.18 peer 10.8.0.17
RTNETLINK answers: Operation not permitted
Mon Jun 19 23:26:23 2017 Linux ip addr del failed: external program exited with error status: 2
Mon Jun 19 23:26:23 2017 SIGINT[hard,] received, process exiting

Понравилась статья? Поделить с друзьями:
  • Error linker link exe not found
  • Error ld returned 1 exit status как исправить linux
  • Error ld returned 1 exit status как исправить codeblocks
  • Error ld returned 1 exit status code blocks
  • Error launching unity player