The title to this article may be a bit misleading. What I mean by managing several networks is when you want to quickly switch network configurations due to several different setups your testing in your coLinux, or if you have coLinux on a laptop, and you switch from wireless to hardwire network and from NAT to bridged repeatedly (As far as I can tell, bridged networking is not supported well, if at all, on wireless ethernet cards). Due to this, its often good to be able to double-click on a batchfile in Windows that has a particular network config, and have the co Linux come up on the appropriate network once it boots. This can be accomplished via colinux-daemon command line parameters and via the /proc/cmdline file in coLinux itself.
The first task is to set up a coLinux batch file as follows:
colinux-daemon -t ~[nt|fltk] kernel=vmlinux mem=64 eth0=tuntap cobd0=root_fs root=/dev/cobd0 ro location=home %*
The parameters *kernel*, *mem*, *eth0*, *cobd0* and others, of course, are based on your specific configuration, but I'm giving one sample config out of thousands of possibilities. The *location=home* parameter at the end is to define, as an example, a particular location specific config.
Also of note is the last parameter %*, which allows for the passing of command line parameters to the batch file, which then get passed on to the coLinux kernel in question. This allows for quick booting into single-user-mode, as an example, but just doing <batchfilename> -s.
To make different boot batchfiles, just copy the above contents to different files with different names; give them different *location* parameters, and then parse them differently within the OS.
Such a parsing is given as follows:
In your /etc/init.d/networking (depends on the distribution used, of course), you can test for different boot styles with:
if grep -qsw "location=home" /proc/cmdline; then <do specific location setup here> fi
This way, with *location=home*, you can boot up with one style of network, with *location=work*, you can boot up with another, and *location=bridged* could boot up with a third style. These, of course, are all arbitrary names. You could just as very well use just *home*, *work* and *bridged* as keywords, and it would work just the same.
This might not be as useful on a land-line based network, as the host computer's network and addressing rarely changes, but on a laptop, where you can move between different wireless access points, landline cables, and NAT vs. Bridged configurations (bridged networking doesn't work via wireless cards well, if at all), it becomes very useful. I have a total of 3-4 different network profiles I use constantly depending on where I'm using my windows/colinux system from.
I hope this is of use. Let me know.
-- Ian Bonnycastle <ibonny at landvale dot com>
10-19-2004 6:45pm EST
I just realized, that another method of using this is to define one batch file, as above, and just pass different location= (or other such keywords) via the command line. Then, inside coLinux if you don't find any keyword that defines a network type, or an invalid keyword is used, just use a default (or no) networking.
MassTranslated on Sun Apr 23 17:36:28 UTC 2006