DHCP IP configuration in VMware¶
In a VMware environment utilizing NET mode networking, a virtual machine's network interface can be configured to obtain an IPv4 address automatically via DHCP^[600-developer-tools-vscode-vmware.md]. This configuration is achieved by modifying the network interface configuration file and ensuring the interface is active.
Configuration File¶
The configuration is typically stored in a file named after the network interface (e.g., ifcfg-ens33 for device ens33).^[600-developer-tools-vscode-vmware.md] To enable DHCP, the BOOTPROTO parameter must be set to dhcp^[600-developer-tools-vscode-vmware.md]. Additionally, the ONBOOT parameter must be set to yes to ensure the network interface activates automatically at boot^[600-developer-tools-vscode-vmware.md].
Example Configuration¶
The following is an example of a valid DHCP configuration for a device named ens33^[600-developer-tools-vscode-vmware.md]:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=deff87b2-8e32-4c73-971e-d38f6b258113
DEVICE=ens33
ONBOOT=yes
IPV6_PRIVACY=no
PREFIX=24
Related Concepts¶
- [[Static IP configuration]]
- [[VMware Networking]]
Sources¶
^[600-developer-tools-vscode-vmware.md]