Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

problems switching between two networks on laptop

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
115552
Tux's lil' helper
Tux's lil' helper
Posts: 108
Joined: Tue Aug 09, 2005 11:35 am

problems switching between two networks on laptop

  • Quote

Post by 115552 » Sun May 06, 2007 6:19 am

hi all..

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" )
Depending on where I am, i just copy /etc/conf.d/net.home or /etc/conf.d/net.work to /etc/conf.d/net and restart eth0. In this thread if i refer to net.home or net.work, it means that i'm copying them to net, and restarting.

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.
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Sun May 06, 2007 9:50 am

OK, we have a few automated means of doing this for you. The easiest solution would be to install a DHCP server at each end and then use DHCP on the clients. If that's not possible, then you can do network detection by use of arping. See net.example in /etc/conf.d/ for how to do this.

Another method is to use different runlevels for home and work. You already have conf.d/net.home and conf.d/net.work - did you know that if you created the runlevels home and work then those config files would be used? Heh.
http://www.gentoo.org/doc/en/handbook/h ... #doc_chap5

Then you just remove the netmount init script from whichever runlevel doesn't have the NFS servers.

There you have it, 3 solutions. Enjoy :)
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
115552
Tux's lil' helper
Tux's lil' helper
Posts: 108
Joined: Tue Aug 09, 2005 11:35 am

  • Quote

Post by 115552 » Sun May 06, 2007 12:32 pm

UberLord wrote:OK, we have a few automated means of doing this for you. The easiest solution would be to install a DHCP server at each end and then use DHCP on the clients. If that's not possible, then you can do network detection by use of arping. See net.example in /etc/conf.d/ for how to do this.
Nah, unfortunately at home i need a specific static ip address for all my shares, nfs, and p2p to work. As for work, they do have a DHCP server, but takes me to a different IP range. I need a static ip for work because i'm hosting a http server.

Arping, that i've never heard of. I would give it a try but the bottom sounds better :)
Another method is to use different runlevels for home and work. You already have conf.d/net.home and conf.d/net.work - did you know that if you created the runlevels home and work then those config files would be used? Heh.
http://www.gentoo.org/doc/en/handbook/h ... #doc_chap5
Then you just remove the netmount init script from whichever runlevel doesn't have the NFS servers.
That i didn't know! i'll try it out when i'm back home. It sounds like a very nice idea.

Thanks for the help, i'll reply when i've done the modifications.
Top
Post Reply

3 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic