wispfox: (Default)
[personal profile] wispfox
I blame one of my co-workers for the fact that I now want an ipod shuffle. The ipod itself did not have any draw for me, but the shuffle is tiny and cute and I could put it in my pocket and it wouldn't escape and I could listen to it on planes (planes are _loud_) and now I _want one_.

Bad co-worker. *adds to list of things to get eventually* (this is so I don't try to go buy it _now_, you see)

And apparently there is Linux software which can talk to it, which is good.

Date: 2005-03-16 10:01 pm (UTC)
From: [identity profile] sharp-blue.livejournal.com
I'm using the VPN client that's built into Panther. I can achieve the effect I want by starting the VPN connection, removing the default route using the "route" command and adding a new default route that goes through my ADSL modem's gateway, but there must be a way to do this automatically. I've tried adding a new file to /etc/ppp/peers/ with the name of the VPN connection and the contents "nodefaultroute" but that doesn't seem to help.

Date: 2005-03-16 10:08 pm (UTC)
From: [identity profile] bridgetester.livejournal.com
I predict "/etc/ppp/peers/" will not do anything, as MacOS X pays strict attention to some of the Unix directories, and ignores the rest of it. You may be able to set something as default with a third-party VPN client, and then delete said client.

This may work, but proceed at your own risk
http://www.oreillynet.com/pub/wlg/1907?page=last&x-order=date

After setting up the VPN connection, try running the following script. You will of course need to change the IP addresses to fit your needs. In the example below, 192.168.100.0/24 is the local network, and 192.168.1.0/24 is the remote network we are vpn'd to. This is self-healing; when the vpn is disconnected the routes will fix themselves.

#!/bin/sh
# delete the broken default route
sudo route delete default

# add the route to the vpn network
# via the pptp interface
sudo route add -net 192.168.1.0 \
-netmask 255.255.255.0 -interface ppp0

# set the new default route
sudo route add default 192.168.100.254

Date: 2005-03-16 10:21 pm (UTC)
From: [identity profile] sharp-blue.livejournal.com
Yes, that's pretty much what I was doing by hand. It works, but I want it to run automatically whenever I establish the connection. I've found various more or less kludgy ways of doing it - replacing the pppd with a Perl script that changes the arguments to replace "defaultroute" with "nodefaultroute" and the like - but none of them seem to work for me.

Date: 2005-03-16 10:36 pm (UTC)
From: [identity profile] bridgetester.livejournal.com
Write a script that includes that data and establishes the connection? I'm reasonably certain VPN would be scriptable, even if you had to call an applescript...

Date: 2005-03-16 10:38 pm (UTC)
From: [identity profile] sharp-blue.livejournal.com
Yes, that's a good idea. I shall try to set aside an hour or two to learn Applescript this weekend.

Date: 2005-03-16 10:43 pm (UTC)
From: [identity profile] bridgetester.livejournal.com
http://www.google.com/search?q=vpn+applescript

Applescript's a pretty decent language, such as it is...

November 2024

S M T W T F S
     12
3 456789
10111213141516
17181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 20th, 2026 10:53 pm
Powered by Dreamwidth Studios