Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
5.  TCP/IP (Reference) TCP/IP Configuration Files netmasks Database Creating the Network Mask for IPv4 Addresses  Previous   Contents   Next 
   
 

/etc/inet/netmasks File

If your network runs NIS, NIS+, or LDAP, the servers for these name services maintain netmasks databases. For networks that use local files for name service, this information is maintained in the /etc/inet/netmasks file.


Note -

For compatibility with BSD-based operating systems, the file /etc/netmasks is a symbolic link to /etc/inet/netmasks.


The following example shows the /etc/inet/netmasks file for a class B network.


Example 5-3 /etc/inet/netmasks File for a Class B Network

 ## The netmasks file associates Internet Protocol (IPv4) address
 # masks with IPv4 network numbers.
 #
 # 	network-number	netmask
 #
 # Both the network-number and the netmasks are specified in
 # "decimal dot" notation, e.g:
 #
 #        128.32.0.0   255.255.255.0
 129.144.0.0  255.255.255.0

If the file does not exist, create it. Use the following syntax:

network-number	netmask-number

Refer to the netmasks(4) man page for complete details.

When creating netmask numbers, type the network number that is assigned by the InterNIC (not the subnet number) and netmask number in /etc/inet/netmasks. Each subnet mask should be on a separate line.

For example:
128.78.0.0	    255.255.248.0

You can also type symbolic names for network numbers in the /etc/inet/hosts file. You can then use these network names instead of the network numbers as parameters to commands.

Network Databases and nsswitch.conf File

The network databases are files that provide information that is needed to configure the network. The network databases follow:

  • hosts

  • ipnodes

  • netmasks

  • ethers

  • bootparams

  • protocols

  • services

  • networks

As part of the configuration process, you edit the hosts database and the netmasks database, if your network is subnetted. Two network databases, bootparams and ethers, are used to configure machines as network clients. The remaining databases are used by the operating system and seldom require editing.

Although nsswitch.conf file is not a network database, you need to configure this file along with the relevant network databases. nsswitch.conf specifies which name service to use for a particular machine: local files, NIS, NIS+, DNS, or LDAP.

How Name Services Affect Network Databases

The form of your network database depends on the type of name service you select for your network. For example, the hosts database contains, at minimum, the host name and IPv4 address of the local machine and any network interfaces that are directly connected to the local machine. However, the hosts database could contain other IPv4 addresses and host names, depending on the type of name service on your network.

The network databases are used as follows:

  • Networks that use local files for their name service rely on files in the /etc/inet and /etc directories.

  • NIS+ uses databases that are called NIS+ tables.

  • NIS uses databases that are called NIS maps.

  • DNS uses records with host information.


Note - DNS boot and data files do not correspond directly to the network databases.


The following figure shows the forms of the hosts database that is used by these name services.

Figure 5-2 Forms of the hosts Database Used by Name Services

The following table lists the network databases and how they are used by local files, NIS+, and NIS.

Table 5-1 Network Databases and Corresponding Name Service Files

Network Database

Local Files

NIS+ Tables

NIS Maps

hosts

/etc/inet/hosts

hosts.org_dir

hosts.byaddr hosts.byname

ipnodes

/etc/inet/ipnodes

ipnodes.org_dir

ipnodes.byaddr ipnodes.byname

netmasks

/etc/inet/netmasks

netmasks.org_dir

netmasks.byaddr

ethers

/etc/ethers

ethers.org_dir

ethers.byname ethers.byaddr

bootparams

/etc/bootparams

bootparams.org_dir

bootparams

protocols

/etc/inet/protocols

protocols.org_dir

protocols.byname protocols.bynumber

services

/etc/inet/services

services.org_dir

services.byname

networks

/etc/inet/networks

networks.org_dir

networks.byaddr networks.byname

This book discusses network databases as viewed by networks that use local files for name services. Information about the hosts database is in "hosts Database". Information about the ipnodes database is in "/etc/inet/ipnodes File". Information about the netmasks database is in "netmasks Database". Refer to System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) and System Administration Guide: Naming and Directory Services (FNS and NIS+) for information on network databases correspondences in NIS, NIS+, DNS, and LDAP.

nsswitch.conf File -- Specifying Which Name Service to Use

The /etc/nsswitch.conf file defines the search order of the network databases. The Solaris installation program creates a default /etc/nsswitch.conf file for the local machine, based on the name service you indicate during the installation process. If you selected the "None" option, indicating local files for name service, the resulting nsswitch.conf file resembles the following example.


Example 5-4 nsswitch.conf for Networks Using Files for Name Service

# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf;
# it does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file contains "switch.so" as a
# nametoaddr library for "inet" transports.

passwd:          files
group:           files
hosts:           files
networks:        files
protocols:       files
rpc:             files
ethers:          files
netmasks:        files
bootparams:      files
publickey:       files
# At present there isn't a 'files' backend for netgroup; the
# system will figure it out pretty quickly,
# and won't use netgroups at all.
netgroup:        files
automount:       files
aliases:         files
services:        files
sendmailvars:    files

 
 
 
  Previous   Contents   Next