advanced system administration for the solaris 10 operating system

Upload: sagara499

Post on 30-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    1/788

    Sun Microsystems, Inc.UBRM05-104

    500 Eldorado Blvd.Broomfield, CO 80021

    U.S.A.

    Revision A

    StudentGuide

    Advanced System Administrationfor the Solaris 10Operating System

    SA-202-S10

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    2/788

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    3/788

    Please

    Recycle

    Copyright 2005 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

    This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, anddecompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization ofSun and its licensors, if any.

    Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.

    Sun, Sun Microsystems, the Sun logo, Solaris, JumpStart, Web Start, Solstice DiskSuite, SunBlade, SunSolve, Ultra, OpenBoot, Java, SunRay, Java Card and iPlanet are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.

    All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. andother countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.

    UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.

    The OPEN LOOK andSun GraphicalUser Interface wasdevelopedby SunMicrosystems, Inc.for itsusers andlicensees.Sun acknowledgesthe pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry.Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Suns licensees whoimplement OPEN LOOK GUIs and otherwise comply with Suns written license agreements.

    Federal Acquisitions: Commercial Software Government Users Subject to Standard License Terms and Conditions

    Export Laws. Products, Services, and technical data delivered by Sun may be subject to U.S. export controls or the trade laws of othercountries. You will comply with all such laws and obtain all licenses to export, re-export, or import as may be required after delivery toYou. You will not export or re-export to entities on the most current U.S. export exclusions lists or to any country subject to U.S. embargoor terrorist controlsas specified in the U.S. export laws. You willnot use or provideProducts, Services, or technical data for nuclear, missile,or chemical biological weaponry end uses.

    DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS, ANDWARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSEOR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BELEGALLY INVALID.

    THIS MANUAL IS DESIGNED TO SUPPORT AN INSTRUCTOR-LED TRAINING (ILT) COURSE AND IS INTENDED TO BEUSED FOR REFERENCE PURPOSES IN CONJUNCTION WITH THE ILT COURSE. THE MANUAL IS NOT A STANDALONETRAINING TOOL. USE OF THE MANUAL FOR SELF-STUDY WITHOUT CLASS ATTENDANCE IS NOT RECOMMENDED.

    Export Commodity Classification Number (ECCN) assigned: 12 December 2001

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    4/788

    Please

    Recycle

    Copyright 2005 Sun Microsystems Inc. 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits rservs.

    Ce produit ou document est protg par un copyright et distribu avec des licences qui en restreignent lutilisation, la copie, la distribution,et la dcompilation. Aucune partie de ce produit ou document ne peut tre reproduite sous aucune forme, par quelque moyen que ce soit,sans lautorisation pralable et crite de Sun et de ses bailleurs de licence, sil y en a.

    Le logiciel dtenu par des tiers, et qui comprend la technologie relative aux polices de caractres, est protg par un copyright et licencipar des fournisseurs de Sun.

    Sun, Sun Microsystems, le logo Sun, Solaris, JumpStart, Web Start, Solstice DiskSuite, SunBlade, SunSolve, Ultra, OpenBoot, Java, Sun Ray,Java Card, et iPlanet sont des marques de fabrique ou des marques dposes de Sun Microsystems, Inc. aux Etats-Unis et dans dautrespays.

    Toutes les marques SPARC sont utilises sous licence sont des marques de fabrique ou des marques dposes de SPARC International, Inc.aux Etats-Unis et dans dautres pays. Les produits portant les marques SPARC sont bass sur une architecture dveloppe par SunMicrosystems, Inc.

    UNIX est une marques dpose aux Etats-Unis et dans dautres pays et licencie exclusivement par X/Open Company, Ltd.

    Linterfaces dutilisation graphique OPEN LOOK et Sun a t dveloppe par Sun Microsystems, Inc. pour ses utilisateurs et licencis.Sun reconnat les efforts de pionniers de Xerox pour larecherche et le dveloppement du concept des interfaces dutilisation visuelle ougraphique pour lindustrie de linformatique. Sun dtient une licence non exclusive de Xerox sur linterface dutilisation graphique Xerox,cette licence couvrant galement les licencis de Sun qui mettent en place linterface dutilisation graphique OPEN LOOK et qui en outre

    se conforment aux licences crites de Sun.

    Lgislation en matire dexportations. Les Produits, Services et donnes techniques livrs par Sun peuvent tre soumis aux contrlesamricains sur les exportations, ou la lgislation commerciale dautres pays. Nous nous conformerons lensemble de ces textes et nousobtiendrons toutes licences dexportation, de r-exportation ou dimportation susceptibles dtre requises aprs livraison Vous. Vousnexporterez, ni ne r-exporterez en aucun cas des entits figurant sur les listes amricaines dinterdiction dexportation les plus courantes,ni vers un quelconque pays soumis embargo par les Etats-Unis, ou des contrles anti-terroristes, comme prvu par la lgislationamricaine en matiredexportations. Vous nutiliserez, ni ne fournirez les Produits, Servicesou donnes techniques pour aucune utilisationfinale lie aux armes nuclaires, chimiques ou biologiques ou aux missiles.

    LA DOCUMENTATION EST FOURNIE EN LETAT ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIESEXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, YCOMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A LAPTITUDE A UNEUTILISATION PARTICULIERE OU A LABSENCE DE CONTREFAON.

    CE MANUEL DE RFRENCE DOIT TRE UTILIS DANS LE CADRE DUN COURS DE FORMATION DIRIG PAR UNINSTRUCTEUR (ILT). IL NE SAGIT PAS DUN OUTIL DE FORMATION INDPENDANT. NOUS VOUS DCONSEILLONS DELUTILISER DANS LE CADRE DUNE AUTO-FORMATION.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    5/788

    vCopyright2005Sun Microsystems, Inc. All RightsReserved.Sun Services, RevisionA

    Table of Contents

    About This Course ............................................................Preface-xviiCourse Goals....................................................................... Preface-xviiCourse Map........................................................................ Preface-xviiiTopics Not Covered.............................................................Preface-xixHow Prepared Are You?.....................................................Preface-xxiIntroductions .......................................................................Preface-xxiiHow to Use Course Materials ..........................................Preface-xxiiiConventions........................................................................Preface-xxiv

    Icons ............................................................................Preface-xxivTypographical Conventions..................................... Preface-xxv

    Describing Interface Configuration ................................................1-1Objectives ........................................................................................... 1-1Controlling and Monitoring Network Interfaces.......................... 1-2

    Displaying the MAC Address................................................. 1-2

    Displaying the IP Address...................................................... 1-3Marking an Ethernet Interface as Down................................ 1-3Sending ICMP ECHO_REQUESTPackets..................................1-4Capturing and Inspecting Network Packets........................ 1-5

    The Service Management Facility (SMF) ........................................ 1-6SMF Service................................................................................ 1-6Service Identifiers...................................................................... 1-6Service States ............................................................................. 1-7Milestones .................................................................................. 1-8The svc.startd Daemon............................................................. 1-9

    Configuring IPv4 Interfaces at Boot Time.................................... 1-10

    Introducing IPv4 Interface Files............................................ 1-10Changing the System Host Name ....................................... 1-13

    Performing the Exercises ................................................................ 1-16Exercise: The Solaris OS Network Commands (Level 1) ........... 1-17

    Preparation............................................................................... 1-17Tasks ......................................................................................... 1-17

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    6/788

    vi Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Exercise: The Solaris OS Network Commands (Level 2) ........... 1-18Preparation............................................................................... 1-18Task Summary......................................................................... 1-18Tasks ........................................................................................ 1-19

    Exercise: The Solaris OS Network Commands (Level 3) ........... 1-21

    Preparation............................................................................... 1-21Task Summary......................................................................... 1-21Tasks and Solutions............................................................... 1-22

    Exercise Summary............................................................................ 1-24

    Describing the Client-Server Model ............................................... 2-1Objectives ........................................................................................... 2-1Introducing Client-Server Processes ............................................... 2-2

    Introducing Client Processes................................................... 2-2Introducing Server Processes ................................................. 2-4

    Starting Server Processes .................................................................. 2-6Introducing the Internet Service Daemon (inetd) .............. 2-6

    The Impact of SMF on Network Services............................. 2-9Introducing Network Ports .................................................. 2-11Starting Services That Use a Well-Known Port .................. 2-12Starting RPC Services ............................................................. 2-14Using the rpcinfoCommands ........................................... 2-18

    Performing the Exercises ................................................................ 2-20Exercise: Observing the Solaris OS Network (Level 1)............... 2-21

    Preparation............................................................................... 2-21Tasks ......................................................................................... 2-21

    Exercise: Observing the Solaris OS Network (Level 2)............... 2-23Preparation............................................................................... 2-23Task Summary......................................................................... 2-23Tasks ......................................................................................... 2-24

    Exercise: Observing the Solaris OS Network (Level 3)............... 2-27Preparation............................................................................... 2-27Task Summary......................................................................... 2-27Tasks and Solutions................................................................ 2-28

    Exercise Summary............................................................................ 2-33

    Customizing the Solaris Management Console ........................ 3-1Objectives ........................................................................................... 3-1Introducing the Solaris Management Console Toolbox

    Editor Actions.................................................................................. 3-2Starting the Solaris Management Console ............................ 3-2Introducing the Solaris Management Console and the

    Solaris Management Console Toolbox Editor ................... 3-4Adding a Toolbox URL ......................................................... 3-17Adding a Tool.......................................................................... 3-17

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    7/788

    viiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA

    Using the Solaris Management Console Toolbox Editor ........... 3-19Adding Access to a Toolbox URL of a Solaris

    Management Console.......................................................... 3-19Adding Access to a Tool ........................................................ 3-35

    Performing the Exercises ................................................................ 3-58

    Exercise: Using the Solaris Management Console (Level 1)...... 3-59Preparation............................................................................... 3-59Task Summary......................................................................... 3-59

    Exercise: Using the Solaris Management Console (Level 2)...... 3-60Preparation............................................................................... 3-60Task Summary......................................................................... 3-60Tasks ........................................................................................ 3-61

    Exercise: Using the Solaris Management Console (Level 3)...... 3-68Preparation............................................................................... 3-68Task Summary......................................................................... 3-68Tasks and Solutions ................................................................ 3-69

    Exercise Summary............................................................................ 3-76Managing Swap Configuration........................................................4-1

    Objectives ........................................................................................... 4-1Introducing Virtual Memory............................................................ 4-2

    Physical RAM ............................................................................ 4-2Swap Space ............................................................................... 4-3The swapfs File System ........................................................... 4-4Paging ........................................................................................ 4-5

    Configuring Swap Space................................................................... 4-6Displaying the Current Swap Configuration........................ 4-6Adding Swap Space.................................................................. 4-8Removing Swap Space ............................................................. 4-9

    Performing the Exercises ................................................................ 4-11Exercise: Managing swapUtility Configuration (Level 1) ......... 4-12

    Preparation............................................................................... 4-12Tasks ......................................................................................... 4-13

    Exercise: Managing swapUtility Configuration (Level 2) ......... 4-14Preparation............................................................................... 4-14Task Summary......................................................................... 4-15Tasks ......................................................................................... 4-15

    Exercise: Managing swapUtility Configuration (Level 3) ......... 4-18Preparation............................................................................... 4-18Task Summary......................................................................... 4-19Tasks and Solutions ............................................................... 4-19

    Exercise Summary............................................................................ 4-23

    Managing Crash Dumps and Core Files.........................................5-1Objectives ........................................................................................... 5-1Managing Crash Dump Behavior.................................................... 5-2

    The Crash Dump....................................................................... 5-2Displaying the Current Dump Configuration ...................... 5-3Changing the Crash Dump Configuration........................... 5-4

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    8/788

    viii Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Managing Core File Behavior........................................................... 5-6Core Files.................................................................................... 5-6Displaying the Current Core File Configuration.................. 5-7Changing the Core File Configuration .................................. 5-9

    Performing the Exercises ................................................................ 5-14

    Exercise: Collecting the Crash Dump and Core Dump(Level 1) .......................................................................................... 5-15Preparation............................................................................... 5-15Tasks ......................................................................................... 5-15

    Exercise: Collecting the Crash Dump and Core Dump(Level 2) .......................................................................................... 5-16

    Preparation............................................................................... 5-16Task Summary......................................................................... 5-16Tasks ......................................................................................... 5-17

    Exercise: Collecting the Crash Dump and Core Dump(Level 3) .......................................................................................... 5-19

    Preparation............................................................................... 5-19Task Summary......................................................................... 5-19Tasks and Solutions................................................................ 5-20

    Exercise Summary............................................................................ 5-23

    Configuring NFS .............................................................................. 6-1Objectives ........................................................................................... 6-1Introducing the Benefits of NFS....................................................... 6-2

    Benefits of Centralized File Access........................................ 6-3Benefits of Common Software Access.................................... 6-3

    Introducing the Fundamentals of the NFS DistributedFile System ....................................................................................... 6-4

    NFS Server................................................................................. 6-5NFS Client .................................................................................. 6-6

    Managing an NFS Server .................................................................. 6-7The NFS Server Files................................................................. 6-7The NFS Server Daemons..................................................... 6-10Managing the NFS Server Daemons .................................... 6-12NFS Server Commands.......................................................... 6-13Configuringthe NFS Server for Sharing Resources........... 6-14

    Managing the NFS Client................................................................ 6-19NFS Client Files ....................................................................... 6-19NFS Client Daemons .............................................................. 6-20Managing the NFS Client Daemons.................................... 6-21NFS Client Commands.......................................................... 6-22Configuring the NFS Client for Mounting Resources ....... 6-22

    Enabling the NFS Server Logging ................................................. 6-28Fundamentals of NFS Server Logging................................. 6-28Configuring NFS Log Paths ................................................. 6-29Initiating NFS Logging.......................................................... 6-31Configuring the nfslogdDaemon Behavior..................... 6-32

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    9/788

    ixCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA

    Managing NFS With the Solaris Management ConsoleStorage Folder Tools ..................................................................... 6-33

    Adding a Shared Directory on the NFS Server................... 6-33Mounting a Shared Directory on the NFS Client .............. 6-35

    Troubleshooting NFS Errors .......................................................... 6-37

    Therpcbind failure

    Error.................................................. 6-37The servernotresponding Error...................................... 6-38The NFS client fails a reboot Error .......................... 6-38The service not responding Error.................................6-39The program not registered Error.................................6-39The staleNFSfile handleError...................................... 6-40The unknown host Error ....................................................... 6-40The mountpointError .......................................................... 6-40The no such file Error...................................................... 6-41

    Performing the Exercises ................................................................ 6-42Exercise: Configuring NFS (Level 1) ............................................. 6-43

    Preparation............................................................................... 6-43Tasks ......................................................................................... 6-43Exercise: Configuring NFS (Level 2) ............................................. 6-45

    Preparation............................................................................... 6-45Task Summary......................................................................... 6-45Tasks ......................................................................................... 6-46

    Exercise: Configuring NFS (Level 3) ............................................. 6-49Preparation............................................................................... 6-49Task Summary......................................................................... 6-49Tasks and Solutions ................................................................ 6-50

    Exercise Summary............................................................................ 6-54

    Configuring AutoFS .........................................................................7-1Objectives ........................................................................................... 7-1Introducing the Fundamentals of AutoFS...................................... 7-2

    AutoFS File System................................................................... 7-3The automountdDaemon....................................................... 7-4The automountCommand ......................................................7-4

    Using Automount Maps ................................................................... 7-5Configuring the Master Map................................................... 7-6Identifying Mount Points for Special Maps ......................... 7-8Adding Direct Map Entries ..................................................... 7-9Adding Indirect Map Entries ................................................ 7-11Updating the Automount Maps ........................................... 7-14Stopping and Starting the Automount System................... 7-16

    Performing the Exercises ................................................................ 7-18Exercise: Using the Automount Facility (Level 1)....................... 7-19

    Preparation............................................................................... 7-19Tasks ......................................................................................... 7-19

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    10/788

    x Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Exercise: Using the Automount Facility (Level 2)....................... 7-20Preparation............................................................................... 7-20Task Summary......................................................................... 7-20Tasks ......................................................................................... 7-21

    Exercise: Using the Automount Facility (Level 3)....................... 7-25

    Preparation............................................................................... 7-25Task Summary......................................................................... 7-25Tasks and Solutions................................................................ 7-26

    Exercise Summary............................................................................ 7-32

    Describing RAID and Solaris Volume Manager Software......... 8-1Objectives ........................................................................................... 8-1Introducing RAID .............................................................................. 8-2

    RAID 0 ........................................................................................ 8-2RAID 1 ....................................................................................... 8-7RAID 5 ...................................................................................... 8-13Hardware Considerations ..................................................... 8-16

    Introducing Solaris Volume Manager Software Concepts ........ 8-20Logical Volume ....................................................................... 8-20Soft Partitions .......................................................................... 8-21Introducing the State Database ............................................. 8-22Introducing Hot Spares and Hot Spare Pools..................... 8-25

    Configuring Solaris Volume Manager Software............................ 9-1Objectives ........................................................................................... 9-1Solaris Volume Manager Concepts ................................................. 9-2The State Database Replicas ............................................................. 9-3

    Creating the State Database..................................................... 9-3

    Configuring RAID 0 ........................................................................ 9-14RAID 0 Striped Volumes................................................................. 9-15

    Creating a RAID 0 Volume................................................... 9-16Configuring RAID 1 ........................................................................ 9-29Building a Mirror of the Root (/) File System.............................. 9-31

    The Scenario............................................................................ 9-32Creating The RAID 0 Volumes ............................................. 9-32Creating The RAID 1 Volume ............................................... 9-43Unmirroring the Root (/) File System................................. 9-60

    Performing the Exercises ................................................................ 9-62Exercise: Mirroring the Root (/) File System (Level 1) ............... 9-63

    Preparation............................................................................... 9-63Tasks ......................................................................................... 9-64

    Exercise: Mirroring the Root (/) File System (Level 2) ............... 9-65Preparation............................................................................... 9-65Task Summary......................................................................... 9-66Tasks ......................................................................................... 9-66

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    11/788

    xiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA

    Exercise: Mirroring the Root (/) File System (Level 3) ............... 9-69Preparation............................................................................... 9-69Task Summary......................................................................... 9-70Tasks and Solutions ................................................................ 9-70

    Exercise Summary............................................................................ 9-74

    Configuring Role-Based Access Control (RBAC) .......................10-1Objectives ......................................................................................... 10-1Introducing RBAC Fundamentals................................................. 10-2

    Key RBAC Files ....................................................................... 10-2Roles.......................................................................................... 10-3Assigning Rights Profiles To Users ..................................... 10-4Assigning Rights Profiles To Roles ...................................... 10-7Assigning Roles To Users .................................................... 10-10Using Roles ............................................................................ 10-11

    Authorizations................................................................................ 10-12Assigning Authorizations.................................................... 10-14

    Assigning Authorizations To User Accounts .................. 10-15Assigning Authorizations To Roles.................................... 10-16Assigning Authorizations To Rights Profiles .................. 10-17

    RBAC Configuration File Summary............................................ 10-18The /etc/user_attrFile.................................................... 10-18The /etc/security/prof_attrFile................................ 10-19The /etc/security/exec_attrFile................................ 10-21The /etc/security/auth_attrFile............................... 10-23

    Managing RBAC Using the Solaris Management Console...... 10-26Fundamentals of Managing RBAC..................................... 10-26

    Performing the Exercises .............................................................. 10-59Exercise: Configuring RBAC (Level 1)........................................ 10-60

    Preparation............................................................................. 10-60Task Summary....................................................................... 10-60

    Exercise: Configuring RBAC (Level 2)........................................ 10-61Preparation............................................................................. 10-61Task Summary....................................................................... 10-61Tasks ....................................................................................... 10-62

    Exercise: Configuring RBAC (Level 3)........................................ 10-66Preparation............................................................................. 10-66Task Summary....................................................................... 10-66Tasks and Solutions ............................................................. 10-67

    Exercise Summary.......................................................................... 10-73

    Configuring System Messaging....................................................11-1Objectives ......................................................................................... 11-1Introducing the syslog Function.................................................. 11-2

    The syslogConcept............................................................... 11-2The /etc/syslog.confFile ................................................ 11-3The syslogdDaemon and the m4Macro Processor ......... 11-8

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    12/788

    xii Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Configuring the /etc/syslog.confFile................................... 11-12Message Routing................................................................... 11-12Stopping and Starting the syslogdDaemon.................... 11-13

    Configuring syslogMessaging .................................................. 11-14Enabling TCP Tracing .......................................................... 11-14

    Monitoring asyslog

    File in Real Time ............................. 11-16Adding One-Line Entries to a System Log File ............... 11-18Using the Solaris Management Console Log Viewer ............... 11-20

    Opening the Solaris Management Console LogViewer.................................................................................. 11-20

    Viewing a syslogMessage File.......................................... 11-21Viewing a Management Tools Log File ............................ 11-23Browsing the Contents of a Management Tools L

    og File.................................................................................. 11-26Displaying Management Tools Log Entry Details ........... 11-28Backing Up Management Tools Log File ......................... 11-30

    Performing the Exercises .............................................................. 11-34Exercise: Using the syslog Function and AuditingUtilities (Level 1) ......................................................................... 11-35

    Preparation............................................................................. 11-35Tasks ....................................................................................... 11-35

    Exercise: Using the syslog Function and AuditingUtilities (Level 2) ......................................................................... 11-37

    Preparation............................................................................. 11-37Task Summary....................................................................... 11-37Tasks ....................................................................................... 11-38

    Exercise: Using the syslog Function and Auditing

    Utilities (Level 3) ......................................................................... 11-44Preparation............................................................................. 11-44Task Summary....................................................................... 11-44Tasks and Solutions.............................................................. 11-45

    Exercise Summary.......................................................................... 11-53

    Using Name Services .................................................................... 12-1Objectives ......................................................................................... 12-1Introducing the Name Service Concept........................................ 12-2

    Domain Name System (DNS) ............................................... 12-4Network Information Service (NIS) ..................................... 12-5Network Information Service Plus (NIS+)......................... 12-7Lightweight Directory Access Protocol (LDAP) ................ 12-8Name Service Features Summary....................................... 12-10

    Introducing the Name Service Switch File................................. 12-11Database Sources.................................................................. 12-13Status Codes........................................................................... 12-14Actions.................................................................................... 12-14

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    13/788

    xiiiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA

    Configuring the Name Service Cache Daemon (nscd) ............ 12-16The nscdDaemon................................................................. 12-16Configuring the nscdDaemon ........................................... 12-17Stopping and Starting the nscd Daemon ..........................12-19

    Retrieving Name Service Information ........................................ 12-20

    Thegetent

    Command......................................................... 12-20Using the getentCommand ............................................. 12-21Exercise: Reviewing Name Services............................................ 12-22

    Preparation............................................................................. 12-22Tasks ....................................................................................... 12-22Task Solutions........................................................................ 12-23

    Exercise Summary.......................................................................... 12-25

    Configuring Name Service Clients................................................13-1Objectives ......................................................................................... 13-1Configuring a DNS Client .............................................................. 13-2

    Configuring the DNS Client During Installation ............... 13-2

    Editing DNS Client Configuration Files .............................. 13-5Setting Up an LDAP Client............................................................. 13-7

    Client Authentication ............................................................. 13-7Client Profile and Proxy Account......................................... 13-7Client Initialization ................................................................. 13-8Configuring the LDAP Client During Installation............. 13-8Initializing the Native LDAP Client................................... 13-10Copying the /etc/nsswitch.ldapFile to the /etc/nsswitch.confFile .......................................................... 13-13

    Listing LDAP Entries............................................................ 13-14Unconfiguring an LDAP Client .......................................... 13-15

    Performing the Exercises .............................................................. 13-16Exercise: Configuring a System to Use DNS and LDAP

    (Level 1) ........................................................................................ 13-17Preparation............................................................................. 13-17Tasks ....................................................................................... 13-17

    Exercise: Configuring a System to Use DNS and LDAP(Level 2) ........................................................................................ 13-18

    Preparation............................................................................. 13-18Task Summary....................................................................... 13-18Tasks ....................................................................................... 13-18

    Exercise: Configuring a System to Use DNS and LDAP(Level 3) ........................................................................................ 13-20

    Preparation............................................................................. 13-20Task Summary....................................................................... 13-20Tasks and Solutions .............................................................. 13-21

    Exercise Summary.......................................................................... 13-23

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    14/788

    xiv Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Configuring the Network Information Service (NIS)................... 14-1Objectives ......................................................................................... 14-1Introducing NIS Fundamentals ..................................................... 14-2

    NIS Namespace Information................................................. 14-2NIS Domains............................................................................ 14-4

    NIS Processes.......................................................................... 14-6Configuring the Name Service Switch.......................................... 14-9Changing Lookup Requests to Go From Files to NIS...... 14-10Changing Lookup Requests to Go From NIS to Files...... 14-11

    Introducing NIS Security .............................................................. 14-13The securenets File ........................................................... 14-13The passwd.adjunctFile.................................................... 14-14

    Configuring NIS Domain.............................................................. 14-16Generating NIS Maps ........................................................... 14-16Configuring the NIS Master Server.................................... 14-20Testing the NIS Service ........................................................ 14-23

    Configuring the NIS Client.................................................. 14-24Configuring the NIS Slave Server....................................... 14-25Updating the NIS Map ......................................................... 14-27Updating the NIS Password Map....................................... 14-27Updating the NIS timezoneMap ...................................... 14-28

    Building Custom NIS Maps.......................................................... 14-32Using the makeCommand................................................... 14-32Editing the NIS Makefile File........................................... 14-33

    Troubleshooting NIS ..................................................................... 14-38Troubleshooting NIS Server Failure Messages................. 14-38Troubleshooting NIS Client Failure Messages ................. 14-41

    Performing the Exercises .............................................................. 14-43Exercise: Configuring NIS (Level 1) ............................................ 14-44Preparation............................................................................. 14-44Tasks ....................................................................................... 14-45

    Exercise: Configuring NIS (Level 2) ............................................ 14-46Preparation............................................................................. 14-46Task Summary....................................................................... 14-47Tasks ....................................................................................... 14-48

    Exercise: Configuring NIS (Level 3) ............................................ 14-55Preparation............................................................................. 14-55Task Summary....................................................................... 14-56

    Tasks and Solutions............................................................. 14-57Exercise Summary.......................................................................... 14-69

    Introduction to Zones.................................................................... 15-1Objectives ......................................................................................... 15-1Introducing Solaris Zones............................................................... 15-2

    Server Consolidation Solutions............................................. 15-2Resource Sharing..................................................................... 15-3Zone Features .......................................................................... 15-4

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    15/788

    xvCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA

    Zone Concepts.................................................................................. 15-5Zone Types............................................................................... 15-5Zone Daemons......................................................................... 15-6Zone File Systems ................................................................... 15-7Zone Networking.................................................................... 15-8

    Zone Command Scope ........................................................... 15-9Zone States ............................................................................... 15-9Configuring Zones......................................................................... 15-11

    Identifying Zone Components............................................ 15-11Allocating File System Space............................................... 15-11Using the zonecfgCommand ............................................ 15-12The zonecfgResources Parameters................................... 15-14Zone Configuration Walk-Through .................................. 15-15Viewing the Zone Configuration File ................................ 15-18

    Using the zoneadmCommand .....................................................15-19Verifying a Configured Zone .............................................. 15-19

    Installing a Configured Zone .............................................. 15-20Booting a Zone....................................................................... 15-20Halting a Zone....................................................................... 15-21Rebooting a Zone .................................................................. 15-21Logging Into and Working With the Zone........................ 15-21Deleting a Zone ..................................................................... 15-23

    Configuring the Custom JumpStart Procedure...........................16-1Objectives ......................................................................................... 16-1Introducing JumpStart Configurations......................................... 16-2

    Purpose of JumpStart ............................................................. 16-2Boot Services........................................................................... 16-4Identification Services ............................................................ 16-5Configuration Services ........................................................... 16-7Installation Services ............................................................... 16-9

    Implementing a Basic JumpStart Server..................................... 16-11Spooling the Operating System Image .............................. 16-11Editing the sysidcfg File.................................................... 16-13Running the check Script .................................................... 16-22Running the add_install_clientScript........................ 16-23Booting the JumpStart Client .............................................. 16-26

    Exercise: Configuring a Software Installation ProcedureUsing JumpStart .......................................................................... 16-27

    Task Preparation ................................................................... 16-27Task Summary....................................................................... 16-27Worksheet for Configuring a Software Installation

    Procedure Using JumpStart Software............................. 16-28Tasks ...................................................................................... 16-29Task Solutions........................................................................ 16-33

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    16/788

    xvi Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,RevisionA

    Setting Up JumpStart Software ConfigurationAlternatives.................................................................................. 16-34

    Introducing the JumpStart Client Boot Sequence ............ 16-35Setting Up a Boot-Only Server............................................ 16-41Setting Up Identification Service Alternatives ................. 16-45

    Setting Up Configuration Service Alternatives ................ 16-49Setting Up Installation Service Alternatives ..................... 16-61Troubleshooting JumpStart ................................................. 16-63Resolving Boot Problems..................................................... 16-63Resolving Identification Problems ..................................... 16-66Resolving Configuration Problems .................................... 16-68Resolving Installation Problems ......................................... 16-69Resolving Begin and Finish Script Problems .................... 16-70Identifying Log Files............................................................ 16-71

    Exercise: Configuring a Software Installation ProcedureUsing JumpStart to Create a RAID 1 Volume and Add

    a Patch During the JumpStart Process ..................................... 16-72Preparation............................................................................. 16-72Task Summary....................................................................... 16-72Worksheet for Configuring a Software Installation

    Procedure Using JumpStart Software............................. 16-73Tasks ...................................................................................... 16-74

    Exercise Summary.......................................................................... 16-80

    Performing a Flash Installation .................................................... 17-1Objectives ......................................................................................... 17-1Introducing the Flash Installation Feature ................................... 17-2

    Uses of the Flash Installation Feature .................................. 17-2Flash Deployment Methods .................................................. 17-3Flash Installation Process....................................................... 17-3Flash Installation Requirements .......................................... 17-5Manipulating a Flash Archive.............................................. 17-6Creating a Flash Archive........................................................ 17-6Administering a Flash Archive............................................. 17-9

    Using a Flash Archive for Installation ........................................ 17-11Using a Flash Archive With JumpStart Software............. 17-19Locating the Installation Logs ............................................. 17-26Live Upgrade ......................................................................... 17-26WANboot ............................................................................... 17-26

    Exercise Summary.......................................................................... 17-28

    Index...........................................................................................Index-1

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    17/788

    Preface-xviiCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Preface

    AboutThisCourse

    Course Goals

    Upon completion of this course, you should be able to:

    q Describe network basics

    q Describe remote administration with the Solaris ManagementConsole software

    q Manage virtual file systems and core dumps

    q Manage storage volumes

    q Control access and configure system messaging

    q Set up name services

    q Perform advanced installation procedures

    q

    Configure the custom JumpStart

    procedureq Perform a Flash installation

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    18/788

    Course Map

    Preface-xviii Advanced System Administration for the Solaris10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Course Map

    The course map enables you to see what you have accomplished andwhere you are going in reference to the instructional goals.

    D e s c r i b i n g

    I n t e r f a c e

    C o n f i g u r a t i o n

    D e s c r i b i n g t h e

    C l i e n t - S e r v e r

    M o d e l

    U s i n g

    N a m e

    S e r v i c e s

    C o n f i g u r i n g

    N a m e

    S e r v i c e C l i e n t s

    C o n f i g u r i n g

    t h e N e t w o r k

    I n f o r m a t i o n

    S e r v i c e ( N I S )

    D e s c r i b i n g N e t w o r k B a s i c s

    M a n a g i n g

    S w a p

    C o n f i g u r a t i o n

    M a n a g i n g

    C r a s h D u m p s

    a n d

    C o r e F i l e s

    C o n f i g u r i n g

    N F S

    C o n f i g u r i n g

    A u t o F S

    C o n f i g u r i n g

    R o l e - B a s e d

    A c c e s s C o n t r o l

    ( R B A C )

    C o n f i g u r i n g

    S y s t e m

    M e s s a g i n g

    M a n a g i n g V i r t u a l F i l e S y s t e m s a n d C o r e D u m p s

    D e s c r i b i n g

    R A I D a n d

    S o l a r i s

    V o l u m e

    M a n a g e r

    S o f t w a r e

    C u s t o m i z i n g

    t h e S o l a r i s

    M a n a g e m e n t

    C o n s o l e

    C o n f i g u r i n g

    S o l a r i s

    V o l u m e

    M a n a g e r

    S o f t w a r e

    M a n a g i n g S t o r a g e V o l u m e s

    C o n t r o l l i n g A c c e s s a n d C o n f i g u r i n g S y s t e m M e s s a g i n g

    S e t t i n g U p N a m e S e r v i c e s

    C o n f i g u r i n g

    t h e C u s t o m

    J u m p S t a r t

    P r o c e d u r e

    P e r f o r m i n g a

    F l a s h

    I n s t a l l a t i o n

    P e r f o r m i n g A d v a n c e d I n s t a l l a t i o n P r o c e d u r e s

    I n t r o d u c t i o n

    t o

    Z o n e s

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    19/788

    Topics Not Covered

    About This Course Preface-xixCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Topics Not Covered

    This course does not cover the following topics. Many of these topics arecovered in other courses offered by Sun Educational Services:

    q Basic UNIX commands Covered in SA-100: UNIX EssentialsFeaturing the Solaris 10 Operating System

    q The vi editor Covered in SA-100: UNIX Essentials Featuring theSolaris 10 Operating System

    q Basic UNIX file security Covered in SA-100: UNIX EssentialsFeaturing the Solaris 10 Operating System

    q Software package administration Covered in SA-200: IntermediateSystem Administration for the Solaris 10 Operating System

    q Patch maintenance Covered in SA-200: Intermediate System

    Administration for the Solaris 10 Operating Systemq Adding users using the Solaris Management Console

    software Covered in SA-200: Intermediate System Administration forthe Solaris 10 Operating System

    q Basic system security Covered in SA-100: UNIX EssentialsFeaturing the Solaris 10 Operating System

    q Administering initialization files Covered in SA-200: IntermediateSystem Administration for the Solaris 10 Operating System

    q Advanced file permissions Covered in SA-200: Intermediate System

    Administration for the Solaris 10 Operating System

    q Backup and recovery Covered in SA-200: Intermediate SystemAdministration for the Solaris 10 Operating System

    q The lp print service and print commands Covered inSA-200: Intermediate System Administration for the Solaris 10Operating System

    q Process control Covered in SA-200: Intermediate SystemAdministration for the Solaris 10 Operating System

    q All the new features in Solaris 10 Covered in SA-225S10: Solaris

    10 for Experienced System Administrators

    q Hardware or software troubleshooting Covered in ST-350: SunSystems Fault Analysis Workshop

    q System tuning Covered in SA-400: Enterprise System PerformanceManagement

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    20/788

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    21/788

    How PreparedAre You?

    About This Course Preface-xxiCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    How Prepared Are You?

    To be sure you are prepared to take this course, can you answer yes to thefollowing questions?

    q Can you install and boot the Solaris 10 Operating System(Solaris 10 OS) on a standalone workstation?

    q Can you implement basic system security?

    q Can you add users to the system using the Solaris ManagementConsole software?

    q Can you use the pkgadd command to add software packages?

    q Can you monitor and mount file systems?

    q Can you manage disk devices and processes?

    q Can you perform backups and restorations?

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    22/788

    Introductions

    Preface-xxii Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Introductions

    Now that you have been introduced to the course, introduce yourself tothe other students and the instructor, addressing the following items:

    q Nameq Company affiliation

    q Title, function, and job responsibility

    q Experience related to topics presented in this course

    q Reasons for enrolling in this course

    q Expectations for this course

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    23/788

    How to Use Course Materials

    About This Course Preface-xxiiiCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    How to Use Course Materials

    To enable you to succeed in this course, these course materials use alearning module that is composed of the following components:

    q Objectives You should be able to accomplish the objectives aftercompleting a portion of instructional content. Objectives supportgoals and can support other higher-level objectives.

    q Lecture The instructor will present information specific to theobjective of the module. This information will help you learn theknowledge and skills necessary to succeed with the activities.

    q Activities The activities take on various forms, such as an exercise,self-check, discussion, and demonstration. Activities are used tofacilitate the mastery of an objective.

    q

    Visual aids The instructor might use several visual aids to convey aconcept, such as a process, in a visual form. Visual aids commonlycontain graphics, animation, and video.

    Note Many system administration tasks for the Solaris OS can beaccomplished in more than one way. The methods presented in thecourseware reflect recommended practices used by Sun EducationalServices.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    24/788

    Conventions

    Preface-xxiv Advanced System Administration for the Solaris10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Conventions

    The following conventions are used in this course to represent varioustraining elements and alternative learning resources.

    Icons

    ?

    !

    Discussion Indicates a small-group or class discussion on the currenttopic is recommended at this time.

    Note Indicates additional information that can help students but is notcrucial to their understanding of the concept being described. Studentsshould be able to understand the concept or complete the task withoutthis information. Examples of notational information include keywordshortcuts and minor system adjustments.

    Caution Indicates that there is a risk of personal injury from anonelectrical hazard, or risk of irreversible damage to data, software, orthe operating system. A caution indicates that the possibility of a hazard(as opposed to certainty) might happen, depending on the action of theuser.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    25/788

    Conventions

    About This Course Preface-xxvCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Typographical Conventions

    Courier is used for the names of commands, files, directories, usernames, host names, programming code, and on-screen computer output;for example:

    Use the ls -al command to list all files.host1# cd /home

    Courier bold is used for characters and numbers that you type; forexample:

    To list the files in this directory, type the following:# ls

    Courier italics is used for variables and command-line placeholders

    that are replaced with a real name or value; for example:To delete a file, use the rm filename command.

    Courier italic boldis used to represent variables whose values are tobe entered by the student as part of an activity; for example:

    Type chmod a+rwx filenameto grant read, write, and executerights for filename.

    Palatino italics is used for book titles, new words or terms, or words thatyou want to emphasize; for example:

    Read Chapter 6 in the Users Guide.

    These are called class options.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    26/788

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    27/788

    1-1Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Module 1

    Describing InterfaceConfiguration

    Objectives

    The network interfaces that a system uses to communicate with othersystems on the network use both hardware and software configuration

    components. When adding a network interface to a system, you mustconfigure specific files to establish a relationship between the hardwareand the software addresses.

    Upon completion of this module, you should be able to:

    q Control and monitor network interfaces

    q Configure Internet Protocol Version 4 (IPv4) interfaces at boot time

    The following course map shows how this module fits into the currentinstructional goal.

    Figure 1-1 Course Map

    D e s c r i b i n g

    I n t e r f a c e

    C o n f i g u r a t i o n

    D e s c r i b i n g t h e

    C l i e n t - S e r v e r

    M o d e l

    D e s c r i b i n g N e t w o r k B a s i c s

    C u s t o m i z i n g

    t h e S o l a r i s

    M a n a g e m e n t

    C o n s o l e

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    28/788

    Controlling and Monitoring Network Interfaces

    1-2 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Controlling and Monitoring Network Interfaces

    Network commands, such as ifconfig, ping, and snoop, control andmonitor the functionality of network interfaces.

    Displaying the MAC Address

    The media access control (MAC) address is your computers uniquehardware address on a local area network (LAN). The MAC address isalso the Ethernet address on an Ethernet LAN. When you are connectedto a LAN, an address resolution table maps your computers physicalMAC address to an Internet Protocol (IP) address on the LAN. Two waysto display the MAC address or the Ethernet address are:

    q Use the ifconfig -a command

    q Use the boot programmable read-only memory (PROM) bannercommand

    Note The MAC address is displayed only if run as the root user.

    # ifconfig -a

    lo0: flags=1000849 mtu 8232

    index 1 inet 127.0.0.1 netmask ff000000

    hme0: flags=1000843 mtu 1500 index 2inet 192.168.30.41 netmask ffffff00 broadcast 192.168.30.255

    ether 8:0:20:93:c9:af

    The MAC address is listed as 8:0:20:93:c9:af in this example.

    You can also retrieve the MAC address from a system that has not yetbeen booted by running the banner command at the ok prompt.

    okbanner

    Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 300MHz), Keyboard Present

    OpenBoot 3.31 256 MB (60ns) memory installed, Serial #9685423.Ethernet address 8:0:20:93:c9:af, Host ID: 8093c9af.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    29/788

    Controlling and Monitoring Network Interfaces

    Describing Interface Configuration 1-3Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Displaying the IP Address

    The ifconfig -a command displays the current configuration for thenetwork interfaces.

    With the -a option, the ifconfig command displays the currentconfiguration for all network interfaces in the system.

    # ifconfig -a

    lo0: flags=1000849 mtu 8232

    index 1 inet 127.0.0.1 netmask ff000000

    hme0: flags=1000843 mtu 1500 index 2

    inet 192.168.30.41 netmask ffffff00 broadcast 192.168.30.255

    ether 8:0:20:93:c9:af

    The previous example shows that the loopback interface (lo0) is up,

    running, and configured with an IP address of 127.0.0.1. The hme0interface is up, running, and configured with an IP address of192.168.30.41.

    Marking an Ethernet Interface as Down

    When an Ethernet interface is marked as down, it means that it cannotcommunicate. You can use the ifconfig command to mark an Ethernetinterface as up or down. For example, to mark the hme0 interface as down,

    perform the commands:# ifconfig hme0 down

    # ifconfig -a

    lo0: flags=1000849 mtu 8232

    index 1 inet 127.0.0.1 netmask ff000000

    hme0: flags=1000842 mtu 1500 index 2

    inet 192.168.30.41 netmask ffffff00 broadcast 192.168.30.255

    ether 8:0:20:93:c9:af

    Note The UP flag for hme0 is no longer present. When an interface isflagged as UP, it is ready to communicate.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    30/788

    Controlling and Monitoring Network Interfaces

    1-4 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    The following example shows that when you mark an interface as up, theUP status appears in the flags field of the ifconfig command output:

    # ifconfig hme0 up

    # ifconfig -a

    lo0: flags=1000849 mtu 8232

    index 1 inet 127.0.0.1 netmask ff000000hme0: flags=1000843 mtu 1500 index 2

    inet 192.168.30.41 netmask ffffff00 broadcast 192.168.30.255

    ether 8:0:20:93:c9:af

    Sending ICMP ECHO_REQUESTPackets

    To determine if you can contact another system over the network, enterthe ping command:

    #ping sys41sys41 is alive

    The previous response indicates the host name sys41 is alive. A responseof no answer from sys41 indicates that you cannot contact host sys41.This implies a problem with host sys41, or a problem with the network.

    For the ping command to succeed, the following conditions must besatisfied on both systems:

    q The interface must be plumbed.

    q The interface must be configured.

    q The interface must be up.

    q The interface must be physically connected.

    q The interface must have valid routes configured.

    For more information on ifconfig and plumbed, see the ifconfig manpage.

    Note Configuration of routes is an advanced networking topic. Detailednetwork administration concepts are covered in SA300: NetworkAdministration for the Solaris 10 Operating System.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    31/788

    Controlling and Monitoring Network Interfaces

    Describing Interface Configuration 1-5Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Capturing and Inspecting Network Packets

    You can use the snoop utility to capture and inspect network packets todetermine what kind of data is transferred between systems. You can usethe snoop utility to see what happens when one system uses the ping

    command to communicate with another system. To view network trafficbetween two specific systems, perform the command:

    # snoop sys41 sys42

    sys41 -> sys42 ICMP Echo request (ID: 615 Sequence number: 0)

    sys42 -> sys41 ICMP Echo reply (ID: 615 Sequence number: 0)

    Use the -a option to enable audible clicks, which notify you of anynetwork traffic. Although noisy, the clicks are useful whentroubleshooting.

    The following example shows how to turn on audible clicks for allnetwork traffic related to a Dynamic Host Configuration Protocol (DHCP)boot:

    # snoop -a dhcp

    Some additional snoop options include:

    Note Press Control-C to stop the snoop utility.

    snoop Summary output

    snoop -V Summary verbose output

    snoop -v Detailed verbose output

    snoop -ofilename Redirects the snooputility output tofilename in summary mode

    snoop -i filename Displays packets that were previouslycaptured in filename

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    32/788

    The Service Management Facility (SMF)

    1-6 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    The Service Management Facility (SMF)

    The SMF provides a centralized configuration structure for managingsystem services and the interaction of a service with other services. TheSMF includes the following:

    q A mechanism to establish and formalize dependency relationshipsbetween services.

    q Information on procedures to start, stop, and restart services.

    q A centralized repository for information on startup behavior andservice status.

    SMF Service

    A service can be described as an entity which provides a resource or list ofcapabilities to applications and other services, both local and remote. Aservice is not necessarily a running process, such as a web server. Aservice can also be the software state of a device, such as a configurednetwork device, or a mounted file system.

    A system can have more than one occurrence of a service running. Forexample, a system can have more than one configured network interface,or more than one mounted file system.

    Service Identifiers

    Each instance of a service within SMF has a name which is referred to as aservice identifier. This service identifier is in the form of a FaultManagement Resource Identifier or FMRI. The FMRI indicates the type ofservice or category, and the name and instance of the service.

    The service categories include the following:

    q application

    q device

    q legacy

    q milestone

    q network

    q platform

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    33/788

    The Service Management Facility (SMF)

    Describing Interface Configuration 1-7Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    q site

    q system

    An example of an FMRI for a service instance is:

    svc:/system/filesystem/root:default

    Where:

    q The svc indicates that this service is managed by SMF

    q The category of the service is system

    q The service itself is a filesystem

    q The instance of the service is the root file system

    q The default identifies the first, in this case only, instance of the

    service

    Another example of an FMRI for a service is:

    lrc:/etc/rc3_d/S90samba

    Where:

    q The lrc indicates that this service currently is not managed by SMF

    q The /etc/rc3_d refers to the /etc/rc3.d directory where there is

    a script used to manage this serviceq The S90samba is the name of the script

    Service States

    The svcs command can be used to list service identifiers and the state ofthe service instance. A service can be either enabled or disabled. Servicestates can include the following:

    q online

    q offline

    q disabled

    q legacy run

    q uninitialized

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    34/788

    The Service Management Facility (SMF)

    1-8 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    q maintenance

    q degraded

    Note For a complete description of service states, refer to man smf.

    Service instance names and the state of the service can be listed using thesvcs command.

    # svcs

    STATE STIME FMRI

    legacy_run 8:46:21 lrc:/etc/rcS_d/S10pfil

    legacy_run 8:46:22 lrc:/etc/rcS_d/S29wrsmcfg

    legacy_run 8:46:22 lrc:/etc/rcS_d/S55fdevattach

    legacy_run 8:46:33 lrc:/etc/rc2_d/S10lu

    legacy_run 8:46:33 lrc:/etc/rc2_d/S20sysetup

    legacy_run 8:46:33 lrc:/etc/rc2_d/S40llc2

    legacy_run 8:46:33 lrc:/etc/rc2_d/S42ncakmod

    legacy_run 8:46:33 lrc:/etc/rc2_d/S47pppd

    legacy_run 8:46:34 lrc:/etc/rc2_d/S65ipfboot

    legacy_run 8:46:34 lrc:/etc/rc2_d/S70sckm

    legacy_run 8:46:34 lrc:/etc/rc2_d/S70uucp

    legacy_run 8:46:34 lrc:/etc/rc2_d/S72autoinstall

    legacy_run 8:46:34 lrc:/etc/rc2_d/S72directory

    (output removed)

    online 8:46:25 svc:/system/filesystem/local:default

    online 8:46:26 svc:/network/inetd:default

    online 8:46:32 svc:/network/rpc/meta:tcp

    online 8:46:32 svc:/system/mdmonitor:default

    online 8:46:38 svc:/milestone/multi-user:default

    online 9:44:20 svc:/network/telnet:default

    maintenance 8:46:21 svc:/network/rpc/keyserv:default

    Milestones

    A milestone is a special type of service which is made up of a defined set

    of other services.

    A milestone can be regarded as a system state to reach. This system staterequires a defined set of services to be running. These services depend onother services being available. Hence, there is a hierarchy of dependencyrelationships. This is one of the core features managed by SMF.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    35/788

    The Service Management Facility (SMF)

    Describing Interface Configuration 1-9Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Currently there are three default milestones:

    q single-user

    q multi-user

    q multi-user-server

    The svc.startd Daemon

    The svc.startd daemon is the daemon which is responsible formaintaining the system services. It is the svc.startd daemon whichensures that the system boots to the appropriate milestone. If no milestoneis defined at boot up, the svc.startd daemon boots to the abstractmilestone all which encompasses all the system services.

    The svc.startd daemon can be referred to as the master restarterdaemon because it is responsible for ensuring the correct running,starting, and restarting of system services. The svc.startd daemon canobtain information about services from the repository.

    The svc.startd daemon might delegate responsibility for services toother delegated restarter daemons for example, the inetd daemon.

    As a sub-component of the SMF, the Internet daemon processes are mostlymanaged using the inetadm command. The Internet daemon processescan be listed using the following command:

    # inetadm

    ENABLED STATE FMRI

    enabled online svc:/network/rpc/gss:default

    enabled online svc:/network/rpc/mdcomm:default

    enabled online svc:/network/rpc/meta:default

    enabled online svc:/network/rpc/metamed:default

    enabled online svc:/network/rpc/metamh:default

    disabled disabled svc:/network/rpc/rex:default

    enabled online svc:/network/rpc/rstat:default

    enabled online svc:/network/rpc/rusers:default

    disabled disabled svc:/network/rpc/spray:defaultdisabled disabled svc:/network/rpc/wall:default

    (further output omitted>

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    36/788

    Configuring IPv4 Interfaces at Boot Time

    1-10 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Configuring IPv4 Interfaces at Boot Time

    This section describes the files and scripts involved with configuring IPv4network interfaces.

    Introducing IPv4 Interface Files

    You can get a basic understanding of network interfaces within theSolaris OS by learning the function of a few files and services. Theservices and files are the following:

    q The svc:/network/physical:default service

    q The /etc/hostname.xxn file

    q The /etc/inet/hosts file

    The svc:/network/physical:defaultService

    The svc:/network/physical:default service calls the/lib/svc/method/net-physical method script. It is one of thestartup scripts that runs each time you boot the system. This script usesthe ifconfig utility to configure each interface with an IP address andother required network information. The script searches for files calledhostname.xxn in the /etc directory, where xxis an interface type and nis the instance of the interface. For every file named /etc/hostname.xxn,

    the script uses the ifconfig command with the plumb option to make thekernel ready to talk to this type of interface. The script then configuresthe named interface using other options to the ifconfig command. The/etc/hostname.hme0file is an example of an interface configuration file.

    Note In Solaris 8 and 9 OS, the /etc/rcS.d/S30network.shfile is usedto perform the same function. Before Solaris 8 OS, the/etc/rcS.d/S30rootusr.shfile was used.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    37/788

    Configuring IPv4 Interfaces at Boot Time

    Describing Interface Configuration 1-11Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    The /etc/hostname.xxnFile

    The /etc/hostname.xxn file contains an entry that configures acorresponding interface. The variable component of the file name isreplaced by an interface type and a number that differentiates between

    multiple interfaces of the same type configured in the system. Table 1-1shows some examples.

    The codes for the interface types are product codes. These codes originatefrom varying sources. For example, the qfe code is an abbreviation forQuad Fast Ethernet.

    The /etc/hostname.hme0file contains either the host name or the IPaddress of the system that contains the hme0 interface. The host namecontained in the file must exist in the /etc/inet/hostsfile so that it can

    be resolved to an IP address at system boot time. You can edit the/etc/hostname.hme0file to contain either the host name or the IPaddress from the /etc/inet/hosts file.

    # cat /etc/hostname.hme0

    sys41

    or

    # cat /etc/hostname.hme0

    192.168.30.41

    Table 1-1 The /etc/hostname.xxn File Entries and CorrespondingInterfaces

    Entry Interface

    /etc/hostname.hme0 First hme Ethernet interface in the system

    /etc/hostname.hme1 Second hme Ethernet interface in the system

    /etc/hostname.qfe0 First qfe Ethernet interface in the system

    /etc/hostname.eri0 First eri Ethernet interface in the system

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    38/788

    Configuring IPv4 Interfaces at Boot Time

    1-12 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    The /etc/inet/hostsFile

    The /etc/inet/hosts file is a local database that associates the IPaddresses of hosts with their names. You can use the /etc/inet/hostsfile with, or instead of, other hosts databases, including the Domain Name

    System (DNS), the Network Information Service (NIS) hosts map, and theNetwork Information Service Plus (NIS+) hosts table. Programs uselibrary interfaces to access information in the /etc/inet/hosts file.

    The /etc/inet/hosts file contains at least the loopback and hostinformation. The file has one entry for each IP address of each host. If ahost has more than one IP address, this file will have one entry for eachaddress, on separate lines. The format of each line is:

    IP-address official-host-name [aliases] . . .

    Items are separated by any number of spaces or tab characters. The firstitem on a line is the hosts IP address. The second entry is the hostsofficial name. Subsequent entries on the same line are alternative namesfor the same machine, or nicknames. Nicknames are optional.

    # cat /etc/inet/hosts

    .

    < output truncated>

    .

    127.0.0.1 localhost

    .

    < output truncated>

    .

    192.168.30.41 sys41 loghost #connection to hme interface

    192.168.4.1 sys41-internal #connection to qfe interface

    .

    .

    Note The /etc/inet/hostsfile is the official (system V release 4) SVr4name of the hosts file. The symbolic link /etc/inet/hosts exists forBerkeley Software Distribution (BSD) compatibility.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    39/788

    Configuring IPv4 Interfaces at Boot Time

    Describing Interface Configuration 1-13Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    Changing the System Host Name

    The host name of a system is contained in three files on the system. Youmust modify all of these files, and perform a reboot, to successfullychange a systems host name. The files that contain the host name of a

    system are:

    q The /etc/nodename file

    q The /etc/hostname.xxn file

    q The /etc/inet/hosts file

    Note If crash dump is enabled on the system, the system name needs tobe changed under /var/crash. Older versions of Solaris also had thehostname in files located under /etc/net/tic*/*.

    Editing the/etc/nodenameFile

    Each Solaris OS has a canonical name, which is the official name usedwhen referring to a system. By convention, the system name is the sameas the host name associated with the IP address of the primary networkinterface; for example, hostname.hme0.

    The following example shows a systems /etc/nodename file:

    # cat /etc/nodenamesys41

    You can change the canonical name by editing the /etc/nodename file,and rebooting the system.

    If the machines network configuration is managed remotely anddelivered by the DHCP or remote procedure call (RPC) bootparamsprotocols, the /etc/nodenamefile is not used. The file is not used becausethe remote service delivers the canonical name.

    Editing the/etc/hostname.xxnFile

    The /etc/hostname.xxn file contains either the host name or the IPaddress of the system that contains the named interface.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    40/788

    Configuring IPv4 Interfaces at Boot Time

    1-14 Advanced System Administration for the Solaris 10 Operating SystemCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A

    Editing the/etc/inet/hostsFile

    Network addresses are written in the conventional decimal-dot notation.

    Host names are text strings up to 24 characters. Alphabetic characters,

    numbers, the (-) sign, and a (.) are allowed in the host name. Periods areonly allowed when they serve to delimit components of domain stylenames. Spaces are not allowed in the host name. The first character mustbe an alphabetic character. The last character must not be a (-) or a (.).

    No distinction is made between uppercase and lowercase characters,unless the NIS naming service is used. Uppercase characters in nameshave been known to cause problems with NIS.

    A (#) indicates the beginning of a comment. After a comment character, allcharacters, up to the end of the line, are not interpreted.

    The sys-unconfigCommand

    You can use the /usr/sbin/sys-unconfig command to undo a systemsconfiguration.

    You can use the /usr/sbin/sys-unconfig command to restore asystems configuration to an unconfigured state, ready to be reconfiguredagain.

    The sys-unconfig command does the following:

    q Saves the current /etc/inet/hosts file information in the/etc/inet/hosts.savedfile.

    q If the current /etc/vfstab file contains Network File System (NFS)mount entries, it saves the /etc/vfstab file to the/etc/vfstab.orig file.

    q Restores the default /etc/inet/hosts file.

    q Removes the default host name in the /etc/hostname.xxn files forall configured interfaces.

    q Removes the default domain name in the /etc/defaultdomainfile.

    q Restores the time zone to PST8PDT in the /etc/TIMEZONE file.

    q Resets naming services to local files.

    q Removes the /etc/inet/netmasksfile.

    q Removes the /etc/defaultrouterfile.

  • 8/14/2019 Advanced System Administration for the Solaris 10 Operating System

    41/788

    Configuring IPv4 Interfaces at Boot Time

    Describing Interface Configuration 1-15Copyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices, RevisionA

    q Removes the password set for the root user in the /etc/shadowfile.

    q Removes the /etc/.rootkey file for NIS+.

    q Executes all system configuration applications. These applicationsare defined by prior executions of a sysidconfig -a command.

    q Removes the /etc/resolv.conf file for DNS clients.q Disables Lightweight Directory Access Protocol (LDAP) by

    removing:

    q The /var/ldap/