A couple of questions:
- Are you running all network traffic through the VPN?
- Presumably Wi-Fi and Ethernet have different IP addresses; do they have different DNS servers serving them?
- When the VPN is not active, through which interface(s) do you want traffic directed and how do you cause that to happen?
- When the VPN is active, what do you want to go through Ethernet and what do you want to go through Wi-Fi?
Here's some background:What network interfaces are used depends on how they are configured.Older versions of macOS used only one network service, the one that appears at the top of the list in macOS's System Preferences : Network. Services (i.e., interfaces) appear in a specific order under the user's control. A service that is unavailable (Ethernet not connected or Wi-Fi turned off or not connected to a network) are moved below services that are available. On such older systems, either Wi-Fi or Ethernet would be used, but not both at the same time. If both were available, only the one the user put at the top of the list would be used (or the default; I don't remember the default order).More recent versions of macOS may (I'm not sure) actually use both at the same time. I vaguely remember this being added to macOS a few years (and versions) ago, but I don't know if it is enabled by default, so it may not come into play here.
Tunnelblick itself has nothing to do with this, it is all done by OpenVPN. I'm not aware of anything in OpenVPN itself that would do what I think you want, either.The only thing I can think of is for you to use pre-connect and post-disconnect scripts to disable and then re-enable Wi-Fi if both interfaces are connected. I'm not sure that's acceptable to you, though, and it's treating the symptom, not curing the problem, but it might be better than nothing.
On Tuesday, October 16, 2018 at 6:15:54 PM UTC-4, Andrej wrote:On Wed, Oct 17, 2018 at 6:29 AM Tunnelblick developer <> wrote:A couple of questions:
- Are you running all network traffic through the VPN?
No, just a subset of our own address space (public IP addresses, but not reachable from outside - firewalled off; theonly way to get there is the VPN).
- Presumably Wi-Fi and Ethernet have different IP addresses; do they have different DNS servers serving them?
Different IPs, same network range, same default GW, same DNS servers
- When the VPN is not active, through which interface(s) do you want traffic directed and how do you cause that to happen?
It seems to default to wired, we're not too fussed; the advantage is performance on the wired network, Gigabit to the desks.
- When the VPN is active, what do you want to go through Ethernet and what do you want to go through Wi-Fi?
Through VPN (wifi) just a certain range of IPs that people may need to be able to get to while in a meeting (away fromtheir desks).Here's some background:What network interfaces are used depends on how they are configured.Older versions of macOS used only one network service, the one that appears at the top of the list in macOS's System Preferences : Network. Services (i.e., interfaces) appear in a specific order under the user's control. A service that is unavailable (Ethernet not connected or Wi-Fi turned off or not connected to a network) are moved below services that are available. On such older systems, either Wi-Fi or Ethernet would be used, but not both at the same time. If both were available, only the one the user put at the top of the list would be used (or the default; I don't remember the default order).More recent versions of macOS may (I'm not sure) actually use both at the same time. I vaguely remember this being added to macOS a few years (and versions) ago, but I don't know if it is enabled by default, so it may not come into play here.The order seems to be that MacOS prefers the faster device. I checked on my laptop and that of one colleague. I'll see if ordering the interfaces differently makes the VPN issue go away (it would obviously make the benefit of the fast connection go away altogether if the default route were changed to the wifi interface. Which is why I was asking whether tunnelblick had an option to tie to a specific device.Cheers,Andrej
--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tunnelblick-dis...@googlegroups.com.
Visit this group at https://groups.google.com/group/tunnelblick-discuss.
For more options, visit https://groups.google.com/d/optout.
OpenVPN is started by the Tunnelblick daemon (tunnelblickd) which runs as root and launches OpenVPN running as root. (OpenVPN must start as root so it is able to make the network changes needed to implement the VPN, such as routing.)Tunnelblick itself sends commands to tunnelblickd, and so does a legacy command-line program, "openvpnstart" which is included inside of the Tunnelblick application.You include OpenVPN options in the (static) OpenVPN configuration file, but you can't pass them through Tunnelblick any other way. Tunnelblick "locks down" the configuration file and options that it sends OpenVPN for security reasons.
I can think of two ways to have a "dynamic" IP address in a --local OpenVPN configuration, as follows:Method #1 (I'm not absolutely sure this will work, but I think so)
config "<path-to-the-file-created-in-1.2"
OpenVPN would in effect include the "local <Wi-Fi IP address" in the options it processes.
The "file-created-in-1.2" should be owned by root/wheel with 744 permissions so it can't be modified by any unprivileged programs. It should be located outside of the Tunnelblick configuration; you could put it in /private/tmp (see Paths, below). If you have more than one VPN configuration, you should probably name the file so it includes the VPN configuration's name instead of the fixed "config2.ovpn" mentioned above.
Method #2
- Create a "pre-connect.sh" script that calculates the Wi-Fi IP address and appends one line ("local <Wi-Fi IP address>") to the end of the config.ovpn file inside of the Tunnelblick VPN Configuration.
- Create a "post-disconnect.sh" script that removes the line (e.g. using "head -n -1 config.ovpn > temp.txt ; mv temp.txt config.ovpn".
(The reason for removing the line after disconnecting is so that Tunnelblick won't notice that the configuration file has changed and require a computer administrator's approval to use the change.)
Method #2 has the disadvantage that if for some reason the post-disconnect.sh script doesn't run (e.g., the computer or OpenVPN crashes), the configuration file will have been modified, and the next time the user connects the configuration he/she will will be asked to provide a computer administrator's authorization to "secure" the script. In that situation,
Paths: Be sure to specify appropriate paths. The working directory for scripts is /private/var, and the scripts are located in the same folder as the config.ovpn the are used with, so to get the path for config.ovpn you'll have to calculate it from the scripts $0 parameter (which will be a full path, not a relative path).
How does Tunnelblick invoke openvpn? I was wondering whether I could "calculate" the IP tied to the wifi interface and pass it to openvpn with the --local flag from Tunnelblick.
On Wed, Oct 17, 2018 at 2:48 PM tink <> wrote:
--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tunnelblick-dis...@googlegroups.com.
Visit this group at https://groups.google.com/group/tunnelblick-discuss.
For more options, visit https://groups.google.com/d/optout.
Thanks for the most helpful response (and the links provided). I like the design and clarity of method 1.I have read and understood https://tunnelblick.net/cUsingScripts.html ... last piece of the puzzle missingfor me is the "where do I put pre-connect.sh I can't seem to locate it anywhere in the file-system and thedoco doesn't seem to mention its location?Cheers,Andrej
--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tunnelblick-dis...@googlegroups.com.
Visit this group at https://groups.google.com/group/tunnelblick-discuss.
For more options, visit https://groups.google.com/d/optout.

You're welcome, and we're sorted.I have created two subdirs (we have two servers we can connect to):mkdir ~/confs/{1,2}.tblkIn {1,2}.conf in the respective subdir I removed "nobind" and replaced it with config /Users/andrej/confs/config2.confpre-connect.sh (copied into both directories) looks like so:#!/bin/bashaddr=$(ipconfig getifaddr $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}'))if [ ${#addr} -ge 7 ]; thenecho "local $addr" > /Users/andrej/confs/config2.confelseecho "#NO WiFi active" > /Users/andrej/confs/config2.conffichmod 0640 /Users/andrej/confs/config2.confDragged & Dropped those directorier onto Tunnelblick and life is good - I'm using Wifi for VPN =}Thanks again for your patience and helpfulness - really appreciate it!Cheers,Andrej
The scripts go in a "Tunnelblick VPN Configuration"; see Creating and Installing a Tunnelblick VPN Configuration.
--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tunnelblick-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tunnelblick-discuss/1278e822-6239-41e1-9764-6eedcc3b4c2c%40googlegroups.com.