Plan 9 from Bell Labs’s /usr/web/sources/contrib/geoff/ifup

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# ifup mtsfx etherno sysnm ndbfile svcdir - configure /net.$mtsfx
# e.g.,	ifup alt 1 $sysname external service.alt
#	ifup gig 2 $sysname-gig	local service
# TODO: allow sharing a protocol stack between interfaces
rfork e
mtsfx=$1	etherno=$2	sysnm=$3	ndbfile=$4	svcdir=$5
mtpt=/net.^$mtsfx
ndbf=/lib/ndb/^$ndbfile

echo -n $mtpt...
bind -b '#l'^$etherno $mtpt
bind -b '#I'^$etherno $mtpt
ipgw=dummy			# in case ndb doesn't list one
eval `{ndb/ipquery -f $ndbf sys $sysnm ip ipgw ipmask}
ip/ipconfig -x .$mtsfx -g $ipgw ether $mtpt/ether$etherno $ip $ipmask
ndb/cs   -x $mtpt -f $ndbf
ndb/dns -sx $mtpt -f $ndbf
aux/listen -t /bin/service.auth -d /bin/^$svcdir $mtpt^/il
aux/listen -t /bin/service.auth -d /bin/^$svcdir $mtpt^/tcp
# ip/dhcpd -x $mtpt -f $ndbf
# ip/rip -x $mtpt

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.