From: Rahul on
I was trying to specify a static arp list for servers in a cluster by using

arp -f /etc/ethers

cat /etc/ethers
00:07:43:06:8A:AD 192.168.0.1
00:07:43:06:8A:AA 192.168.0.2
00:07:43:06:8A:B0 192.168.0.3
00:07:43:06:8A:AB 192.168.0.4
00:07:43:06:8A:AC 192.168.0.5
00:07:43:06:88:38 192.168.0.6
[snip]

I thought I could copy the same /etc/ethers on all servers but it seems
that if the (MAC,IP) of the server itself is in the file then arp throws an
error:

SIOCSARP: Invalid argument
arp: cannot set entry on line 1 of etherfile /opt/sbin/ethers !

Then if I comment out the offending line things work fine.

e.g. on 192.168.0.1 I must remove line1 of /etc/ethers.

Is this behaviour to be expected? Or is there something else at work here?

--
Rahul
From: Pascal Hambourg on
Hello,

Rahul a �crit :
> I was trying to specify a static arp list for servers in a cluster by using
>
> arp -f /etc/ethers
>
> cat /etc/ethers
> 00:07:43:06:8A:AD 192.168.0.1
> 00:07:43:06:8A:AA 192.168.0.2
> 00:07:43:06:8A:B0 192.168.0.3
> 00:07:43:06:8A:AB 192.168.0.4
> 00:07:43:06:8A:AC 192.168.0.5
> 00:07:43:06:88:38 192.168.0.6
> [snip]
>
> I thought I could copy the same /etc/ethers on all servers but it seems
> that if the (MAC,IP) of the server itself is in the file then arp throws an
> error:
>
> SIOCSARP: Invalid argument
> arp: cannot set entry on line 1 of etherfile /opt/sbin/ethers !

/opt/sbin/ethers ?

> Then if I comment out the offending line things work fine.
>
> e.g. on 192.168.0.1 I must remove line1 of /etc/ethers.
>
> Is this behaviour to be expected? Or is there something else at work here?

man 8 arp says :
-i If, --device If
Select an interface. [...] When setting a
permanent or temp ARP entry this interface will be associated
with the entry; if this option is not used, the kernel will
guess based on the routing table.

Read the last part. The host's own address is routed on the loopback
interface lo, and trying to create an ARP entry on this interface leads
to the error. I guess you can avoid this by explicitly specifying the
interface in the arp command with the -i option.
From: habibielwa7id on
On Aug 7, 2:05 am, Rahul <nos...(a)nospam.invalid> wrote:
> I was trying to specify a static arp list for servers in a cluster by using
>
> arp -f /etc/ethers
>
> cat /etc/ethers
> 00:07:43:06:8A:AD       192.168.0.1
> 00:07:43:06:8A:AA       192.168.0.2
> 00:07:43:06:8A:B0       192.168.0.3
> 00:07:43:06:8A:AB       192.168.0.4
> 00:07:43:06:8A:AC       192.168.0.5
> 00:07:43:06:88:38       192.168.0.6
> [snip]
>
> I thought I could copy the same /etc/ethers on all servers but it seems
> that if the (MAC,IP) of the server itself is in the file then arp throws an
> error:
>
> SIOCSARP: Invalid argument
> arp: cannot set entry on line 1 of etherfile /opt/sbin/ethers !
>
> Then if I comment out the offending line things work fine.
>
> e.g. on 192.168.0.1 I must remove line1 of /etc/ethers.
>
> Is this behaviour to be expected? Or is there something else at work here?
>
> --
> Rahul

You just reversed the order, The ip addresses should be mentioned
first like,
192.168.0.1 00:07:43:06:8A:AD
From: Pascal Hambourg on
habibielwa7id a �crit :
> On Aug 7, 2:05 am, Rahul <nos...(a)nospam.invalid> wrote:
>>
>> arp -f /etc/ethers
>>
>> cat /etc/ethers
>> 00:07:43:06:8A:AD 192.168.0.1
>> 00:07:43:06:8A:AA 192.168.0.2
[...]
> You just reversed the order, The ip addresses should be mentioned
> first like,
> 192.168.0.1 00:07:43:06:8A:AD

man 8 arp says :

As a special case for compatibility the order of the hostname and the
hardware address can be exchanged.
From: habibielwa7id on
On Aug 8, 2:07 pm, Pascal Hambourg <boite-a-s...(a)plouf.fr.eu.org>
wrote:
> habibielwa7id a écrit :
>
> > On Aug 7, 2:05 am, Rahul <nos...(a)nospam.invalid> wrote:
>
> >> arp -f /etc/ethers
>
> >> cat /etc/ethers
> >> 00:07:43:06:8A:AD       192.168.0.1
> >> 00:07:43:06:8A:AA       192.168.0.2
> [...]
> > You just reversed the order, The ip addresses should be mentioned
> > first like,
> > 192.168.0.1  00:07:43:06:8A:AD
>
> man 8 arp says :
>
>   As a special case for compatibility the order of the hostname and the
>   hardware address can be exchanged.

-Try it and you will find it will not work but in the order I
mentioned, First the ip address then the mac address, This is what I
found but on RedHat systems.
A note for Rahul, The system will not add those static entries at
startup automatically, So add command arp -f on rc.local for example,
Also you should check after restarting the system if the static
entries are working properly or not by issuing command arp -n for
example, You will find an added M besides the static entries like,
172.21.0.3 ether 00:19:5b:71:10:3c
C eth0
172.21.0.55 ether 11:22:22:22:22:22
CM eth0
In this case the first entry is dynamically assigned and the second
entry is static.
-I use static ARP entries on not secure networks to add extra security
as it fights the man in the middle attacks that use ARP spoofing, And
it also blocks blocking using ARP poisoning that may be caused by
using dump applications like NetCut or some similar methods, The
author didn't ask about that but I talked my be some bodies can
benefit from that information any way specially if there networks are
not secure.
Regards,