up.sh running but not down.sh.
Posted: Sat Jul 07, 2018 9:45 pm
hi, im using raspberry pi with the following config file. The system will boot and and will connect to vpn and kicks off the transmission daemon. as soon as the connectivity/openvpn is down down.sh gets triggered and stops transmission.
problem im having is that up.sh gets triggered upon openvpn connectivity, but down.sh doesnt gets triggered when it is going down.
Here is the part of log.
Sat Jul 7 21:29:51 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sat Jul 7 21:29:51 2018 /sbin/ip link set dev tun0 up mtu 1500
Sat Jul 7 21:29:51 2018 /sbin/ip addr add dev tun0 10.8.8.70/24 broadcast 10.8.8.255
Sat Jul 7 21:29:51 2018 /etc/openvpn/up.sh tun0 1500 1553 10.8.8.70 255.255.255.0 init
Starting Transmission Torrent Downloading
localhost:9091/transmission/rpc/ responded: "success"
Sat Jul 7 21:29:51 2018 /sbin/ip route add 185.236.200.139/32 via 192.168.29.1
Sat Jul 7 21:29:51 2018 /sbin/ip route add 0.0.0.0/1 via 10.8.8.1
Sat Jul 7 21:29:51 2018 /sbin/ip route add 128.0.0.0/1 via 10.8.8.1
Sat Jul 7 21:29:51 2018 GID set to nogroup
Sat Jul 7 21:29:51 2018 UID set to nobody
Sat Jul 7 21:29:51 2018 Initialization Sequence Completed
Sat Jul 7 21:33:19 2018 [us1777.nordvpn.com] Inactivity timeout (--ping-restart), restarting
Sat Jul 7 21:33:19 2018 /sbin/ip route del 185.236.200.139/32
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 /sbin/ip route del 0.0.0.0/1
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 /sbin/ip route del 128.0.0.0/1
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 Closing TUN/TAP interface
Sat Jul 7 21:33:19 2018 /sbin/ip addr del dev tun0 10.8.8.70/24
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 Linux ip addr del failed: external program exited with error status: 2
Sat Jul 7 21:33:20 2018 /etc/openvpn/down.sh tun0 1500 1553 10.8.8.70 255.255.255.0 init
Sat Jul 7 21:33:20 2018 WARNING: Failed running command (--up/--down): could not execute external program
Sat Jul 7 21:33:20 2018 Exiting due to fatal error
and here is the actual config file:
client
dev tun
proto udp4
remote 199.241.125.86 1194
remote 185.217.69.142 1194
remote 185.217.69.149 1194
remote 209.58.148.156 1194
remote 23.83.37.242 1194
remote 209.58.147.230 1194
remote 207.189.2.234 1194
remote 196.245.9.86 1194
remote 196.245.9.20 1194
remote 185.236.200.139 1194
resolv-retry infinite
remote-random
nobind
reneg-sec 0
tls-client
explicit-exit-notify 3
user nobody
group nogroup
remote-cert-tls server
keepalive 10 60
comp-lzo
verb 3
pull
fast-io
cipher AES-256-CBC
auth SHA512
script-security 2
disable-occ
log-append /var/log/openvpn.log
auth-user-pass /etc/openvpn/auth
up /etc/openvpn/up.sh
down /etc/openvpn/down.sh
problem im having is that up.sh gets triggered upon openvpn connectivity, but down.sh doesnt gets triggered when it is going down.
Here is the part of log.
Sat Jul 7 21:29:51 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sat Jul 7 21:29:51 2018 /sbin/ip link set dev tun0 up mtu 1500
Sat Jul 7 21:29:51 2018 /sbin/ip addr add dev tun0 10.8.8.70/24 broadcast 10.8.8.255
Sat Jul 7 21:29:51 2018 /etc/openvpn/up.sh tun0 1500 1553 10.8.8.70 255.255.255.0 init
Starting Transmission Torrent Downloading
localhost:9091/transmission/rpc/ responded: "success"
Sat Jul 7 21:29:51 2018 /sbin/ip route add 185.236.200.139/32 via 192.168.29.1
Sat Jul 7 21:29:51 2018 /sbin/ip route add 0.0.0.0/1 via 10.8.8.1
Sat Jul 7 21:29:51 2018 /sbin/ip route add 128.0.0.0/1 via 10.8.8.1
Sat Jul 7 21:29:51 2018 GID set to nogroup
Sat Jul 7 21:29:51 2018 UID set to nobody
Sat Jul 7 21:29:51 2018 Initialization Sequence Completed
Sat Jul 7 21:33:19 2018 [us1777.nordvpn.com] Inactivity timeout (--ping-restart), restarting
Sat Jul 7 21:33:19 2018 /sbin/ip route del 185.236.200.139/32
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 /sbin/ip route del 0.0.0.0/1
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 /sbin/ip route del 128.0.0.0/1
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jul 7 21:33:19 2018 Closing TUN/TAP interface
Sat Jul 7 21:33:19 2018 /sbin/ip addr del dev tun0 10.8.8.70/24
RTNETLINK answers: Operation not permitted
Sat Jul 7 21:33:19 2018 Linux ip addr del failed: external program exited with error status: 2
Sat Jul 7 21:33:20 2018 /etc/openvpn/down.sh tun0 1500 1553 10.8.8.70 255.255.255.0 init
Sat Jul 7 21:33:20 2018 WARNING: Failed running command (--up/--down): could not execute external program
Sat Jul 7 21:33:20 2018 Exiting due to fatal error
and here is the actual config file:
client
dev tun
proto udp4
remote 199.241.125.86 1194
remote 185.217.69.142 1194
remote 185.217.69.149 1194
remote 209.58.148.156 1194
remote 23.83.37.242 1194
remote 209.58.147.230 1194
remote 207.189.2.234 1194
remote 196.245.9.86 1194
remote 196.245.9.20 1194
remote 185.236.200.139 1194
resolv-retry infinite
remote-random
nobind
reneg-sec 0
tls-client
explicit-exit-notify 3
user nobody
group nogroup
remote-cert-tls server
keepalive 10 60
comp-lzo
verb 3
pull
fast-io
cipher AES-256-CBC
auth SHA512
script-security 2
disable-occ
log-append /var/log/openvpn.log
auth-user-pass /etc/openvpn/auth
up /etc/openvpn/up.sh
down /etc/openvpn/down.sh