我已经为基于Debian的机器的自动安装建立了基础设施。它使用PXE引导与DHCP和TFTP服务器,并预置,以自动化的操作系统安装。
我想要的是:
但我找不到该怎么做,甚至也不知道是否可能。
我当前的预置文件看起来如下(仅网络参数):
# 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 192.168.1.10
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.1.254
d-i netcfg/get_nameservers string 192.168.1.1
d-i netcfg/confirm_static boolean true(我还测试了用相同的结果注释行d-i netcfg/disable_autoconfig boolean true )。
有人知道怎么做吗?
谢谢。
ps:我是Debian Wheezy
发布于 2013-09-04 13:05:04
在安装后执行自己的命令的预置选项中使用:
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.shdopostinstall.sh是这样的:
#!/bin/ash
echo -e "auto lo eth0 \niface lo inet loopback\n\niface eth0 inet static\n\t address 192.168.1.10\n\t netmask 255.255.255.0\n\t gateway 192.168.1.254\n\t dns-nameservers 192.168.1.1" > /target/etc/network/interfaceshttps://serverfault.com/questions/526161
复制相似问题