Friday, August 3, 2007

NetworkManager and NetworkManagerDispatcher

Imagine you connect your laptop to your home network and you want to authenticate against nis.home.org, using automatically mounted home directories from fileserver.home.org. The following morning, you arrive at the office and connecting your laptop to the network there, you wait for ypbind to bind to nis.home.org (which just so happens to be unavailable), and you cannot log in directly as your home directory cannot be mounted (because fileserver.home.org just so happens to be unavailable too). In addition, your office uses LDAP authentication and has a group data share you want to mount.

I'm guessing you'll need to at least disable ypbind, and maybe change authentication configuration and start using LDAP. You're also probably gonna want to mount that group data share and not automount your home directory from some NFS share.

Are you performing all these changes by hand? Does your office allow you to change it all? How does the office manage to support all that? I don't know.

What I do know is that I personally have a similar use-case with my laptop that I want to be able to connect to my home network having NIS and autofs, while not having to change the system configuration when I'm 'offline' -not connected to my home network.

I've begun to use the NetworkManagerDispatcher: it allows me to execute some scripts that would be able to detect wherever I am and adjust my system configuration accordingly. I'll call it NetworkManagerDispatcherScripts (don't try and say that out loud very fast, twice). There's a proof of concept piece of code at http://git.kanarip.com/?p=nmdscripts/.git which you can get with;

git clone git://git.kanarip.com/nmdscripts/

Execute the ./nmdscript script and see if you're connected to one of the pre-configured networks (which all apply to my home networks). Until now, it's just detecting some network characteristics and not executing any system configuration changes, and I'm just curious what anyone thinks about it.

No comments: