Modprobe prepare new IP address

Hello,

I m working on virtualization and saved the templates in virtual server. On creating the new Virtual machine or linux system, is there a way where during booting, it should prompt for new IP address, gateway, DNS and hostname?

Or is there any configuration in linux where we can modify booting properties so that it will prompt for new ip address, dns, gateway and hostname?

Thanks in advance.:confused::confused::confused::confused:

Not sure what you mean by "prompting for new" items. You can configure all named items when setting up the machine, or when logged in as root, or, you can use bootp/DHCP services to have the machine configure itself during boot time (except the host name, not sure).
If you "copied" a virtual machine, and want to configure the new one manually lest it resemble the old one, you need to run it standalone, i.e. without network access, for the first time to arrange for the parameters.

Hello RudiC,

Thanks for reply, let me further elaborate:

Actually I installed RHEL on a server, i cloned it to another server, but its not prompting to create new ip address on boot, meaning still using same old MACADDR. So what I am requesting is, for the cloned RHEL, is there any configuration where ,I can 'reset' the configuration and should automatically prompt us to provide new ip address, gateway, dns, and hostname during boot, without manually modify the ifcfg-eth0 files.

This is what I am trying.

I don't think you are "using same old MACADDR" as this is unique and defined by/on the NIC of the new machine, unless explicitly overwritten in rare cases.
Why the effort? Why not adapt the configuration files once and forever? Or, use DHCP! What the intention behind your request?

You may explore writing up something and having it in /etc/rc.local

You may have some wrapper which takes your input and sets the interface or populates the required network files.

But this approach is post boot/network address acquiring stage.

A year or so ago I had to solve this exact problem for a 100+ VM deployment. You're not going to get around either configuring the template to not include the mac addresses, do DHCP and use a satellite to execute a script to save the current network config as the static config (bad idea, but it solves this particular problem) or what I ended up doing. You're probably going to need to script something yourself and have rc.local call it.

I ended up writing a script that would check to see if all the MAC addresses that were configured I could still find underneath /sys/class/net and if it didn't, it would enumerate the iterfaces that were there, prompt the user for a new hostname, IP addressing info, etc then rename the interfaces as appropriate restart the "network" and services.

One thing that caught me was that in RHEL6 (and possibly RHEL5) you have to disable the plymouth bootsplash in order to be able to accept input from the user at the console.