I have a laptop which i have to work in between my home and at work. At work, it's just a simple 10.0.0.0/8 network, and at home it's a 192.168.1.0/24 network, but with NFS shares, automounted at boot to my laptop with /etc/conf.d/nfsmount.
I need to be able to take my laptop to work without the hassle of waiting 10 minutes for it to timeout from not finding the NFS shares, and I also need to automate its nameserver recognition. So, here are my questions.
With home network (192.168.1.0) and work network (10.0.0.0). I have two /etc/conf.d/net.home and net.work,
Code: Select all
cat /etc/conf.d/net.home
config_eth0=( "192.168.15.68 netmask 255.255.255.0" )
routes_eth0=( "default gw 192.168.15.1" )Code: Select all
cat /etc/conf.d/net.work
config_eth0=( "10.0.0.68 netmask 255.0.0.0" )
routes_eth0=( "default gw 10.0.0.5" )But I found two problems.
1)
The nameservers arn't being updated in /etc/resolve.conf. Each network has two nameservers. I have to manually edit /etc/resolve.conf and comment out the two I don't need. Is there a way to automate this? To tell net.work and net.home to update resolve.conf with their own nameservers respectively ?
2) I had nfsmount running in my default RC when booting up. If i'm at home, that's fine. If i go to work and startup the machine, it takes 10 minutes waiting until it timesout from all the NFS shares. As a temporary solution, ihad to disable nfsmount, and run it manually whenever Ii'm back at home.
Is there a way to tell my laptop to only run nfsmount from net.home, and not from net.work ?
Finally, the way I've set it up as shown, with net.home and net.work, Is this a good method or are there better ones ?
Thanks.

