Script 'up' after accepting pushed settings

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
User avatar
ogogon
OpenVpn Newbie
Posts: 7
Joined: Fri Jul 17, 2015 11:36 am

Script 'up' after accepting pushed settings

Post by ogogon » Wed Jul 22, 2015 1:15 am

I need to run a 'up' script on the client only after the setting routings, which came from the server.
Without this routings, service, who started from the script, can not make the necessary connections to it.

Here is a fragment of the log file.
Fri Jul 17 15:58:50 2015 /etc/openvpn/scripts/client.up tun0 1500 1542 10.10.100.16 10.10.100.15 init
mount error: could not resolve address for server1.net.ru: Unknown error
Fri Jul 17 15:59:15 2015 /usr/sbin/ip route add 10.10.100.0/24 via 10.10.100.15
Fri Jul 17 15:59:15 2015 /usr/sbin/ip route add 172.16.0.0/16 via 10.10.100.15
Fri Jul 17 15:59:15 2015 /usr/sbin/ip route add 172.17.0.0/16 via 10.10.100.15
Fri Jul 17 15:59:15 2015 /usr/sbin/ip route add 172.18.0.0/16 via 10.10.100.15
Fri Jul 17 15:59:15 2015 Initialization Sequence Completed
It is clearly seen that the first script is run, and then set routes that send from the server.

How can I execute the script only after will be installed all the changes that came with "push" from the server?

Ogogon.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Script 'up' after accepting pushed settings

Post by Traffic » Thu Jul 23, 2015 9:15 am

The VPN is only marked as available once the --up script has completed .. therefore: you cannot use the --up script to connect to remote resources.

User avatar
ogogon
OpenVpn Newbie
Posts: 7
Joined: Fri Jul 17, 2015 11:36 am

Re: Script 'up' after accepting pushed settings

Post by ogogon » Tue Sep 01, 2015 7:38 pm

Traffic wrote:The VPN is only marked as available once the --up script has completed .. therefore: you cannot use the --up script to connect to remote resources.
Is there a correct way to receive the signal that the resources are already available?

Ogogon.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Script 'up' after accepting pushed settings

Post by Traffic » Mon Nov 23, 2015 9:29 pm

Not from within OpenVPN .. third party software may help.

Post Reply