[SOLVED] Up script in ovpn configuration file for Open VPN gives fatal error: could not execute external program

Hi all, im setting up my VPN but my up scripts are not working correctly
It gives: WARNING: Failed running command (--up/--down): could not execute external program

This is the OpenWrt Sys log:

Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: timers and/or timeouts modified
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: --ifconfig/up options modified
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: route-related options modified
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: peer-id set
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: adjusting link_mtu to 1624
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: OPTIONS IMPORT: data channel crypto options modified
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: Outgoing Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: Incoming Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: TUN/TAP device tun10 opened
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: net_iface_mtu_set: mtu 1500 for tun10
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: net_iface_up: set tun10 up
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: net_addr_v4_add: 10.8.0.2/24 dev tun10
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: /usr/libexec/openvpn-hotplug up Hotspot1 tun10 1500 1624 10.8.0.2 255.255.255.0 init
Tue Oct 26 11:51:56 2021 daemon.err openvpn(Hotspot1)[3655]: WARNING: Failed running command (--up/--down): could not execute external program
Tue Oct 26 11:51:56 2021 daemon.notice openvpn(Hotspot1)[3655]: Exiting due to fatal error

Client config

client
proto udp
explicit-exit-notify
remote (ip)(port)
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_16mFh07n4H6c7Tp8 name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
dev tun10
route-nopull
route-noexec
script-security 2
up /etc/openvpn/ovpn-connected.sh
verb 3

ls -l /etc/openvpn
image

and the script starts with #! /bin/bash

Do you have bash installed on your OpenWrt system?

2 Likes

how can I check that

So you don’t most likely. Change your first script line from #!/bin/bash to #!/bin/sh and retry.

4 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.