SunService Tip Sheet for Networking Setup & Modification
Network Setup & Modification Tip Sheet
Revision 1.0
Date: October 30, 1995
1.0: About This Tip Sheet
2.0: Common How Tos for Setting Up a Machine on a Network
2.1: How to Tell the Network About Your New Machine
2.2: How to Configure Your Ethernet Interface
2.3: How to Set Up Routing
2.4: How to Set Up Mail
2.5: How to Set Up a NIS Client
2.6: How to Set Up a NIS+ Client
2.7: How to Set Up a DNS Client
2.8: How to Set Up a netmask
3.0: Common How Tos for Modifying a Machine on a Network
3.1: How to Change the Name of a Machine
3.2: How to Move a Machine
4.0: Patches
4.1: SunOS Patches
4.2: Solaris Patches
5.0: References
5.1: Sun Educational Services
5.2: Solaris Documentation
5.3: Third Party Documentation
6.0: Supportability
7.0: Additional Support
1.0: About This Tip Sheet
=========================
This Tip Sheet is intended as a guide to the most common problems
experienced when putting a machine on to the network, or when
modifying a machine on the network. This document assumes that you
have an already extant network, and are simply trying to connect your
new machine in to it. It does not explain how to totally set up a
network from scratch, nor does it explain how to set up servers for
the various services described. Those subjects are far beyond the
scope of this document. Seperate Tip Sheets do exist for NIS,
sendmail, NIS+ and the many other services described in this document,
and those documents do explain how to set up servers for these
services, and also provide debugging information on these services.
They may be consulted if this additional information is needed.
It should be noted that SunService does not do basic network
configuration. This document is provided to help you do basic
configuration on your own. If it is not sufficient, Sections 6.0 and
7.0 explain where else you can get help from within Sun.
2.0: Common How Tos for Setting Up a Machine on a Network
=========================================================
Each How To in this section is divided into three parts:
* an explanation of why you would need to implement the How To
* an explanation of how to implement the How To under SunOS
* an explanation of how to implement the How To under Solaris
Examples in this Section use a number of totally fictious machines and
IP addresses, as follows:
150.101.16.1 router
150.101.16.11 nis-master
150.101.16.12 nisplus-master
150.101.16.13 dns-server
150.101.16.14 the-mail-machine
150.101.16.21 new-machine
The domain for these fictious machines is example.com.
Simply replace these fictious machines and IP addresses with your own
machine names and IP addresses. Also note that in many cases, the
above functionality (nis, nis+, dns, mail) will actually be combined
on a smaller number of machines. Splitting the above functionality
between a large number of machines is simply done to make this example
simpler.
2.1: How to Tell the Network About Your New Machine
---------------------------------------------------
If you are using any type of naming service (NIS, NIS+, DNS), you must
enter information on your new machine into all appropriate services.
This should be done before setting up the machine itself.
Changing NIS and DNS is identical on SUNOS and SOLARIS. The
information on changing NIS+ is only applicable to Solaris.
To tell NIS about your machine, go to your nis-master, and add the new
machine to the /etc/hosts file (or your NIS specific hosts file, if it
is located in a different place):
nis-master% cat /etc/hosts
...
150.101.16.21 new-machine
Afterwards, make the NIS maps:
nis-master# cd /var/yp
nis-master# make
To tell NIS+ about your machine, use admintool's Database Manager to
add information on your new machine to the hosts map. Afterwards,
login to the nisplus-master and ping the NIS+ maps, to make sure the
information is immediately available:
nisplus-master# nisping -a
To tell DNS about your machine, go to your master dns-server. You will
need to modify both your forward and reverse lookup maps. The file
/etc/named.boot lists where all of your maps are:
dns-server% cat /etc/named.boot
cache . named.root
primary 0.0.127.in-addr.arpa named.local
primary example.com named.hosts
primary 16.101.200.in-addr.arpa named.rev
[.ie "p"primary" line which lists your domain name is your forward
lookup map (named.hosts in this example). The "primary" line which
reverses part of your IP address, and appends in.addr.arpa is your
reverse lookup map (named.rev in this example).]
First, add an A record to your forward map, which correlates name to
IP address:
new-machine.example.com. IN A 150.101.16.21
Also increment the Serial Number, locatenear the top of your forward
map file:
2 ; serial number
Second, add a PTR record to your reverse map, which correlates IP
address to name:
21 IN PTR new-machine.example.com.
Also increment the Serial Number, located near the top of your reverse
map file:
2 ; serial number
Finally, restart in.named, to propagate your changes:
dns-server# kill -HUP `cat /etc/named.pid`
2.2: How to Configure Your Ethernet Interface
---------------------------------------------
You will need to configure your interface only if you have installed
your machine in some non-standard way. Usually, autoinstall will
automatically set everything up correctly. If the file
/etc/hostname.le0 already exists, you need to do nothing further here.
If it does not exist, and you are running a standard lance ether
interface, you should do the following.
On a SUNOS machine, create the file /etc/hostname.le0. Its sole
contents should be the name of the machine:
new-machine% cat /etc/hostname.le0
new-machine
Afterwards, edit your /etc/hosts file, and add an entry listing your
machine and your IP address. The machine's name should appear exactly
as it appears in the /etc/hostname.le0 file:
new-machine% cat /etc/hosts
...
150.101.16.21 new-machine
When these files have been created, reboot the machine, and the
interface will come up correctly.
On SOLARIS machines, the above procedure should be followed. In
addition, you should make sure there is an /etc/nodename file, which
contains the name of your machine:
new-machine% cat /etc/nodename
new-machine
[Caveat: the above notes talk about an /etc/hostname.le0 file. In
actuality, Sun machines look for files of the format hostname.*, where
the * can be any interface name, followed by a number. For example, a
machine with one Token Ring interface should have a file hostname.tr0,
while machine with two Lance Ether interfaces should have a
hostname.le0 and a hostname.le1. In general: a hostname file must
exist for an interface in order for it to be brought up at boot time.]
2.3: How to Set Up Routing
--------------------------
You will need to modify routing on your machine if you find that you
can not ping any machines, except the ones on your local network. This
usually means that you are using dynamic routing, but dynamic routes
are not available on your network. This may be resolved by
implementing static routing on your machine, as is explained below.
On a SUNOS machine, create the file /etc/defaultrouter. Its sole
contents should be the name of the default router for your
new-machine. This router must be on the exact same subnet as your
machine:
new-machine% cat /etc/defaultrouter
router
Afterwards, edit your /etc/hosts file, and add an entry listing your
router and its IP address. The router's name should appear exactly
as it appears in the /etc/defaultrouter file:
new-machine% cat /etc/hosts
...
150.101.16.1 router
SOLARIS machines are set up identical to SunOS machines.
There is a separate tip sheet for more technical routing questions.
2.4: How to Set Up Mail
-----------------------
You will need to set up mail on your machine if all non-local mail is
failing wi " "host unknown" messages.
On a SUNOS machine, create an entry in your /etc/hosts file which
lists the IP address of your mailhost:
new-machine% cat /etc/hosts
...
150.101.16.14 mailhost
If mailhost is not the real name for your mailhost, you may want your
hosts entry to reflect both names:
new-machine% cat /etc/hosts
...
150.101.16.14 the-mail-machine mailhost
The only requirement is that mailhost must be one of the names.
If you already have an entry for mailhost in NIS, NIS+ or DNS, simply
setting up that service (see Section 2.5, 2.6 or 2.7) should be
sufficient to get mail working.
SOLARIS machines are set up identical to SunOS machines.
2.5: How to Set Up a NIS Client
-------------------------------
You will need to set your machine up as a NIS client if your machine's
subnet has a NIS server, and you want to connect your new-machine to
that service.
You must know what your domainname is, before you can set up NIS. You
can learn this by logging on to your NIS server, and running
domainname:
nis-master% domainname
example-domain
On a SUNOS machine, you must first set your domainname:
new-machine# domainname example-domain
new-machine# domainname > /etc/defaultdomain
Then, you can start your ypbind daemon:
new-machine# ypbind
This will fail if nis-master is not on the same subnet as new-machine.
A seperate NIS Tip Sheet includes information on more complex setups,
such as this one.
On a SOLARIS machine, you must first set your domainname:
new-machine# domainname example-domain
new-machine# domainname > /etc/defaultdomain
Then, you must copy in the appropriate nsswitch.conf file:
new-machine# cp /etc/nsswitch.nis /etc/nsswitch.conf
Then, you can run ypinit:
new-machine# ypinit -c
After answering the questions about your nis-master's IP address, you
should reboot the machine.
2.6: How to Set Up a NIS+ Client
--------------------------------
You will need to set your machine up as a NIS+ client if you have a
NIS+ server, and you want to connect your new-machine to that service.
You must know what your domainname is, before you can set up NIS+. You
can learn this by logging on to your NIS+ server, and running
domainname:
nisplus-master% domainname
example.com
SUNOS machines can not be NIS+ clients.
To set up a SOLARIS machine as a NIS+ client, you must first log on to
nisplus-master, and create credentials for your new-machine:
nisplus-master# nisclient -c new-machine
Afterwards, you can run nisclient on the client machine:
new-machine# nisclient -i -d example.com. -h nisplus-master
[the argument after the -d flag is the domainname returned above, with
a dot appended.]
When nisclient -i is done running, you must reboot your machine.
2.7: How to Set Up a DNS Client
-------------------------------
You will need to set up your machine as a DNS Client if you want to
connect to DNS, so that you can resolve internet network names.
On a SUNOS machine, you must be running NIS if you wish to access DNS.
Provided that your nis-master is already running DNS, you should not
need to make any other changes. If you wish nslookup to work, you
should also create an /etc/resolv.conf file on your new-machine. The
easiest way to do this is ftp or copy an /etc/resolv.conf from a
working machine. The /etc/resolv.conf should have a domain line which
lists your domain name, and nameserver lines listing each of your
dns-servers:
new-machine% cat /etc/resolv.conf
domain example.com
nameserver 150.101.16.13
On a SOLARIS machine, you do not need to run NIS to access DNS.
Rather, you should follow a different procedure:
First, you need to set up a resolv.conf, as is described above.
Second, you need to add a 'dns' entry to the 'hosts:' line of your
new-machine's /etc/nsswitch.conf. If you are using only files, the
hosts: line should look like this:
hosts: files dns
If you are using NIS+, the hosts: line should look like this:
hosts: files nisplus dns
2.8: How to Set Up a netmask
----------------------------
You will need to set up a netmask only if there is a netmask already
being used on your subnet. If you should be using a netmask, and are
not, your machine may be unable to route, unable to speak with NIS
masters, or have other problems.
You can verify that netmasks differ by running 'ifconfig -a' on a
known working machine, that is on the same subnet as yours, and then
comparing it to your machine:
nis-master% ifconfig -a
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 150.201.16.11 netmask ffffff00 broadcast 150.201.16.255
new-machine% ifconfig -a
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 150.201.16.21 netmask ffff0000 broadcast 150.201.255.255
The above example would show me that there was a netmask problem on my
machine.
On a SunOS machine, you can set a netmask by making an entry in the
/etc/netmasks file, with the format:
network-number-without-zeroes netmask
For example:
150.201 255.255.255.0
On a SOLARIS machine, you can set a netmask by making an entry in the
/etc/netmasks file, with the format:
network-number-with-zeroes netmask
For example:
150.201.0.0 255.255.255.0
After making these additions, you must reboot the machine.
If you are not clear on what the precise contents of the netmasks file
should be, you can look at another Sun machine on the same subnet, and
simply copy the netmasks file from it.
SunService has a seperate Tip Sheet on Routing, which explains exactly
what netmasks are, and why they are used.
3.0: Common How Tos for Modifying a Machine on a Network
========================================================
3.1: How to Change the Name of a Machine
----------------------------------------
To change the name of a machine, you should first modify all naming
services (NIS, NIS+, DNS), using the same procedures as described in
Section 2.1.
Afterwards, the best way to modify the machine itself, is to run
sys-unconfig, then reboot the machine, and begin configuring from
scratch:
# sys-unconfig
# reboot
If you are unwilling to do this, changing the interface name, node
name, and local hosts file as described in Section 2.2, then rebooting
the machine, should be sufficient, but is not the suggested method.
3.2: How to Move a Machine
--------------------------
If you wish to move your machine to another location on the same
subnet, no changes should be necesary.
If you are moving the machine to a new subnet, you will clearly be
changing the IP address of your machine. This results in a huge number
of changes, and you should run sys-unconfig, reboot the machine, and
begin configuring it from scratch:
# sys-unconfig
# reboot
If you are unwilling to do this, you will need to run through all of
the procedures described in Section 2.0 in order to set up your
machine for the new network. In particular: the naming services must
be given the new IP address (Section 2.1); your ethernet interface
name may need to be changed, and the hosts file must be changed
(Section 2.2); if you use a default router, you must define a new one
that is on your new subnet (Section 2.3); you may wish to change your
DNS or mail setup, if a new DNS server or mailhost is now closer
(Section 2.4, Section 2.7); if you are running NIS under Solaris, you
must rerun ypinit (Section 2.5). No changes need be made to SunOS NIS
or NIS+, provided that there is still a local server.
However, running sys-unconfig is the preferred method, as it is easy
to miss a change that must be made.
4.0: Patches
============
A Set of standard patches must be installed for your machine to run
correctly. These are available on sunsolve1.sun.com in the
/pub/patches directory.
4.1: SunOS Patches
------------------
For SunOS machines, you should ftp to sunsolve1, and retrieve the
appropriate patch report:
Solaris1.1.1.PatchReport
Solaris1.1.2.PatchReport
Solaris1.1.PatchReport
These reports list the recommended patches for SunOS. You should
examine them, and then return to sunsolve1, retrieve the recommended
patches, and install them.
4.2: Solaris Patches
--------------------
For Solaris machines, you should ftp to sunsolve1, and retrieve the
appropriate tar file:
2.3_Recommended.tar.Z
2.4_Recommended.tar.Z
Afterwards, simply uncompress the file, untar it, cd into your new
directory, and run the install script:
# zcat 2.4_Recommended.tar.Z | tar xf -
# cd 2.4_Recommended
# ./install_cluster
5.0: References
===============
The following references should be used if you would like more
information on network basics.
5.1: Sun Educational Services
-----------------------------
SA-[?] Solaris 1.X System Administration
SA-380 Solaris Network Administration
5.2: Solaris Documentation
--------------------------
_System and Network Administration_, Part #800-3805-10
A general reference on Solaris system administration.
_TCP/IP Network Administration Guide_, Part #801-6632-10
General information on setting up TCP/IP.
_Name Services Configuration Guide_, Part #801-6635-10
An explanation of NIS, NIS+, DNS.
_Name Services Administration Guide_, Part #801-6633-10
Complete information on setting up NIS+.
5.3: Third Party Documentation
------------------------------
_Essential System Administration_, by Aeleen Frisch, published by
O'Reilly & Associates, ISBN 0-937175-80-3
Another general system administration reference, this one covering
both BSD systems (SunOS) and SYSV systems (Solaris).
_TCP/IP Network Administration_, by Craig Hunt, published by O'Reilly
& Associates, ISBN 0-937175-82-X
An excellent overview of network configuration, and the most common
network protocols. Geared towards SunOS, although much is unchanged
under Solaris.
6.0: Supportability
===================
SunService does not do basic network configuration. This document is
provided to help you to do basic configuration on your own.
We can help resolve problems where the network is not behaving
correctly, but in such cases the contact must be a system
administrator who has a good understanding of how Sun networking
works.
7.0: Additional Support
=======================
For help with initial configuration, please contact your local
SunService office for possible consulting offerings. Sun's Customer
Relations organization can put you in touch with your local
SunIntegration or Sales office. You can reach Customer Relations at
800-821-4643.