Hi,

Am Montag, 22. August 2005 19:22 schrieb Blaisorblade:
> That's VERY interesting. But UML's trick to variate the MAC was never
> tested in that case. Is that the one enabled by CONFIG_IP_PNP (i.e. "IP:
> kernel level autoconfiguration")?

yes.


> It seems yes, and that code seem to have the same problem (it first brings
> up the interface, and later assigns it the IP). Uml obviously can't change
> the MAC while the interface is up (I guess that would for sure break DHCP,
> for instance), so the only way to make it re-choose its MAC is to shut the
> interface down and bring it up again with the IP.

OK, i see the point. I don't really find this bad, but i was confused about 
each uml has the same MAC. So if you know this, you can easily assign a 
MAC-address on the command line.


> > The benefit is, i can copy one uml-fs for testing, start the backup uml
> > with a different ip on the backup-root-fs without changing the
> > backup-root-fs or startup-scripts inside the uml.
> I pass the IP on the command line as an env var and manually parse it
> inside the distro's boot scripts.

Ah, also a good solution. But i like it to keep as much of the configuration 
outside the uml, so that i don't have to change much inside the uml (ok, 
copying one network script is not that much to change). So now, i can copy a 
server and have only to deactivate the networking (ifconfig) setup.
The assigning of an MAC-address i also made in my uml config and also take the 
ip as reference.

In short, i have a config-file, where you can set the ip, the name, the ubd 
devices and so on. The config file also tries to make a lot of the 
configuration itself. So i can easily take these configuration to another 
host system with the same configuration things.


if someone is interested in my scripts, i add these here:
http://prometheus.mhcodi.com/uml/uml.tgz
 * /etc/init.d/uml
     Can be linked to the varius runlevels for starting all the umls at boot
     time and shutding down all umls when the host system goes down.
 * /etc/network/interfaces
     The Debian way of setting up network interfaces. I automatically add tap
     devices here when i add a uml with /usr/local/sbin/uml_add .
 * directory /usr/local/share/uml/template/
     Here i have a sample configuration (config), also used by uml_add, with
     a uml kernel (linux, /proc/config.gz is activated) and a teeny script
     (boot) to finally start a uml. The script boot can also run manually with
     additional arguments by the uml user to see live whats happen (if the uml
     doesn't startup, the corresponding screen will also immediately quit).
 * /usr/local/sbin/uml_tunctl_wrapper
     A little helper script for setting up tap devices, used by interfaces,
     and make these info available for the uml config.
 * /usr/local/sbin/uml_ctl
     Control-script for starting and stopping a uml instance. This is also
     used by /etc/init.d/uml . As root you can easily start and stop each
     uml separated. The output of a uml is redirected to a new screen
     instance. You can reconnect to this screen with "screen -D -R umlname".
 * /usr/local/sbin/uml_add
     My little baby for easily creating new uml instances. It configures the
     networking on the host system, creates a rootfs directory which is
     immediately nfs exported and does a debootstrap in this directory
     to create a very fresh Debian system. (OK, my scripts are very Debian
     specific, so my hosts are Debian. You also can skip (ctrl-c) the
     creating of the root-fs and create your own or copy a existing system to
     this directory.)
     My creating of the root-fs also changes fstab and inittab of the root-fs
     so the uml will corrctly boot. Also the /lib/tls will be moved out of
     the way.
     This script perhaps is very very specific to me, but maybe its helpful
     for someone creating scripts for a lot of umls.

My scripts are designed to only set one option at one place. So you have to 
assign tap devices to users in interfaces, because this is a job of the root 
user and can't be made in the uml config. And the rest of the config is in 
the config file.

Oh, i forgot, my scripts expect a different user for each uml instance. And 
uml_add will create a new user for each uml. So the uml user will always be 
equal to the uml name.


Hope somebody finds this informations useful :-)


-- 
greetings

eMHa

Attachment: pgpxAn5WB1xmH.pgp
Description: PGP signature

Reply via email to