如何在 VMware Workstation 升级期间延续 dhcpd 设置?

如何在 VMware Workstation 升级期间延续 dhcpd 设置?

VMware Workstation 的网络设置在版本升级过程中似乎一次又一次地丢失。由于我今天早上又遇到了这个问题,所以我想最终利用集体智慧看看是否有人有解决方案。

我的设置是带有 VMware Workstation Pro 15.x 的 Windows 10,今天刚刚将其升级到 15.5.0。

默认的 dhcpd 配置文件位于C:\ProgramData\VMware\vmnetdhcp.conf以下位置,如下所示:

#
# Configuration file for VMware port of ISC 2.0 release running on
# Windows.
#
# This file is generated by the VMware installation procedure; it
# is edited each time you add or delete a VMware host-only network
# adapter.
#
# We set domain-name-servers to make some clients happy
# (dhclient as configued in SuSE, TurboLinux, etc.).
# We also supply a domain name to make pump (Red Hat 6.x) happy.
#
allow unknown-clients;
default-lease-time 1800;                # default is 30 minutes
max-lease-time 7200;                    # default is 2 hours

# Virtual ethernet segment 1
# Added at ...
subnet 192.168.41.0 netmask 255.255.255.0 {
range 192.168.41.128 192.168.41.254;            # default allows up to 125 VM's
option broadcast-address 192.168.41.255;
option domain-name-servers 192.168.41.1;
option domain-name "localdomain";
default-lease-time 1800;
max-lease-time 7200;
}
host VMnet1 {
    hardware ethernet 00:50:56:C0:00:01;
    fixed-address 192.168.41.1;
    option domain-name-servers 0.0.0.0;
    option domain-name "";
}
# End

# Virtual ethernet segment 8
# Added at ...
subnet 192.168.65.0 netmask 255.255.255.0 {
range 192.168.65.128 192.168.65.254;            # default allows up to 125 VM's
option broadcast-address 192.168.65.255;
option domain-name-servers 192.168.65.2;
option domain-name "localdomain";
option netbios-name-servers 192.168.65.2;
option routers 192.168.65.2;
default-lease-time 900;
max-lease-time 3600;
}
host VMnet8 {
    hardware ethernet 00:50:56:C0:00:08;
    fixed-address 192.168.65.1;
    option domain-name-servers 0.0.0.0;
    option domain-name "";
    option routers 0.0.0.0;
}
# End

好吧,我撒谎了,底部(在 之后# End)有一行看起来像这样:

include "my-dhcp-hosts.conf";

该文件包含host我想要分配固定 IPv4 地址和主机名的主机的块。

VMNet1虽然升级过程会保留和 VMNet8(子网范围等)的设置,但它只是删除了我的include线路# End

虽然我使用这种方法很好地分离了主机配置,但它在版本升级过程中一次又一次地丢失,尽管文档的措辞暗示那里是规则如何vmnetdhcp.conf“自动更新”(缺乏更好的说法):

所做的更改到 DHCP 配置文件的只读部分下次运行虚拟网络编辑器时将会丢失。

现在这似乎不是什么大麻烦,但如果你一次又一次地在多台机器上这样做,它就会成为一个大麻烦。此外,更改后,还必须重新启动服务VMnetDHCP

有什么方法可以让 VMware Workstation 保留我的改变在明显标记的区域之外......

# Virtual ...
# Added ...
...
# End

... 在版本升级期间?

相关内容