Well Nobody came with a better idea than i had so here's my solution.
thanks to those who replied and if you have any comments please do ....
the question was : how can i create static rotes on multiple hosts from a
central place ?
answer: use nis map file
1.create the map file in the nis directory (/var/yp/etc ? )
2.modify the makefile to compile and push the new map
3.modify the nicnames map in /var/yp
4.add a rc script to each station
Details
--------
1.create nis map file called static-route
it should have to entries per line seperated by tab
#network gateway
192.168.0.0 192.168.0.1
2.add the folowing lines to the makefile in /var/yp ( make baclup first !!!)
static-route:static-route.time
static-route.time: $(DIR)/static-route
@(awk 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$1, $$0 }'
$(DIR)/static-route)| \
$(MAKEDBM) - $(YPDBDIR)/$(DOM)/static-route.byname;
@touch static-route.time;
@echo "updated static-route";
@if [ ! $(NOPUSH) ];then $(YPPUSH) -d $(DOM) static-route.byname ;fi
@if [ ! $(NOPUSH) ];then echo "pushed static-routes" ;fi
3.change the nickname map on nis server
edit /var/yp/nicknames and add the following line
static-route static-route.byname
4.add a script to each station so that it will add the static routes on
startup
/etc/rc3.d/S30static-routes
#! /bin/sh
######################################################
#add static routes to host using nis distributed file
######################################################
echo "Adding Static Routes "
for net in `ypcat static-route.byname |awk '{print $1}` ;do
gw=`ypcat static-route.byname |grep -w $net |awk '{print $2}`
route add net $net $gw
echo "Network $net and Gatewat $gw were added"
done
Regards ,
Moti Levy
Unix Admin
mlevy@lannet.com
03-6457551
054-929319
S
U BEFORE POSTING please READ the FAQ located at
N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
. and the list POLICY statement located at
M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
A To submit questions/summaries to this list send your email message to:
N sun-managers@sunmanagers.ececs.uc.edu
A To unsubscribe from this list please send an email message to:
G majordomo@sunmanagers.ececs.uc.edu
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:
I http://www.latech.edu/sunman.html
S
T
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:23 CDT