I had setup an infrastructure for automatic installation of Debian based machines. It uses PXE booting with DHCP and TFTP servers, and preseed to automate the OS installation.

What I want is:

  • use DHCP for PXE boot
  • use DHCP for Debian installer: it needs an IP address to access the preseed file and I don't want to enter it manually
  • use a static IP address on the final installed OS. This IP address will be specified in the preseed file.

But I can't find how to do that, even know if it's possible.

My current preseed file looks like this (network parameters only):

# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
d-i netcfg/disable_autoconfig boolean true

# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually

# Static network configuration.
# IPv4 example
d-i netcfg/get_ipaddress string
d-i netcfg/get_netmask string
d-i netcfg/get_gateway string
d-i netcfg/get_nameservers string
d-i netcfg/confirm_static boolean true

(I also tested commenting the line d-i netcfg/disable_autoconfig boolean true with the same result).

Do anyone knows how to do that?


ps: It's Debian Wheezy


Use in preseed options of your's own command execution after installation:

d-i preseed/late_command string wget http://your-web_or_ftp/unattend/dopostinstall.sh -O /tmp/dopostinstall.sh;  chmod +x /tmp/dopostinstall.sh; /tmp/dopostinstall.sh

The dopostinstall.sh something like that:


echo -e "auto lo eth0 \niface lo inet loopback\n\niface eth0 inet static\n\t address\n\t netmask\n\t gateway\n\t dns-nameservers" > /target/etc/network/interfaces
  • Thanks for this tip, even if it's not the way I wanted to do it, directly from debian-installer. Maybe there is a bug or my use case is special. I'll try it. – daks Sep 17 '13 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.