Kostis Netzwerkberatung
Konstantinos Kostis
Talstr. 25, D-63322 Rödermark
Tel. +49 6074 881056, FAX 881058
kosta@kostis.net, http://www.kostis.net/

You may use this software free of charge at your own risk

netdb 3.0.6 (2001-01-29)


/etc/netdb/frm/

Format files

File   Function
cisco-example.frm   example Cisco router configuration
csv-dos.frm   CSV export format with MS-DOS EOLN ('\r', '\n')
csv-tab.frm   TAB separated export format
csv.frm   CSV export format with Unix EOLN ('\n')
dhcpd.frm   dhcpd.conf line (template for one entry)
hosts.frm   hosts file line (template for one entry)
unique.frm   format to detect address collisions
vsatping.frm   format for a special application
     
Directory   Content
find/   format files supporting searches
named/   format files for creating DNS zone files
properties/   format files for getting values of properties

/etc/netdb/frm/csv-dos.frm

Not currently used by any netdb script. May be of use anyway.

See csv.frm - only difference is it has MS-DOS eoln (CR and LF).

/etc/netdb/frm/csv-tab.frm

Not currently used by any netdb script. May be of use anyway.

See csv.frm - differences are

/etc/netdb/frm/csv.frm

Used by

The follwing text is stored as a single line even though it may be line wrapped on your display/printout:

"%hostname%","%domain%","%ipaddr%","%ipmask%","%mac%","%comment%","%isdnarea%","%isdnnum%","%x25%","%ipxaddr%","%ipxlan%","%decnet%","%location%","%hubport%","%user%","%cnames%"

/etc/netdb/frm/dhcpd.frm

Used by

Needs leading empty line.


host
%hostname%
{
        hardware ethernet
%colonmac% ;
        fixed-address
%hostname%.%domainroot% ;
}

/etc/netdb/frm/hosts.frm

Used by

%ipaddr% %hostname%.%domainroot% %hostname% # %location%

/etc/netdb/frm/unique.frm

Used by

%hostname%,%ipaddr%,%ipxlan%%ipxaddr%,%decnet%,%x25%

/etc/netdb/frm/vsatping.frm

Used by

<tr><td>%location%</td><td><a href="/cgi-bin/vsat/vsatping.cgi?%hostname%_%ipaddr%">%hostname%</a></td><td>%ipaddr%</td></tr>

/etc/netdb/frm/find/

Format files used for searching/finding

Used by

File   Content
findhn.frm   Find netdb entries sorted by hostname
findhs.frm   Find netdb entries in hosts format sorted by hostname
findip.frm   Find netdb entries sorted by ipaddr

/etc/netdb/frm/find/findhn.frm

The follwing text is stored as a single line even though it most likely is line wrapped on your display/printout:

<tr><td>%hostname%%domain%.%domainroot%</td><td>%ipaddr%&nbsp;</td><td>%mac%&nbsp;</td><td>%hubport%&nbsp;</td><td>%location%&nbsp;</td><td>%user%&nbsp;</td></tr>

/etc/netdb/frm/find/findhs.frm

The follwing text is stored as a single line even though it may be line wrapped on your display/printout:

%ipaddr% %hostname%.%domainroot% %hostname% # %location%/%user%

/etc/netdb/frm/find/findip.frm

The follwing text is stored a single line even though it most likely is line wrapped on your display/printout:

%ipaddr%&nbsp;</td><td>%hostname%%domain%.%domainroot%&nbsp;</td><td>%mac%&nbsp;</td><td>%hubport%&nbsp;</td><td>%location%&nbsp;</td><td>%user%&nbsp;</td></tr>

Note that this format file does not include leading <tr><td> HTML tags allowing proper sorting. Those tags are added by the script using this format file after sorting.

/etc/netdb/frm/named/

DNS/bind format files

Used by /etc/netdb/bin/netdb.mknamed*

File   Content
add-cname.frm   input for nspdate adding RR cname
add.frm   input for nspdate adding RR A and PTR
cnameslist.frm   %hostname% %cnames%
del-cname.frm   input for nspdate deleting RR cname
del.frm   input for nspdate deleting RR A and PTR
named-h.frm   RR A in DNS zone file format
named-r1.frm   RR PTR in DNS zone file format (fixed /24)
named-r2.frm   RR PTR in DNS zone file format (fixed /16)
named-r3.frm   RR PTR in DNS zone file format (fixed /8)

