I have an Ubuntu 10.10 machine with OpenVPN configured as a server with one tap interface.
I have multiple Ubuntu 10.10 machines with OpenVPN configured as a client. All the clients use the same certificate.
When a client connects I want to run a script that gets files from the client. I found out there are two ways to run scripts when the connection is up.
--up: runs when the tap0 interface is up at the server. Only one tap interface is opened, so I can't use this to start a script for every client connection
--client-connect: runs when a client connects! Yes that is the one I need. I start a script and try to get files from the client by using the $ifconfig_pool_remote_ip.
Although the remote ip is there, the tunnel is not yet ready to use for data. It takes a few (about 5) seconds.
I tried to sleep and try after a 30 seconds, tried using ping to find out if the tunnel is open, but the tunnel won't open if this script is not done.
Is there any setting to open the tunnel while this script is running? Or better yet, is there a way to run this script when the tunnel is open (like pptp */ppp/ip-up.d/script)