我的preseed有一個網路介面問題。
這是我的預置檔案(我只放了與網路有關的資料):
當 Debian 被部署時,在檔案 IP 配置是無效的,我必須將介面重命名為 eth0 并重新啟動網路服務。
我應該怎么改,才能使預置的介面命名為eth0而不是ens192?
uj5u.com熱心網友回復: 內核選項顯然只在下次重啟后適用。
安裝程式提供了一個鉤子,可以在完成后從 顯然,需要在早期階段創建
標籤:d-i debian-installer/add-kernel-opts string net.ifnames=0
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 備注
d-i netcfg/dhcp_options 選擇 手動配置網路
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
/etc/network/interfaces 中,盡管添加了 eth0,但介面總是被命名為 ens192 而不是 eth0。d-i debian-installer/add-kernel-opts string net.ifnames=0。preseed中運行任意代碼,所以你可以用它來重命名介面并重新啟動你的網路配置。
d-i preseed/late_command string /usr/local/libexec/your-fix-script
/usr/local/libexec/your-fix-script的東西。你可以從這個鉤子上運行任意的 shell 命令,但是如果這些命令不是很重要的話,把它們放在一個檔案中可能更有意義。
