-
Notifications
You must be signed in to change notification settings - Fork 3.3k
HTTPIP on Windows gets IP address from wrong Ethernet adapter #10168
Copy link
Copy link
Closed
Labels
Description
Overview of the Issue
When using Packer on Windows, the {{ .HTTPIP }} variable picks up the wrong IP address. My ipconfig looks like this below:
Windows IP Configuration
Ethernet adapter vEthernet (Default Switch):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::4db:cb2a:a777:7cd2%26
IPv4 Address. . . . . . . . . . . : 172.25.16.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
Ethernet adapter vEthernet (WSL):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::20b0:da9b:6cb1:e6b%32
IPv4 Address. . . . . . . . . . . : 172.18.96.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : localdomain
IPv4 Address. . . . . . . . . . . : 10.0.30.44
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.30.1
The last adapter, Ethernet is the one that should be picked as that is the only one accessible by my local server where the VM is provisioned. However Packer insists on using 172.25.16.1 for HTTPIP. This can probably be avoided by specifying bind address to the correct one, but then this configuration becomes specific to the machine it runs on as the bind address would need to be changed.
Reproduction Steps
- Have some vEthernet adapters, usually from a WSL/WSL2 installation.
- Use the HTTPIP variable.
- The HTTPIP variable is the IP address of the vEthernet adapters.
Packer version
Packer v1.6.4
Simplified Packer Buildfile
Shouldn't be buildfile specific.
{
"boot_command": [
"<enter><enter><f6><esc><wait> ",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<enter>"
],
}
Operating system and Environment details
Running from Windows 10 machine.
Using Proxmox builder.
Reactions are currently unavailable