Subject: arp table funzies
To: None <tech-net@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 05/14/2002 02:43:32
I've just been hacking around with arp tables, and have found that it
seems to me I needed to add new options to arp(8).

This note is to (a) ask if there's any better way to do this and (b) if
not, offer to feed the changes to arp back to NetBSD.

The major problem I see with arp(8) is that there is no way to specify
what interface an arp entry is to be created on.  For "normal" arp
entries, there is usually only one interface that makes sense, but for
published (proxy) entries, this is not the case - and even for "normal"
arp entries, I've found uses for arp entries pointing out a "wrong"
interface.

Thus, I added a keyword "if" for use with -s, so that you can do stuff
like

arp -s 10.1.2.3 0:1:2:3:4:5 if de2

to install an arp entry for that IP and MAC address, pointing out de2.

When using this to create proxy entries, you also have to be able to
tell arp that it's supposed to be a proxy entry, because specifying an
interface bypasses the normal logic for determining whether the entry
is to be a proxy entry.  (This logic looks slightly broken already, in
that it looks as though it works only when there is an existing route
for the target host that points out a non-ARP-capable interface.
Unless I misread it, I guess nobody has had occasion to do proxy ARP
entries except for hosts actually routed over interfaces - like PPP -
that don't do arp.)

Thus, I've also added a keyword "proxy" which makes the entry a proxy
entry.  You'll normally need this only if you're also specifying "if",
but if you want to proxy-arp for an IP that's routed out another
ARP-capable interface, I suspect you'd need it.

If anyone's interested in what I did to arp, it's all in
ftp.netbsd.org:/pub/NetBSD/misc/mouse/patch-tree/src/usr.sbin/arp/ for
your downloading pleasure.  If anyone has any better way to suggest,
I'm all ears.  If desired, I'll be happy to send-pr a change-request.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B