OpenBSD Journal

A netswitch like tool for OpenBSD?

Contributed by jose on from the mobile-networking dept.

bob writes: "Hi folks,

I'm looking for the netconfig problem, Using the laptop for office networked environment (with DHCP, NIS, NFS etc.) and for home environment (without DHCP, NIS, NFS but with dialup) was quite a setup task etc...

i found x projects for linux but no one which work "easy" with OpenBSD. I tried to modify Netswitch but it didn't work so well with the /etc/hostname.if files.

so my question is what do you use on your laptop?? (or is someone working on a port?)

best, Bob"

"Here are the projects for linux that I found:

Bootprofile for Linux Booting Linux for desired networked environment selected at boot time

Bootprofile clone written in (bourne|korn|posix) shell (look promesing)

NetEnv Netenv sets up a file containing variable assignments which describe the current environment. This can be used by the PCMCIA setup scheme, e.g. like the one that comes with Debian/GNU Linux and perhaps others.

divine divine starts a thread that injects fake arp requests into the network. The thread will try again up to three times, pausing 1 second between retries. If the last try times out again, the thread will print an error message, leave the interface in the original state and exit cleanly.

QuickSwitch - Roaming network profiles for Unix/Linux Laptops. QuickSwitch is a utility that lets Linux/Unix laptop users create and use roaming network profiles. Instead of individually reconfiguring the network card, changing DNS entries, hosts files etc. it lets you create one centralized file for all your different profiles. QuickSwitch has been around since early 2000 and is now the most widely used utility of its kind. also a Gnome Tray Applet is here.

Netswitch is a linux system admin script that 'remembers' several network configurations. Users can switch between network configurations with a simple command-line interface (CLI) command like ' home' or ' work'"

(Comments are closed)

  1. By Anonymous Coward () on

    I just set my laptop to use dhcp by default, then I have a script that reads in an argument and sets up the network appropraitelly.

    ie: ./netsetup kent
    would setup my ip's default routes etc for when I'm in the Kent office

  2. By jcs () on

    i use a perl script called from /etc/rc (replacing /etc/netstart) that has a hash of locations and interface settings.

    it loops through each one looking to see if the interface has media and then uses arping (in ports as net/arping) to ping the router of each network. if it replies, that network is configured. if not, it tries the next one. if none respond, it falls back on dhcp.

    i use it every day as i take the laptop to work (ethernet) and back home (wireless).

  3. By djm () on

    I have a wi (Prism 2.5) card for home and an an (Cisco 350) card for work. Each has a different hostname.if file, so it picks up the correct network configuration depending on what hardware I have inserted.

    If this is too much of a cop-out for you, it would be trivial to modify /etc/rc to look for a list of "configuration sets" under a subdirectory of /etc and pause its execution until one is selected (perhaps with a timeout).

    The nice thing about the OpenBSD boot process is that it is so minimal that it is easy to hack things like this in.

  4. By hubertf () on

    NetBSD has newbtconf, dunno if OpenBSD took that or not:

    newbtconf - multiple boot-up configurations

    newbtconf new-conf-name [orig-conf-name]
    newbtconf init

    newbtconf is used to setup the system in such a way that the user is of-
    fered a selection of environments in which to boot the system up into.
    The most obvious application being for laptops to provide a network and
    non-network environment after a successful boot into multi-user mode.

    - Hubert

  5. By shef () on

    i have 3 shell scripts.

    ifconfig down
    ifconfig ne3 inet...
    ifconfig up
    echo "nameserver" > /etc/resolv.conf
    route del default....
    route add default....

    I think it simple.

  6. By Coleman Kane () on

    I have always used shell scripts. I never really saw the point to large, cumbersome, configuration software that are typically buggy and restrictive. I have a laptop with wireless that I drag to home, school, and frequently friends houses and other wi-fi enabled places here in cincinnati. I just keep a slew of shell scripts in my ~/. When I want to add a new locale I simply copy another as a template. The work you put in to entering all those values in another program, as well as installing that program is usually more than you would put into maintining a list of shell scripts. Then you can also easily go in and add things that the author may not have thought of...

    1. By lincr () on

      I have to agree. On my laptop at my old job I used Linux with several scripts (homelan, worklan, wirelessstart, wirelessstop) that just contained the ifconfig and route commands, except the wireless scripts had to turn the radio on and off.

      Now I have OpenBSD on an iBook, and I mostly just leave the nic on DHCP for work and use the modem at home (ppp -foreground work). It's nice to have a laptop with a modem that works under any OS, since I used to have to mooch my dialup connection from another machine. When I need to transfer files at home I just use ifconfig.

      I've only had the old 366 iBook for a couple of months, and I'm thinking that when warm weather hits it might be nice to sit on the porch with a wireless connection...

  7. By Anonymous Coward () on

    There is a shell script written for OpenBSD that works with the 'wi' driver. It's found at it's worked well for me. It detects what wireless networks are available and writes out the approprate hostname.if file(s). I had dhcp at work with WEP and a static ip at home with no WEP (I'm tunneling all traffic over ssh). I also have it set up to work with various wireless networks at friends homes, in my neighborhood etc.

    1. By Anonymous Coward () on

      Clickable url


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]