4

I am currently running coLinux configured in "ndis-bridged" networking mode, on a machine whose wireless networking card or driver seems incapable or unwilling to accept non-broadcast layer 2 traffic, or traffic not destined for the wireless card's primary MAC address.

After figuring out this was the problem, I tried configuring the coLinux interface to have the same MAC address as the host machine. Magically, networking started to function. Unfortunately only a single problem remains: the host machine cannot talk to the coLinux instance, even though the rest of the LAN can.

I figured out that by adding a static ARP entry to the host for the coLinux instance's IP address(es), I could accomplish full connectivity in bridged mode, even though the wireless card/driver didn't want to play along.

Despite the hackishness of this setup, I would like to keep it for a few reasons, primarily of which is IO performance for the coLinux instance. This brings me to a problem: persisting the ARP entries on the host machine.

I have searched the web, but have been unable to find the WinNT equivalent of /etc/arp from UNIX. Does such a file exist? I suspected somewhere in the registry, but alas, my searches thus far have been fruitless.

My only alternative is to run a batch file at startup to recreate the ARP entries using the arp command line tool, but this, ironically, seems hackish. :)

Thanks.

8
netsh interface ipv4 add neighbors "Local Area Connection" 10.1.1.1 12-34-56-78-9a-bc

this will create a static arp entry that survives reboots. be careful adding the entries though, as you may not be able to remove them without a hotfix:

https://support.microsoft.com/en-us/kb/2718830

  • Is it possible to disable arp feature completely after setting a static arp entry on Windows? You can do this in Linux. ip link set dev eth0 arp off or ifconfig eth0 -arp. I don't want my windows device to reply to other device's ARP requests because of some reasons. I will just add the gateway's MAC entry manually. So that my internet connection will work. – Sourav Ghosh Oct 29 '18 at 9:32
2

There is no built-in mechanism for persistent ARP entries in Windows. Your best bet is to use a Startup Script to specify the necessary static ARP entries on each boot.

  • FYI this is incorrect as of Windows Vista. see my answer below. – goofology Apr 16 '15 at 0:39
1

You should be able to use arp -s command in order to add a static entry to the ARP table

arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.

  • 2
    Hi Conor, this command only creates an entry for the lifetime of the running machine. It does not persist across reboots, at least as far as I can tell. :) – dmw Jan 14 '10 at 17:03
0

The problem with NDIS drivers is they add an additional layer between the OS and the network card making things like working at the layer2 level difficult (particularly with wireless cards). In looking at the coLinux website(http://colinux.wikia.com/wiki/Network#Recommended_Setup) they recommend using 2 virtual interfaces: One for coLinux to communicate with the LAN and one for coLinux to communicate with the host. Have you considered this configuration?

0

There exists the command arp -s in Windows for doing this, but be careful I think from Vista on it does not work anymore (just tested it under Win10 with an administrative command prompt). arp shows no error but after arp -a the entry is not shown.
Only way is as @goofology has written is via netsh. This issue did cost me some time some years ago, I had tried it on multiple PCs. [cannot comment Conors answer with the arp -s suggestion so I do this as an answer for all others who try to do it via arp -s]

0

netsh is no longer the preferred method for network interface management on a Windows system. Where possible, you should use Windows Powershell or Powershell Core. First you need to find out the interface index of the interface you wish the ARP cache entry to apply to:

Get-NetIPInterface

Which returns a list of your interfaces, and specifically a property called ifIndex. In my case, my primary interface has an index of 12 so I will use that for the following commands.

To create a static ARP cache entry for that interface:

New-NetNeighbor -InterfaceIndex 12 -IPAddress '192.168.0.10' -LinkLayerAddress '0000120000ff' -State Permanent

Which returns:

ifIndex IPAddress      LinkLayerAddress      State       PolicyStore
------- ---------      ----------------      -----       -----------
12      192.168.0.10   00-00-12-00-00-ff     Permanent   PersistentStore

This will set persistent ARP cache entries that survive a reboot. You can reboot, then double-check by running this:

Get-NetNeighbor -InterfaceIndex 12 -IPAddress 192.168.0.10

Which should return the same entry you saw before rebooting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.