Hi Brad, Jason, Adding the 0.0.0.0/0 (or ":::") to the config is what is causing some growth of the arp table, but it is not growing indefinitely. After looking around for SupportsNeighborDiscovery and finding nothing, I decided to check the repro. When not routing all traffic through an interface the arp cache is basically static:
PS C:\> arp -a -N 100.0.0.2 Interface: 100.0.0.2 --- 0x38 Internet Address Physical Address Type 100.0.0.4 dynamic 224.0.0.22 static 224.0.0.251 static 224.0.0.252 static 239.255.255.250 static When routing all traffic through it grows more or less like an arp cache should: PS C:\> arp -a -N 100.0.0.2 Interface: 100.0.0.2 --- 0x38 Internet Address Physical Address Type 0.0.0.0 static 8.8.4.4 dynamic 8.8.8.8 dynamic 13.64.180.106 dynamic 18.211.21.156 dynamic 20.98.103.204 dynamic 23.6.164.43 dynamic 23.40.197.163 dynamic 23.204.103.147 dynamic 35.185.199.42 dynamic 40.83.247.108 dynamic 51.143.14.218 dynamic 54.214.97.217 dynamic 65.8.17.107 dynamic 67.160.11.228 dynamic 69.1.20.242 dynamic 73.118.184.4 dynamic 74.125.142.188 dynamic 74.125.197.188 dynamic 75.75.75.75 dynamic 100.0.0.2 dynamic 100.0.0.4 dynamic 142.250.69.202 dynamic 142.250.217.99 dynamic 142.251.33.74 dynamic 142.251.33.106 dynamic 173.194.202.189 dynamic 192.168.200.2 dynamic 192.228.79.201 dynamic 224.0.0.22 static 224.0.0.251 static 224.0.0.252 static 239.255.255.250 static So I tend to agree with Jason that this is "harmless" and shouldn't cause any serious problems. It would be nice for Microsoft to fix Set-NetIPInterface, it looks like a bug that SupportsNeighborDiscovery can't be set. Best regards, Alan Graham On Thu, Sep 9, 2021 at 11:17 AM Brad Spencer <[email protected]> wrote: > > On 2021-09-09 2:42 p.m., Jason A. Donenfeld wrote: > > So how exactly were > > you "seeing" the ARP requests on the Wintun interface? Did wireshark > > show it? Or did you read from the Wintun ring and actually see an ARP > > frame? Or something else? Or was this just a manner of speaking and > > you didn't actually observe ARP frames themselves? > You're right to suspect that I was speaking imprecisely here. We have > never seen an ARP request appear on the Wintun interface! I meant to > say that we have noticed the ARP table for the Wintun interface > accumulating entries. > > >> We _think_ that the NeighborDiscoverySupported property being Yes means > >> that Windows issues ARP requests for addresses on the Wintun interface. > > That seems like a good intuition. I'm wondering whether that's > > something you're assuming or something you read on a Microsoft > > website. I ask because this might provide a good entry point for > > whatever reverse engineering I wind up doing to fix this. > I pieced this together from a few scraps. > > On the MIB_IPINTERFACE_ROW page[1], the docs only tersely say: > > "A value that specifies if the IP interface support neighbor discovery." > > Microsoft seems to use the same terminology when documenting > SetIpNetEntry2()[2]: > > "The SetIpNetEntry2 function sets the physical address of an existing > neighbor IP address entry on the local computer." > > And then, most importantly, MIB_IPNET_ROW2, the structure used by that > function says this in its Remarks section[3]: > > "For IPv4, this includes addresses determined used the Address > Resolution Protocol (ARP). For IPv6, this includes addresses determined > using the Neighbor Discovery (ND) protocol for IPv6 as specified in RFC > 2461. " > > So, it seems that the "NetEntry" APIs are those that deal with ARP (and > ND) entries, and the term Microsoft uses for that is "neighbor discovery". > > I don't know if the SupportsNeighborDiscovery field of MIB_INTERFACE_ROW > is implied by other properties of the network interface (such as "all > Ethernet interfaces support ARP") or whether it can be individually set > at all. > > One other detail is that we have the gateway for the tunnel's routes set > to 0.0.0.0 (or "::"). I presume that also influences how Windows > decides which addresses might be on-link neighbours. > > 1. > https://docs.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_row > 2. > https://docs.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-setipnetentry2 > 3. > https://docs.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipnet_table2 > > -- > Brad Spencer >