/etc/netdb/frm/named/add-cname.frm

Used by

update add %cname%.%domainroot% 86400 CNAME %hostname%.%domainroot%.

You may want to change the TTL value marked green.

/etc/netdb/frm/named/add.frm

Used by

update add %hostname%.%domainroot% 86400 A %ipaddr%

update add
%iphostrev4%.in-addr.arpa 86400 PTR %hostname%.%domainroot%.

You may want to change the TTL value marked green.

/etc/netdb/frm/named/cnameslist.frm

Used by

%hostname% %cnames%

/etc/netdb/frm/named/del-cname.frm

Used by

update delete %cname%.%domainroot% CNAME

/etc/netdb/frm/named/del.frm

Used by

update delete %hostname%.%domainroot% A

update delete
%iphostrev4%.in-addr.arpa PTR

/etc/netdb/frm/named/named-h.frm

Used by

%hostname%              IN      A       %ipaddr%

/etc/netdb/frm/named/named-r1.frm

Used by

%iphostrev1%            IN      PTR     %hostname%.%ROOTDOMAIN%.

/etc/netdb/frm/named/named-r2.frm

Used by

%iphostrev2%            IN      PTR     %hostname%.%ROOTDOMAIN%.

/etc/netdb/frm/named/named-r3.frm

Used by

%iphostrev3%            IN      PTR     %hostname%.%ROOTDOMAIN%.

/etc/netdb/frm/properties/

Contains format files for all netdb properties and functions. Filenames are identical to properties and functions with extension ".frm".

Content of each file is the property or function it represents.

Used by

Example

content of /etc/netdb/frm/properties/hostname.frm

%hostname%

/etc/netdb/frm/cisco-example.frm

This is an example Cisco router configuration for a serial line router such as a Cisco 1601 connecting a remote LAN to a central router via serial interface and a leased line.

It is really just an example of what you can do with netdb. You can use this template and generate a complete and always identical configuration for all your leaf LAN routers to be stored on you tftp server. You can also change the order of those commands and feed the result to HyperTerminal connected to your Cisco console.


!
version 12.1
service timestamps debug uptime
service timestamps log uptime
service password-encryption
service udp-small-servers
service tcp-small-servers
!
hostname
%hostname%
!
logging buffered 8192 debugging
no logging console
enable secret
secret-password
!
memory-size iomem 25
clock timezone GMT 1
clock summer-time GMTDST recurring last Sun Mar 2:00 last Sun Oct 3:00
ip subnet-zero
no ip source-route
no ip domain-lookup
!
!
!
!
interface Serial0
 ip unnumbered Ethernet0
 no ip directed-broadcast
 no ip proxy-arp
 no ip route-cache
 no cdp enable
!
interface Ethernet0
 description
%location% (%user%)
 ip address
%ipaddr% %ipmask%
 no ip directed-broadcast
 no ip proxy-arp
 no ip route-cache
 no cdp enable
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0
ip route 10.0.0.0 255.0.0.0 Serial0
ip route 172.16.0.0 255.240.0.0 Serial0
ip route 192.168.0.0 255.255.0.0 Serial0
ip route
%ipnetaddr% %ipmask% Ethernet0
!
no cdp run
!
line con 0
 transport input none
 password
console-password
line aux 0
line vty 0 4
 password
telnet-password
 login
!
end

passwords are marked red must not be in the clear. Set passwords on a router, do a show running-config and copy and paste encrypted passwords (including 7) and encrypted secrets (including 5) to your configuration. For the sake of simpilicity this example features no DNS, SNMP and NTP configuration. Also not touched is whether you want to enable the Cisco http interface or not. Last but not least since this is a leaf node configuration no routing protocol is enabled. Everything other than the LAN subnet is simply routed through the serial interface, including all RFC-1918 addresses.

How do you use this with netdb? Login as user netdb and do the following:

. /etc/netdb/setvars
cat $DOMAINS.* | netdbget
hostname | netdb $NETDB/frm/cisco-example.frm >/tftpboot/hostname

Replace hostname marked green with the hostname of your router.