--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/tunnelblick-discuss/-/BulMJSCjTqUJ.
To post to this group, send email to tunnelbli...@googlegroups.com.
To unsubscribe from this group, send email to tunnelblick-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tunnelblick-discuss?hl=en.
Jonathan, when I was working on the up/down scripts, I noticed that the TAP interface had already been destroyed by the time the down script ran, which means that we couldn't manually release the DHCP lease in the down script. Is there a pre-down script that runs before the TAP interface is destroyed? If so, we can very easily check if it was configured using DHCP (if `ipconfig getpacket "$dev"` returns ANYTHING on standard out, DHCP was used), and we should be able to fairly easily release the lease in that case (I believe `ipconfig set "$dev" NONE` should do the trick).
--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
Hmmm. The fact that you can't have a pre-down and post-down script bothers me.
The only attempt I would suggest would be to force pre-down always, but only if we could delay most of the script execution until after the OpenVPN shut down.So, here's what we could do:- Script runs BEFORE device shutdown- DHCP lease released- Down script continues in background, so that OpenVPN can continue shutting down- Down script sleeps and monitors process, and only continues to tear down everything else when it would normally run without --down-pre.So the question is, does OpenVPN normally remove the device, then IMMEDIATELY call the down script (without --down-pre)? Or does it do other things before calling the down script?If it removes the device and then IMMEDIATELY calls the down script, then with --down-pre we could check the status of the device with `ipconfig getifaddr "$dev"` and that command will return a 0 status code until the device no longer exists, at which point it returns a non-zero status code. Then, once it returns non-zero, we could continue with the rest of the down script and everything else should be the same.If, however, OpenVPN does other tasks between removing the device and calling the down scripts (without --down-pre), we would need some way to actually monitor when the OpenVPN process dies, and then complete our work after that.Does this make sense?
2011-09-02 18:38:32 us=441566 TCP/UDP: Closing socket
2011-09-02 18:38:32 us=441675 /sbin/route delete -net 10.17.0.1 10.17.0.173 255.255.255.255
2011-09-02 18:38:32 us=442363 PKCS#11: __pkcs11h_forkFixup entry pid=10789, activate_slotevent=1
2011-09-02 18:38:32 us=442459 PKCS#11: __pkcs11h_forkFixup return
delete net 10.17.0.1: gateway 10.17.0.173
2011-09-02 18:38:32 us=444250 /sbin/route delete -net 88.191.121.143 192.168.125.1 255.255.255.255
2011-09-02 18:38:32 us=444692 PKCS#11: __pkcs11h_forkFixup entry pid=10790, activate_slotevent=1
2011-09-02 18:38:32 us=444736 PKCS#11: __pkcs11h_forkFixup return
delete net 88.191.121.143: gateway 192.168.125.1
2011-09-02 18:38:32 us=446389 /sbin/route delete -net 0.0.0.0 10.17.0.173 128.0.0.0
2011-09-02 18:38:32 us=446896 PKCS#11: __pkcs11h_forkFixup entry pid=10791, activate_slotevent=1
2011-09-02 18:38:32 us=446968 PKCS#11: __pkcs11h_forkFixup return
delete net 0.0.0.0: gateway 10.17.0.173
2011-09-02 18:38:32 us=448274 /sbin/route delete -net 128.0.0.0 10.17.0.173 128.0.0.0
2011-09-02 18:38:32 us=448758 PKCS#11: __pkcs11h_forkFixup entry pid=10792, activate_slotevent=1
2011-09-02 18:38:32 us=448816 PKCS#11: __pkcs11h_forkFixup return
delete net 128.0.0.0: gateway 10.17.0.173
2011-09-02 18:38:32 us=449833 Closing TUN/TAP interface
2011-09-02 18:38:32 us=450015 /Applications/Tunnelblick.app/Contents/Resources/client.down.tunnelblick.sh -m -w -d tun0 1500 1560 10.17.0.174 10.17.0.173 init
2011-09-02 18:38:32 us=450631 PKCS#11: __pkcs11h_forkFixup entry pid=10793, activate_slotevent=1
2011-09-02 18:38:32 us=450702 PKCS#11: __pkcs11h_forkFixup return
2011-09-02 18:38:32 us=521561 PID packet_id_free
2011-09-02 18:38:32 us=521659 SIGTERM[hard,] received, process exiting
2011-09-02 18:37:25 us=501059 TCP/UDP: Closing socket
2011-09-02 18:37:25 us=501165 /sbin/route delete -net 10.17.0.1 10.17.0.173 255.255.255.255
2011-09-02 18:37:25 us=501728 PKCS#11: __pkcs11h_forkFixup entry pid=10655, activate_slotevent=1
2011-09-02 18:37:25 us=501776 PKCS#11: __pkcs11h_forkFixup return
delete net 10.17.0.1: gateway 10.17.0.173
2011-09-02 18:37:25 us=503260 /sbin/route delete -net 88.191.121.143 192.168.125.1 255.255.255.255
2011-09-02 18:37:25 us=503757 PKCS#11: __pkcs11h_forkFixup entry pid=10656, activate_slotevent=1
2011-09-02 18:37:25 us=503818 PKCS#11: __pkcs11h_forkFixup return
delete net 88.191.121.143: gateway 192.168.125.1
2011-09-02 18:37:25 us=505712 /sbin/route delete -net 0.0.0.0 10.17.0.173 128.0.0.0
2011-09-02 18:37:25 us=506231 PKCS#11: __pkcs11h_forkFixup entry pid=10657, activate_slotevent=1
2011-09-02 18:37:25 us=506274 PKCS#11: __pkcs11h_forkFixup return
delete net 0.0.0.0: gateway 10.17.0.173
2011-09-02 18:37:25 us=507391 /sbin/route delete -net 128.0.0.0 10.17.0.173 128.0.0.0
2011-09-02 18:37:25 us=507819 PKCS#11: __pkcs11h_forkFixup entry pid=10658, activate_slotevent=1
2011-09-02 18:37:25 us=507866 PKCS#11: __pkcs11h_forkFixup return
delete net 128.0.0.0: gateway 10.17.0.173
2011-09-02 18:37:25 us=509035 /Applications/Tunnelblick.app/Contents/Resources/client.down.tunnelblick.sh -m -w -d tun0 1500 1560 10.17.0.174 10.17.0.173 init
2011-09-02 18:37:25 us=509571 PKCS#11: __pkcs11h_forkFixup entry pid=10659, activate_slotevent=1
2011-09-02 18:37:25 us=509620 PKCS#11: __pkcs11h_forkFixup return
2011-09-02 18:37:25 us=570551 Closing TUN/TAP interface
2011-09-02 18:37:25 us=570702 PID packet_id_free
2011-09-02 18:37:25 us=570752 SIGTERM[hard,] received, process exiting
I can contribute and say that when I'm on-location where my VPN is hosted, I can click "Renew DHCP Lease" over and over again and get the same IP address. But when I connect via the VPN, every time I reconnect I get a new IP address. I, too, ran out of IP addresses one day when I was testing the configuration.Jonathan, when I was working on the up/down scripts, I noticed that the TAP interface had already been destroyed by the time the down script ran, which means that we couldn't manually release the DHCP lease in the down script. Is there a pre-down script that runs before the TAP interface is destroyed? If so, we can very easily check if it was configured using DHCP (if `ipconfig getpacket "$dev"` returns ANYTHING on standard out, DHCP was used), and we should be able to fairly easily release the lease in that case (I believe `ipconfig set "$dev" NONE` should do the trick).Nick