Slashdot Mirror


Location Profiles For Unix Laptops?

Cyron Green asks: "I travel quite a bit with my laptop (it keeps me company). I hate having to change my NIC settings everytime I stop somewhere or I go from work to home. Is there any type of Location Managment software out there for Linux or FreeBSD?"

4 of 15 comments (clear)

  1. cardctl scheme by Tet · · Score: 3
    In times gone by, you used to be able to do:
    cardctl scheme home
    cardctl scheme work

    to switch to your home or work network settings respectively. However, at some time around Red Hat 6.x, this stopped working. By then, though, I wasn't using the laptop enough for me to bother to find out why... Can anyone shed any light on this?

    --
    "The invisible and the non-existent look very much alike." -- Delos B. McKown
    1. Re:cardctl scheme by William+Aoki · · Score: 4

      PCMCIA schemes are set up in /etc/pcmcia. Your network settings live in /etc/pcmcia/network.opts and are used by the script /etc/pcmcia/network.

      RedHat replaces /etc/pcmcia/network with a script that uses RedHat's network configuration files in /etc/sysconfig/network-scripts. This allows you to use the GUI configuration tools to set up your network but prevents you from using schemes to handle your network configuration. On my RedHat laptop, I went diving in the pcmcia-cs source tree to find the 'normal' /etc/pcmcia/network so I could use schemes.

      That said, I normally leave my laptop set to obtain network configuration information from DHCP. The DHCP servers on networks where I have a static IP have been told to reserve it for my laptop (well, technically, for my laptop's NIC), and when visiting other networks I don't have to futz around finding an IP. Whenever the computer is away from its home network, it uses MobileIP to bring up a tunnel back to its home agent. It looks more or less the same to other hosts regardless of its location, and I can suspend the laptop, drive to another location, and plug in to a completely diffirent network without disturbing my ssh sessions.

  2. I just used bash scripts by True+Dork · · Score: 3

    That was driving me nuts too, so I installed sudo, gave my user account sudo rights to ifconfig, route, and pump. Then my scripts looks similar to:

    #!/bin/bash
    sudo ifconfig eth0 192.168.0.50
    sudo route add default gw 192.168.0.1

    or...

    #!/bin/bash
    sudo pump -i eth0

    Now, if you need to change your resolv.conf, maintain several and chown them to your user account. That way you can have resolv.conf.work, resolv.conf.home, resolv.conf.client3 and hell, you could symlink /etc/resolv.conf to which one you ned in the bash script. I dont have that problem as I just use my ISP's named from wherever I am. A little slower, but I dont have to change anything!

    After I made all my scripts, I put a menu in my KDE bar that had links to all my scripts. I bring the laptop out of suspend, click the bar, choose where I am, and poof.

  3. Runlevels by lizrd · · Score: 3

    I've heard of some people setting up init scripts on laptops to use the (generally) unused runlevel 4. Usually I've heard about this in terms of enabling some power management features, but I don't see why you couldn't change the network startup scripts while you were at it. Once you'd done that it would just be a matter of typing init 4 or init 5 to switch between two different profiles.
    _____________

    --
    I don't want free as in beer. I just want free beer.