Subject: Re: rc.d script for adding static ARP entries
To: Nino Dehne <ndehne@gmail.com>
From: Geert Hendrickx <geert.hendrickx@ua.ac.be>
List: tech-security
Date: 06/28/2005 10:23:18
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Jun 28, 2005 at 09:52:17AM +0200, Geert Hendrickx wrote:
> On Tue, Jun 28, 2005 at 01:25:26AM +0200, Nino Dehne wrote:
> > Geert Hendrickx wrote:
> > >The format of this file is very easy: 
> > >
> > >	hostname ether_addr
> > >
> > >e.g.:
> > >
> > >	192.16.1.20 00:12:bf:02:b4:ff
> > 
> > I think ethers(5) is not meant to be fed into arp -f. arp -f expects
> > hostname ether_addr but ethers(5) is ether_addr hostname.
> 
> Ah, you're right.  I didn't know /etc/ethers had a meaning already on
> NetBSD.  arp -f can take any file, I just choose /etc/ethers because it's
> the default on Linux.  It can be any other file.  

I think we better use a separate file then, say /etc/arptable.  Here's an
updated script.  

GH

-- 
:wq

--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=arptable

#!/bin/sh
#
# $NetBSD$
#

# PROVIDE: arptable
# BEFORE:  NETWORKING

. /etc/rc.subr

name="arptable"
rcvar="arptable"
command="/usr/sbin/arp"
conf_file="/etc/arptable"
required_files="${conf_file}"
command_args="-f ${conf_file}"
stop_cmd=":"

load_rc_config $name
run_rc_command "$1"

--17pEHd4RhPHOinZp--