Re: VPN and Scripts?



On Wed, 2006-04-05 at 08:16 -0400, R� Cardona wrote:
> Tim Ansell wrote:
> > I was wondering if it was possible to setup scripts to be run after a
> > certain network is connected.
> > 
> > For example I need to setup some special routes and stuff for my Uni
> > network to work. Currently NM finds the network and connects fine, I
> > just need to add them by hand.
> 
> Don't know about this one ...

You can use the dispatcher daemon (NetworkManagerDispatcher) to set
stuff up when a particular interface goes up or down.  If the dispatcher
service is enabled, it will execute any script
in /etc/NetworkManager/dispatcher.d owned by root with permissions of
700, and pass in two arguments:  "<interface> <up | down>".  This only
happens for master interfaces though, and not VPN tunnel interfaces.

> > I also connect to another wireless network which uses a Cisco VPN
> > concentrator for network encryption. I can connect to it find with vpnc,
> > I was hoping I could also have this start after NM connects.
> 
> I'm sure it's doable but until the keyring password issue is settled, 
> it'll ask for your password, kind of killing the automation you're going 
> for.

NM currently doesn't support starting a VPN connection automatically,
but you _can_ do this with the magic of DBUS :)  The applet just sends a
dbus signal to NM when you click on the VPN's entry, so you can do this
from the dispatcher-daemon-run script if you'd like
with /usr/bin/dbus-send.  The applet has a little magic to deal with the
password dialog though, I think.

> > I also have a wireless network which has a DHCP server on it but I would
> > like to use static IP address, is there anyway I can do this?
> 
> In theory, the backend for your specific distro should handle this case 
> by setting the parameters in your /etc/... files. However this is very 
> distro specific and NM does not (yet?) allow users to set up static ip 
> addresses.

NM does allow setting the static IP in a distro-specific manner, but
this is entirely manual and once you set a static IP on the interface,
it will _ALWAYS_ have that static IP no matter where you go.  So if you
want wireless static IP, that severely reduces your portability between
wireless networks.  We hope to fix this limitation in the next release.

> > Finally different networks I connect to have different proxy settings,
> > is there anyway I could get NM to change the proxy settings when I
> > connect to different networks?
> 
> Again, it's not done yet, but the idea is nice though.

Yeah, not easily done yet unless you can do this from the dispatcher
script for the moment.  Could be somewhat automated, except that when
you connect to a wired network, you have no real idea what network that
is.

Dan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]