Opened 7 years ago
Closed 7 years ago
#16826 closed defect (fixed)
Wrong host-only netmask in Windows 10
| Reported by: | rui.godinho.lopes | Owned by: | |
|---|---|---|---|
| Component: | network/hostif | Version: | VirtualBox 5.1.22 |
| Keywords: | windows netmask hostonly | Cc: | |
| Guest type: | other | Host type: | Windows |
Description
host-only interfaces are being created with the wrong netmask. You can reproduce the problem by following the next steps.
Create a host-only interface:
VBoxManage hostonlyif create 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Interface 'VirtualBox Host-Only Ethernet Adapter #7' was successfully created
Assign it an IP and netmask:
VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #7" --ip 10.123.0.33 --netmask 255.255.255.224
List host-only interfaces:
VBoxManage list hostonlyifs
Name: VirtualBox Host-Only Ethernet Adapter #7
GUID: 4028bf58-b908-47e1-a96a-0b2b9a0f6321
DHCP: Disabled
IPAddress: 10.123.0.33
NetworkMask: 255.255.255.7
IPV6Address: fe80:0000:0000:0000:c5ba:3657:c0a8:df00
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:03
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #7
NB as you can see, NetworkMask is incorrectly returned as 255.255.255.7 instead of 255.255.255.224.
List the interface through Windows:
netsh interface ip show addresses "VirtualBox Host-Only Network #7"
Configuration for interface "VirtualBox Host-Only Network #7"
DHCP enabled: No
IP Address: 10.123.0.33
Subnet Prefix: 10.123.0.32/27 (mask 255.255.255.224)
InterfaceMetric: 25
NB as you can see, the network interface in Windows is correctly configured as 255.255.255.224.
Change History (4)
follow-up: 2 comment:1 by , 7 years ago
comment:2 by , 7 years ago
Replying to frank:
The most recent 5.1 Windows test build (>= 116114) has the fix.
The test builds go only up to 116111. Is that a future promise? :D


Thanks for this report. Actually the netmask was correctly set to the host-only adapter but when fetching the netmask back from the adapter, the prefix length was incorrectly converted to a netmask. Only Windows hosts affected. The most recent 5.1 Windows test build (>= 116114) has the fix.