Subject: Re: adding static routes
To: Henry Nelson <henry@irm.nara.kindai.ac.jp>
From: Steven M. Bellovin <smb@research.att.com>
List: netbsd-users
Date: 03/06/2001 19:20:55
In message <200103070011.JAA22896@ibr1.irm.nara.kindai.ac.jp>, Henry Nelson wri
tes:
>> What's the approved location for adding static routes to startup for
>> NetBSD-1.5?
>> 
>> It should happen before ntpd in one case I'm using - is it acceptable
>> ok to add site-local executables to /etc/rc.d?
>
>Sorry for jumping on the band wagon, but in /etc/rc I put:
>     if [ -f /etc/addstaticroutes ]; then
>           /etc/addstaticroutes
>     fi
>and /etc/addstaticroutes looks like:
>     route add -net 163.51.xxx.0 -netmask 255.255.255.0 163.51.yyy.aaa
>     route add -net 163.51.xxz.0 -netmask 255.255.255.0 163.51.yyy.aaa
>
>While it works like a charm, I get the following error message if I look
>at dmesg.  Why do I get this error, and how can I stop it?
>     /etc/rc: /etc/addstaticroutes: permission denied

Either add the line

	#!/bin/sh

at the start of the file or run it as

	sh /etc/addstaticroutes


		--Steve Bellovin, http://www.research.att.com/~smb