Got a problem with Viscosity or need help? Ask here!
I have read the threads eleswhere on this forum regarding this topic. For several months I successfully used the routing preference set to 0.0.0.0 as mentioned in those threads and when I manually disconnect there is no connection to either the VPN or my ISP until I restart the computer or restart the Ethernet connection in System Prefs.
But this past week my ISP has been either intentionally or unintentionally breaking my connection every hour or so, for only a few seconds. Perhaps they are merely dropouts but its been fairly consistent. When this happens I lose the VPN connection and when the ISP comes back, it takes over, essentially reconnecting any internet sessions and applications, like browsers. I checked my settings and when I manually disconnect, I cannot regain the connection, which is what I expect. But if my ISP completely drops out, without any intervention on my part, the ISP regains the connection instead of the VPN.
In addition to the routing preference trick (and the Lion firewall trick which doesn't apply to me since I'm not on Lion), the other threads on this forum mentioned a Disconnect Applescript, including a scripting example which disconnects a wireless connection. I am on a wired connection to the router and my attempts at imitating the proper syntax haven't worked.
1. Any suggestions on how the disconnect applescript should look for a wired connection?
2. Any ideas about why this only happens when the ISP breaks the connection?
The script examples posted by users that use ipfw should work under Mac OS 10.5 and 10.6.
Of, if you want to do something simple, you could probably have something like so as your Disconnected AppleScript:
So I tried the simple applescript suggested by James and if I manually disconnected, it worked the same as having the router IP set to 0.0.0.0. In fact I don't which worked since they were both in effect.
But after an hour my ISP dropped the connection for one minute and when it resumed the computer connected to the VPN was using the ISP's IP, not the VPN. I checked my settings and the script was attached in the advanced pane but it apparently had no effect.
This anomaly only began last week or so - previously the router settings worked for months for both manual and ISP-generated disconnects. It seems that some setting must have changed but I haven't figured out what it could be.
I'll continue to experiment but if anyone has any suggestions, I'd love to hear them.
1. I'm connecting to the VPN via upd protocol.
2. My options in Viscosity have Persist Local IP and Persist Remote IP unchecked.
3. My Networking pane has "Send all traffic over VPN" checked and Default Gateway is blank. The Route, Mask and Gateway are all 0.0.0.0
4. The Advanced pane has the Disconnect.scpt attached: do shell script "ifconfig en0 down" user name "myusername" password "mypassword" with administrator privileges - the correct name and pw are entered and the script compiles and is saved as a script.
5. resolv-retry infinite is the only added config command in the Advanced pane
It sounds likely that the connection isn't running the Disconnected script as the connection is automatically reconnecting, rather than disconnecting. To change this so the connection disconnects on a dropout, edit your connection in Viscosity, click the Advanced tab, and add the command "remap-usr1 SIGTERM" (no quotes) on a new line in the commands area. Click Save.
I added the line in the Extras window of the Advanced tab. It took a few hours before I got a drop out but same thing happened. After a minute it reconnected with the ISP's IP address rather than staying disconnected.
I just looked at the ipfw scripts for non-Lion users that someone kindly posted in another thread. This solution may not work for me since the VPN changes IPs randomly and not always in a contiguous block of IPs. Their "firewallrules" syntax asks for a single IP (though I'm guessing one could also add a block of IPs if you knew the proper syntax).
Can you confirm your Disconnected script is running when the drop out occurs? Do you have a router connecting you to the Internet, or are you using PPPoE directly from your Mac?
Can you confirm your Disconnected script is running when the drop out occurs?
Not sure what you mean. What would confirm that the script is running?
Do you have a router connecting you to the Internet, or are you using PPPoE directly from your Mac?
I'm using a DSL modem with a built-in router and DHCP.
Well assuming you are using the simple script I posted previously, after disconnecting your VPN connection, type "ifconfig en0" into the Terminal (/Applications/Utilities/Terminal) and make sure it is now listed as down (it shouldn't have "UP" in the first line anywhere, and its status should be listed as inactive).
Who is online
Users browsing this forum: No registered users and 1 guest