From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 8 Jun 1998 17:51:06 +0100 From: forsyth@caldo.demon.co.uk forsyth@caldo.demon.co.uk Subject: [9fans] Plan 9 ipmask Topicbox-Message-UUID: 7a11f26a-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19980608165106.e7yGPKlwJ5FAXcJOSUWgoveYTbL-jWG541BBYoVPLl8@z> >>does Plan 9 support an ipmask like 255.255.255.128? >>for some reason it seems to ignore such an entry in >>/lib/ndb/local and use 255.255.0.0 instead. it gets >>the right ip and ipgw though, and they're all three on >>the same line. this is from memory, though i'll check later, but i believe it's quite likely you've got the ipmask= entry at the wrong point in the /lib/ndb file. the ipmask= entry itself is an attribute of the network address, not a particular node, so it appears in the network's entry in the /lib/ndb file. for example, if the ip network address is 144.32.0.0 and it has subnet mask 255.255.254.0, you might have an entry similar to: ipnet=york-campus-net ip=144.32.0.0 ipmask=255.255.254.0 ipgw=144.32.128.76 fs=bigger ntp=rugby given an address or (sub)network address for which the system needs the ipmask, it first builds the default mask for that class of IP address [A,B,C etc], applies that to the given address to get the network address, looks in ndb for a (network entry) with that ip=, finds the ipmask= entry there, if there is one, and can then apply the new mask to find the network entry for the subnet(s). for instance, i might declare: ipnet=nine-net ip=144.32.96.0 fs=p9fs auth=p9auth ipgw=144.32.96.64 note that there is a general method for expressing a network/subnet/node hierarchy for attributes (see the description of $attribute at the end of ndb(6)). in this example, given those two entries, bootp will tell machines in subnet 144.32.96.0 to use p9fs as file server by default, with 144.32.96.64 as IP gateway, but (in the absence of other subnet entries), machines in other subnets will be told to use 144.32.128.76 as gateway (and fs=bigger). in practice, each subnet must have an ipgw= gateway address on that subnet: the gateway is the gateway to other subnets. the ipgw= in the network's own entry will be the address of the gateway to other networks on the Internet.