-2

If I know all client will connect to the sever with the same MAC address and to the same interface, is it possible to prevent from server host to send ARP request for each new client IP it gets a connection from?

I tried to add permanent ARP entry with a netmask but seems like it is not supported.

Thanks.

jackhab
  • 751
  • 1
  • 8
  • 20
  • Can you elaborate a little bit? Why do you want to do such a thing? Why would clients all have the same MAC address? – MichelZ Apr 17 '14 at 12:21
  • 1
    Sure, just don't use IP. – Michael Hampton Apr 17 '14 at 13:26
  • @MichelZ: All clients have the same MAC because they are behind a router. I want to do it out of curiousity because I thought this is what permanent ARP entries are for - saving ARP resolution effort. If I can add ARP record for one IP, why can't I do it for an IP range? – jackhab Apr 17 '14 at 16:00
  • @jackhab: This is not exactly true. There will be no ARP lookup for a "client" on another subnet. Your linux server knows that to contact the client, it needs to go through the router, and only lookups the MAC address of the router, not of the destination client. – MichelZ Apr 17 '14 at 16:13

3 Answers3

2

Unfortunately you didn't specify your use case. To me it seems you want to send data to multiple hosts. This is not what layer 2 is for. If you want to send data to multiple hosts, use broadcast or multicast IP traffic. Multicast has been designed to send data from a single host to multiple hosts.

mtak
  • 561
  • 4
  • 11
1

You cannot give an arp query netmask. If you use ARP, you are resolving a MAC address on your local segment to an IP address. Or vice versa (RARP). That is all. If you want to talk to a particular IP - via Ethernet - you must resolve IP to MAC, because that's how ethernet works. As TCP/IP is bidirectional, you both hosts will need to do this.

You can use 'arp -s' to set static IP to MAC mappings. There's not a lot of good reasons to do this.

Sobrique
  • 3,697
  • 2
  • 14
  • 34
1

There might be a missunderstand oh how IP/ARP works.

There will be no ARP lookup for a "client" on another subnet. Your linux server knows that to contact the client, it needs to go through the router, and only looks up the MAC address of the router, not the destination client.

Have a read here: Understanding ARP and Routers

MichelZ
  • 11,008
  • 4
  • 30
  • 58