我的前置种子出现了网络接口问题。
这是我的预设(我只放了与网络相关的数据):
d-i debian-installer/add-kernel-opts string net.ifnames=0
d-i netcfg/choose_interface select auto
d-i netcfg/choose_interface select eth0
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string 192.168.0.50
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_nameservers string 8.8.8.8
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string debian-template在部署Debian时,尽管添加了:d-i debian-installer/add-kernel-opts string net.ifnames=0,但在文件/etc/network/interfaces中,接口始终被命名为ens192而不是eth0。
IP配置无效,我必须将接口重命名为eth0并重启网络服务。
我应该如何更改才能使预设种子将接口命名为eth0而不是ens192?
发布于 2021-09-15 07:16:23
内核选项显然只会在下一次重新启动后应用。
安装程序提供了一个钩子,可以在从preseed运行任意代码后运行它,因此您可以使用它来重命名接口并重新启动网络配置。
d-i preseed/late_command string /usr/local/libexec/your-fix-script显然,需要在更早的阶段创建/usr/local/libexec/your-fix-script。您可以从这个钩子运行任意的shell命令,但是如果它们非常重要,那么将它们放在一个文件中可能是有意义的。
https://stackoverflow.com/questions/69179975
复制相似问题