* NET-3 Networking Distribution for the LINUX operating
* system.
*
- * Version: $Id: arp.c,v 1.15 1999/11/21 00:40:27 ecki Exp $
+ * Version: $Id: arp.c,v 1.16 1999/12/06 16:57:27 freitag Exp $
*
* Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
*
linenr, name);
continue;
}
+ if (strchr (args[0], ':') != NULL) {
+ /* We have a correct ethers file, switch hw adress and hostname
+ for arp */
+ char *cp;
+ cp = args[1];
+ args[1] = args[0];
+ args[0] = cp;
+ }
if (arp_set(args) != 0)
fprintf(stderr, _("arp: cannot set entry on line %u of etherfile %s !\n"),
linenr, name);
{
fprintf(stderr, _("Usage:\n arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP cache\n"));
fprintf(stderr, _(" arp [-v] [-i <if>] -d <hostname> [pub][nopub] <-Delete ARP entry\n"));
- fprintf(stderr, _(" arp [-vnD] [<HW>] [-i <if>] -f <filename> <-Add entry from file\n"));
+ fprintf(stderr, _(" arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from file\n"));
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [temp][nopub] <-Add entry\n"));
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -s <hostname> <hwaddr> [netmask <nm>] pub <-''-\n"));
fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <hostname> <if> [netmask <nm>] pub <-''-\n\n"));
fprintf(stderr, _(" -i, --device specify network interface (e.g. eth0)\n"));
fprintf(stderr, _(" -D, --use-device read <hwaddr> from given device\n"));
fprintf(stderr, _(" -A, -p, --protocol specify protocol family\n"));
- fprintf(stderr, _(" -f, --file read new entries from file\n\n"));
+ fprintf(stderr, _(" -f, --file read new entries from file or from /etc/ethers\n\n"));
fprintf(stderr, _(" <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\n"), DFLT_HW);
fprintf(stderr, _(" List of possible hardware types (which support ARP):\n"));
break;
case 2: /* process an EtherFile */
- what = arp_file(argv[optind]);
+ what = arp_file(argv[optind] ? argv[optind] : "/etc/ethers");
break;
case 3: /* delete an ARP entry from the cache */
.RB [ \-vnD ]
.RB [ "\-H Typ" ]
.RB [ "-i Schnittstelle" ]
-.B -f Dateiname
+.B -f [Dateiname]
.SH BESCHREIBUNG
.B Arp
.br
.B ANMERKUNG:
Ab der Kernelversion 2.2.0 ist es nicht mehr m\(:oglich ARP-Eintr\(:age f\(:ur
-ganze Teilnetze zu erzeugen.
+ganze Teilnetze zu erzeugen. Statt dessen wird automatisches Proxy ARP
+durchgef\(:uhrt, d.h. wenn eine Route existiert und Forwarding eingeschaltet
+ist wird automatisch ein tempor\(:arer Proxyarpeintrag erzeugt.
+Siehe auch
+.BR arp (7)
+f\(:ur mehr Details.
.TP
.B "\-f Dateiname, \-\-file Dateiname"
\(:Ahnlich der
verwendet wird. Dies kann verwendet werden, wenn ARP-Eintr\(:age f\(:ur
etliche Rechner erzeugt werden m\(:ussen. Der Name dieser Datei ist oft
.IR /etc/ethers ,
-aber dies ist nicht offiziel standardisiert.
+aber dies ist nicht offizieil standardisiert. Wenn kein Dateinamen
+angeben ist wird /etc/ethers benutzt.
.sp 1
Das Format der Datei ist einfach; es enth\(:alt nur ASCII-Textzeilen, die
aus einem Rechnernamen und einer Hardwareadresse getrennt von einem
erwartet wird, kann auch eine
.B "IP-Adresse"
in Form eines durch Punkte getrennten Dezimalquadrupels angegeben werden.
+.P
+Aus Kompatiblit\(:atsgr\(:unden k\(:onnen Rechnername und die
+Hardwareadresse auch vertauscht werden.
.LP
Jeder vollst\(:andige Eintrag wird im ARP-Cache mit der
.B C
.RB [ \-vnD ]
.RB [ "\-H type" ]
.RB [ "-i if" ]
-.B -f filename
+.B -f [filename]
.SH DESCRIPTION
.B Arp
.br
.B NOTE:
As of kernel 2.2.0 it is no longer possible to set an ARP entry for an
-entire subnet.
+entire subnet. Linux instead does automagic proxy arp when a route
+exists and it is forwarding. See
+.BR arp (7)
+for details.
.TP
.B "\-f filename, \-\-file filename"
Similar to the
. This can be used if ARP entries for a lot of hosts have to be
set up. The name of the data file is very often
.IR /etc/ethers ,
-but this is not official.
+but this is not official. If no filename is specified /etc/ethers
+is used as default.
.sp 1
The format of the file is simple; it
only contains ASCII text lines with a hostname, and a hardware
is expected, one can also enter an
.B "IP address"
in dotted-decimal notation.
+.P
+As a special case for compatibility the order of the hostname and
+the hardware address can be exchanged.
.LP
Each complete entry in the ARP cache will be marked with the
.B C