F R E E W A R E B O O T P Server NLM for Novell Netware 3.11 and above Copyright 1993, by HellSoft Comments and bugs to "meloun@vision.felk.cvut.cs" New versions "nw311/bootpd:novell.felk.cvut.cs" Written at Czech Technical University, Prague, Czech Republic E U R O P E !!! WARNING !!! The top-level domain "cs" will be soon changed to "cz", due to splitting Czechoslovakia into Czech Republic and Slovakia. If "cs" doesn't work, please try "cz" instead. The change is expected about June 1993 and the "cs" domain should work in parallel at least till the end of the year. Introduction and Features This NLM allows BOOTP protocol handling on Novell Netware 3.11 server. It is written according to RFC951 and RFC1048 specification. Features: - Supports multiple interfaces on server - Static IP address assignments - Dynamic IP address assigments - Forward request capabilty - Almost automated creation of the file with hosts definition - Novell Netware 4.0 compatibility - Build-in debuging mode System requirements BOOTPD NLM requires Novell Netware Server v3.11 or higher and RESOLV.NLM. (RESOLV.NLM avaliable at "novell.felk.cvut.cs" in directory "nw311/resolv"). RESOLV.NLM does the name translation but if you have no name server you must run RESOLV.NLM anyway, with no parameters. What BOOTP server does? Host machine identifies itself in the Internet environment using BOOTP protocol. It receives IP address, subnet mask, default gateway addresses, domain name server addresses, etc. How BOOTP server works? Incoming requests are divided into three categories that are processed separately. - request that contains MAC address and MAC type filled in "disable list". - request that came through gateway (forwarded request). - request that came from the network connected directly to the interface. The "disable list" with global scope for the server is searched first. If MAC address and MAC type of the request is found in the "disable list" then request is not processed at all. The "disable list" allows to have more than one server on one network (wire). The "giaddr" item in request is checked next. It allowes to distinguish between forwarded and non-forwarded requests. Forwarded requests (i.e., request going through bootp gateway) are maintained by the "forward list" with global validity for the server. This list contains complete information that is returned to requesting host. How is the request coming from the directly connected network processed? If the request is received from the interface that was not properly configured for bootp (command board, see below) then it is discarded. Every configured interface stores two lists. The first is the list of staticaly configured hosts and second is list of dynamicaly configured hosts. The "static list" is checked first. If MAC address and MAC type is found in this list, the reply is generated and the process ended. The "static list" was moved from global scope to board scope from this version, this allows using static assignments on servers with more interfaces with short addresses (Arcnet). The "dynamic list" is checked next max. 3 times. Each item in the list contains a flag which determines if this item has MAC address and MAC type, and the time of last use. First, the "dynamic list" is searched for an item containing the same MAC address and MAC type as the request. If it is found then the reply is generated and the proccessing ended. Second, the "dynamic list" is searched for non-used item. If it is found, MAC address and MAC type is stored to it, the item is marked as used, reply is generated and proccessing ended. Third, the "dynamic list" is searched for the least recently used item. If the time interval of last using of this item is greater than TimeToLive, the item is reused. New MAC address and MAC type is stored to the item, reply is generated and proccessing ended. Otherwise, error message is written to console. Or, briefly: - The "disable list" is applied as input filter. - If request is forwarded, the "forward list" is processed. else if packed is received from unconfigured interface then proccessing ends the "static list" assigned to received interface is checked. the "dynamic list" is checked for the same MAC address and MAC type. the "dynamic list" is checked for non-used intem. the "dynamic list" is checked for least recently used item. the error is reported. Configuration: Configuration is very simple. The bootp response is generated according to a template. The template is defined as a sequence of template commands. The sequence defines the structure of the bootp response. There is one template per board and the template can have as many executive commands for different hosts as you like. The configuration for every board looks like this: - sequence of template commands - executive command for given hosts - optional (but almost always used) reset template - sequence of template commands - executive command for other hosts - optional (but almost always used) reset template . . . Loading of the BOOTPD server: load [path]BOOTPD use [file] use [file] Specifies configuration file name. Default: sys:system/bootpd.cfg load bootpd use sys:system/bootpd/config.cfg BOOTPD Command line parameters: BOOTPD show {[file]} bootpd show Show assigned dynamic IP addresses and state of BOOTP server. bootpd show [file] Save all dynamically assignments of IP addresses to file in the format used for hosts file. bootpd {error | warning | debug } Set the output verbose level. Configuration file All empty lines and characters right to the '#' are ignored. All IP addresses must be in numeric format. Command ForwardFile [file name] Determines name of the forward description file. This file contains configuration information for forwarded requests processing. ForwardFile sys:system/bootpfwd.cfg Command DisableFile [file name] Determines name of the disabled address file. Addresses in this file work as the input filter for request packets. DisableFile sys:system/disabled.cfg Command Board [IP Address] This command sets properties of the particular interface and enables processing of the BOOTP packet by this interface. Subcommands of the Board command Subcommand LiveTime [min] Determine "TimeToLive" of dynamic assignment addresses. If it is zero, the dynamic assignmets cannot be reused. TimeToLive 60 # Time to live is one hour Subcommand TimeOffset [offset] Determines "time offset" returned to host. Optional. !!! WARNING !!! Many bootp cilents cannot handle this option. Please, verify if all of your bootp clients work properly when time offset information is returned to host. This is a template subcommand. TimeOffset 60 or TimeOffset ? # Time offset is set to same value as on # file server Subcommand Gateway [IP address] Determines "default gateway" returned to host. Optional. Maximum 4 gateways may be specified. This is a template subcommand. Gateway 147.32.14.4 or Gateway ? # Default gateway is set to same address # as that used in "Board" command. Subcommand CookieServer [IP address] Determines "CookieServer" returned to host. Optional. Maximum 4 Cookie servers may be specified. This is a template subcommand. CookieServer 147.32.14.4 or CookieServer ? # Cookie server is set to same address # as that used in "Board" command. Subcommand LPRServer [IP address] Determines "LPRServer" returned to host. Optional. Maximum 4 LPR servers may be specified. This is a template subcommand. LPRServer 147.32.14.4 or LPRServer ? # LPR server is set to same address # as that used in "Board" command. Subcommand DNSServer [IP address] Determines "DNSServer" returned to host. Optional. Maximum 4 DNS servers may be specified. This is a template subcommand. DNSServer 147.32.14.4 or DNSServer ? # DNS servers is set to same addreses # as that used when resolv.nlm is loaded Subcommand DynamicMask [IP address mask] Subcommand DynamicName ["C" format string] They determine the name for dynamically assigned hosts. The name is created as follows: the IP address of the host is masked (ANDed) with DynMask. The result is used as the argument for a C-like sprintf function with a format string DynName. If the output of sprintf is exactly "?", the host name is resolved from the IP address by the name server. The generation is enabled, when DynamicName is defined. This is a template subcommand. In "C" conventions: sprintf(HostName, DynName, HostIPAddress & DynMask); DynamicMask 0.0.0.255 # Only the last octet DynamicName MyPC-%3.3d-Dyn # Generate Names "MyPC-001-Dyn" # "MyPC-012-Dyn" # "MyPC-128-Dyn" DynamicMask 0.0.0.255 # Only the last octet DynamicName MyPC-%d # Generate Names "MyPC-1" # "MyPC-12" # "MyPC-128" DynamicName ? # Host name is resolved # via resolv.nlm from name server # The name is resolved only when this # address is used for the first time. Subcommand BootFileName ["C" format string] It determines the name of boot file for dynamically assigned hosts. The name is created using same rules as in Dynamic Name, with one exception: the question mark is valid boot file name. This is a template subcommand. In "C" conventions: sprintf(BootFile, BootFileName, HostIPAddress & DynMask); DynamicMask 0.0.0.255 # Only the last octet BootFileNAme Boot-%d # Generate Names # "Boot-1" # "Boot-12" # "Boot-128" Subcommand ResetTemplate This subcommand resets the host template to the inital state - only subnet mask is set to the same value as on the configured board. This is a template subcommand Subcommand DynamicHosts [range] [IP address] This subcommand set dynamic assignment of IP addresses for given interface. The assignment begins with [IP address] address and generates [range] addresses. The dynamic assigment is generated by previously defined template. All next changes to the template have no effect to these assigments. This is an executive subcommand. Motivation: I don't like long numbers like Ethernet MAC addresses. So first I enable the dynamic assignment and after some time I save the created database by Show [file] command. Then I only add the host names and I have a hosts file for future use. Acknowledgement: Thanks to Phil Karn and his KA9Q for inspiration. DynamicHosts 126 147.32.15.128 # IP addresses from # 147.32.15.128 to # 147.32.15.254 will # be assigned # dynamically Subcommand StaticHosts [Hosts file name for this interface] This subcomand determines the file name used for static hosts definition for this interface. This is an executive subcommand. StaticHosts sys:system/int1hst.cfg Hosts File Determines static assignments IP address <-> MAC address for each board. See sample file HOSTS.CFG. Format: [Host Name] [MAC type] [MAC address] [IP Address] {[Boot file name]} Host Name - Host name, up to 40 characters. If host name is "?" the BOOTPD resolves host name via resolv.nlm from name server. MAC type and address - Ethernet MAC address has 6 bytes, format "01:23:45:67:89" Numbers in hex - Pronet MAC address has 1 byte, format "10" (decimal) or "0x10" (hex) - IEEE802 All networks via standard IEEE 802 (Token-ring,...) MAC address has 6 bytes, format "01:23:45:67:89" Numbers in hex - Arcnet MAC address has 1 byte, format "10" (decimal) or "0x10" (hex) IP address - IP address assigned to this host Boot file name - (optional) Name of boot file returned to host. Disable file Defines input filer for requests. Format: [MAC type] [MAC address] MAC type and address - Ethernet MAC address has 6 bytes, format "01:23:45:67:89" Numbers in hex - Pronet MAC address has 1 byte, format "10" (decimal) or "0x10" (hex) - IEEE802 All networks via standard IEEE 802 (Token-ring,...) MAC address has 6 bytes, format "01:23:45:67:89" Numbers in hex - Arcnet MAC address has 1 byte, format "10" (decimal) or "0x10" (hex) Forward file This file contains configuration information for forwarded requests processing. Template idea (same as in BOARD command) is used. Subcommand TimeOffset [offset] Determines "time offset" returned to host. Optional. !!! WARNING !!! Many bootp cilents cannot handle this option. Please, verify if all of your bootp clients work properly when time offset information is returned to host. This is a template subcommand. TimeOffset 60 Subcommand Gateway [IP address] Determines "default gateway" returned to host. Optional. Maximum 4 gateways may be specified. This is a template subcommand. Gateway 147.32.14.4 # as that used in "Board" command. Subcommand Subnet [IP mask] Determines "subnet mask" returned to host. Optional. Maximum 4 subnets may be specified. This is a template subcommand. Subnet 255.255.255.240 Subcommand CookieServer [IP address] Determines "CookieServer" returned to host. Optional. Maximum 4 Cookie servers may be specified. This is a template subcommand. CookieServer 147.32.14.4 Subcommand LPRServer [IP address] Determines "LPRServer" returned to host. Optional. Maximum 4 LPR servers may be specified. This is a template subcommand. LPRServer 147.32.14.4 Subcommand DNSServer [IP address] Determines "DNSServer" returned to host. Optional. Maximum 4 DNS servers may be specified. This is a template subcommand. DNSServer 147.32.14.4 Subcommand ResetTemplate This subcommand resets the host template to the inital state - all items are disabled. This is a template subcommand ResetTemplate Subcommand Host [Name] [MAC type] [MAC addr] [IP Addr] {[Boot filename]} This subcommand creates host record. The template, previously defined, is saved to this record and it is used to generate reply in next time. If the host name is "?", the name server is used for resolving the name from IP address. This is an executive subcommand. Host ? Ethernet 00:12:34:56:78:9A 147.32.14.4 bootfile P.S.: I'd appreciate any bug reports, but especially those from Pronet, IEEE802 and Arcnet users. This has been tested on Ethernet only. P.P.S.: If anybody finds this manual too short and unsatisfactory, I will be only pleased if he will write a better one. My English is not good enough and I'll appreciate any help.