PS C:\> Set-VMProcessor -VMName hvm -ExposeVirtualizationExtensions $true
PS C:\> Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -RestartTwo more virtual machines (nested) with Debian Linux deployed on this virtual machine. I'm trying to set up a local network between these two VMs using Hyper-V Network Virtualization (according to documentation, it's called HNVv1). HNVv1 configured as follows:
PS C:\> Get-NetVirtualizationProviderAddress ProviderAddress : 192.168.1.2 InterfaceIndex : 5 PrefixLength : 24 VlanID : 0 AddressState : Preferred MACAddress : XXXXXXXXXXXX ManagedByCluster : False PS C:\> Get-NetVirtualizationProviderRoute InterfaceIndex : 5 DestinationPrefix : 0.0.0.0/0 NextHop : 192.168.1.1 Metric : 0 PS C:\> Get-NetVirtualizationCustomerRoute RoutingDomainID : {9CC4A292-A1C6-41DF-A4ED-4C78F850E682} VirtualSubnetID : 4101 DestinationPrefix : 192.168.46.0/24 NextHop : 0.0.0.0 Metric : 255 PS C:\> Get-NetVirtualizationLookupRecord CustomerAddress : 192.168.46.2 VirtualSubnetID : 4101 MACAddress : 00155d5d2a02 ProviderAddress : 192.168.1.2 Rule : TranslationMethodEncap VMName : UseVmMACAddress : False Type : Dynamic CustomerAddress : 0.0.0.0 VirtualSubnetID : 4101 MACAddress : 00155d5d2a02 ProviderAddress : 192.168.1.2 Rule : TranslationMethodEncap VMName : vm01 UseVmMACAddress : False Type : L2Only CustomerAddress : 0.0.0.0 VirtualSubnetID : 4101 MACAddress : 00155d5d2a03 ProviderAddress : 192.168.1.2 Rule : TranslationMethodEncap VMName : vm02 UseVmMACAddress : False Type : L2OnlyEach nested virtual machine has two virtual network adapters:
VMName SwitchName VirtualSubnetId MacAddress DhcpGuard RouterGuard ------ ---------- --------------- ---------- --------- ----------- vm01 vs01 0 00155D5D2A00 Off Off vm01 vs01 4101 00155D5D2A02 Off Off vm02 vs01 0 00155D5D2A01 Off Off vm02 vs01 4101 00155D5D2A03 Off OffAdapters with MAC addresses 00155D5D2A00 and 00155D5D2A01 have static IP addresses 192.168.1.3 and 192.168.1.4 respectively and use for ssh, further not of interest.
Virtual machine vm01 has static IP address 192.168.46.2 that learned by Hyper-V as expected (Dynamic LookupRecord). Also, isc-dhcp-server installed on vm01. It's configured to offer addresses from subnet 192.168.46.0/24 on eth1 (00155D5D2A02).
root@vm01:~# tail -n 4 /etc/dhcp/dhcpd.conf subnet 192.168.46.0 netmask 255.255.255.0 { range 192.168.46.10 192.168.46.50; # option routers 192.168.46.1; }
root@vm01:~# tcpdump -e -n -i eth1 17:20:28.909319 00:15:5d:5d:2a:03 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:5d:5d:2a:03, length 300 17:20:28.909603 00:15:5d:5d:2a:02 > 00:15:5d:5d:2a:03, ethertype IPv4 (0x0800), length 342: 192.168.46.2.67 > 192.168.46.10.68: BOOTP/DHCP, Reply, length 300 17:20:30.180282 00:15:5d:5d:2a:03 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:5d:5d:2a:03, length 300 17:20:30.180496 00:15:5d:5d:2a:02 > 00:15:5d:5d:2a:03, ethertype IPv4 (0x0800), length 342: 192.168.46.2.67 > 192.168.46.10.68: BOOTP/DHCP, Reply, length 300
root@vm02:~# tcpdump -e -n -i eth1 17:20:28.898397 00:15:5d:5d:2a:03 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:5d:5d:2a:03, length 300 17:20:30.185906 00:15:5d:5d:2a:03 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:15:5d:5d:2a:03, length 300So my question is why the DHCP response not getting throw? Why this response doesn't match L2Only LookupRecord? If I manually add static LookupRecord with MAC address 00:15:5d:5d:2a:03 and customer IP address 192.168.46.10, vm02 can see the DHCP reply and setup offered IP address, but, obviously, this not what I'm waiting for. I just need working DHCP in virtual local network and need Hyper-V to automatically collect addresses received from DHCP. Microsoft documentation about HNVv1 mentions, that this technology can do such things and L2Only LookupRecord was added especially for this purpose.