student guide - sa-202-s10 advanced system administration forthe solaris

Upload: m4r4t

Post on 01-Jun-2018

279 views

Category:

Documents


10 download

TRANSCRIPT

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    1/794

    Sun Microsystems, Inc.UBRM05-104

    500 Eldorado Blvd.Broomfield, CO 80021

    U.S.A.

    Revision A.1

    StudentGuide

    Advanced System Administrationfor the Solaris 10Operating System

    SA-202-S10

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    2/794

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    3/794

    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.

    TheOPEN LOOK and SunGraphical User Interface wasdevelopedby SunMicrosystems, Inc. for itsusers andlicensees. Sunacknowledgesthe 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 controls as specified in the U.S. export laws. Youwill notuse or provide Products, 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/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    4/794

    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/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    5/794

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

    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

    Configuring IPv4 Interfaces at Boot Time ...................................... 1-6Introducing IPv4 Interface Files.............................................. 1-6Changing the System Host Name ......................................... 1-9

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

    Preparation............................................................................... 1-13Tasks ......................................................................................... 1-13

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

    Exercise: The Solaris OS Network Commands (Level 3) ........... 1-17Preparation............................................................................... 1-17Task Summary......................................................................... 1-17Tasks and Solutions ............................................................... 1-18

    Exercise Summary............................................................................ 1-20

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    6/794

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

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

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

    The Service Management Facility (SMF)........................................ 2-6SMF Service................................................................................ 2-6Service Identifiers..................................................................... 2-7Service States ............................................................................. 2-9Milestones ................................................................................ 2-10The svc.startd Daemon........................................................... 2-12The Service Configuration Repository................................. 2-12

    Starting Server Processes ................................................................ 2-14Introducing the Internet Service Daemon (inetd) ............2-14The Impact of SMF on Network Services........................... 2-17Introducing Network Ports .................................................. 2-19

    Starting Services That Use a Well-Known Port .................. 2-20Starting RPC Services ............................................................ 2-23Using the rpcinfoCommands ............................................ 2-26

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

    Preparation............................................................................... 2-29Tasks ......................................................................................... 2-29

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

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

    Exercise Summary............................................................................ 2-42

    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

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

    Management Console.......................................................... 3-18Adding Access to a Tool ........................................................ 3-34

    Performing the Exercises ................................................................ 3-57

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    7/794

    viiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA.1

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

    Exercise: Using the Solaris Management Console (Level 2)...... 3-59Preparation............................................................................... 3-59

    Task Summary......................................................................... 3-59Tasks ........................................................................................ 3-60Exercise: Using the Solaris Management Console (Level 3)...... 3-67

    Preparation............................................................................... 3-67Task Summary......................................................................... 3-67Tasks and Solutions ................................................................ 3-68

    Exercise Summary............................................................................ 3-75

    Managing Swap Configuration........................................................4-1Objectives ........................................................................................... 4-1Introducing Virtual Memory............................................................ 4-2

    Physical RAM ............................................................................ 4-2

    Swap Space ............................................................................... 4-3The swapfsFile 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-1

    Objectives ........................................................................................... 5-1Managing Crash Dump Behavior.................................................... 5-2

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

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    8/794

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

    Performing the Exercises ................................................................ 5-14Exercise: 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-16Preparation............................................................................... 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-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-6NFSv4......................................................................................... 6-7Managing an NFS Server ........................................................ 6-8The NFS Server Files................................................................. 6-8The NFS Server Daemons..................................................... 6-11Managing the NFS Server Daemons .................................... 6-14NFS Server Commands.......................................................... 6-16Configuringthe NFS Server for Sharing Resources........... 6-17

    Managing the NFS Client................................................................ 6-22NFS Client Files ....................................................................... 6-22NFS Client Daemons .............................................................. 6-23Managing the NFS Client Daemons.................................... 6-24NFS Client Commands........................................................... 6-25Configuring the NFS Client for Mounting Resources ....... 6-25

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

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

    Adding a Shared Directory on the NFS Server................... 6-36Mounting a Shared Directory on the NFS Client .............. 6-38

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    9/794

    ixCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA.1

    Troubleshooting NFS Errors .......................................................... 6-40The rpcbind failureError.................................................. 6-40The servernotrespondingError...................................... 6-41The NFS client fails a rebootError .......................... 6-41The service not respondingError.................................6-42

    Theprogram not registered

    Error.................................6-42The staleNFSfile handleError...................................... 6-43The unknown hostError ....................................................... 6-43The mountpointError .......................................................... 6-43The no such fileError...................................................... 6-44

    Performing the Exercises ................................................................ 6-45Exercise: Configuring NFS (Level 1) ............................................. 6-46

    Preparation............................................................................... 6-46Tasks ......................................................................................... 6-46

    Exercise: Configuring NFS (Level 2) ............................................. 6-48Preparation............................................................................... 6-48

    Task Summary......................................................................... 6-48Tasks ......................................................................................... 6-49Exercise: Configuring NFS (Level 3) ............................................. 6-52

    Preparation............................................................................... 6-52Task Summary......................................................................... 6-52Tasks and Solutions ................................................................ 6-53

    Exercise Summary............................................................................ 6-57

    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-7Adding Direct Map Entries ..................................................... 7-8Adding Indirect Map Entries ................................................ 7-11Updating the Automount Maps ........................................... 7-13Stopping and Starting the Automount System................... 7-15

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

    Preparation............................................................................... 7-18Tasks ......................................................................................... 7-18

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    10/794

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

    Exercise: Using the Automount Facility (Level 3)....................... 7-24Preparation............................................................................... 7-24Task Summary......................................................................... 7-24Tasks and Solutions................................................................ 7-25

    Exercise Summary............................................................................ 7-31

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

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

    Introducing Solaris Volume Manager Software Concepts ........ 8-19Logical Volume ....................................................................... 8-19Soft Partitions .......................................................................... 8-20Introducing the State Database ............................................. 8-21

    Introducing Hot Spares and Hot Spare Pools..................... 8-24

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

    Creating the State Database..................................................... 9-3Configuring RAID-0 ........................................................................ 9-14RAID-0 Striped Volumes ................................................................ 9-15

    Creating a RAID-0 Volume .................................................. 9-16Configuring RAID-1 ........................................................................ 9-29

    Building a Mirror of the Root (/) File System.............................. 9-31The 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-65

    Task Summary......................................................................... 9-66Tasks ......................................................................................... 9-66

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

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    11/794

    xiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA.1

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

    Key RBAC Files ....................................................................... 10-2Roles.......................................................................................... 10-3

    Assigning Rights Profiles To Users ..................................... 10-4Assigning Rights Profiles To Roles ..................................... 10-8Assigning Roles To Users ................................................... 10-11Using Roles ........................................................................... 10-12

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

    RBAC Configuration File Summary............................................ 10-19The /etc/user_attrFile.................................................... 10-19

    The /etc/security/prof_attrFile................................ 10-20The /etc/security/exec_attrFile................................ 10-22The /etc/security/auth_attrFile............................... 10-24

    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-61

    Task Summary....................................................................... 10-61Tasks ....................................................................................... 10-61Exercise: Configuring RBAC (Level 3)........................................ 10-65

    Preparation............................................................................. 10-65Task Summary....................................................................... 10-65Tasks and Solutions ............................................................. 10-66

    Exercise Summary.......................................................................... 10-72

    Configuring System Messaging....................................................11-1Objectives ......................................................................................... 11-1Introducing the syslogFunction.................................................. 11-2

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

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

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    12/794

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

    Monitoring a syslogFile in Real Time ............................. 11-16Adding One-Line Entries to a System Log File ............... 11-18

    Using the Solaris Management Console Log Viewer ............... 11-20Opening the Solaris Management Console Log

    Viewer.................................................................................. 11-20

    Viewing asyslog

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

    Log File ............................................................................... 11-25Displaying Management Tools Log Entry Details........... 11-27Backing Up Management Tools Log File ......................... 11-29

    Performing the Exercises .............................................................. 11-33Exercise: Using the syslogFunction and Auditing Utilities

    (Level 1) ........................................................................................ 11-34Preparation............................................................................. 11-34Tasks ....................................................................................... 11-34

    Exercise: Using the syslogFunction and Auditing Utilities(Level 2) ........................................................................................ 11-36Preparation............................................................................. 11-36Task Summary....................................................................... 11-36Tasks ....................................................................................... 11-37

    Exercise: Using the syslogFunction and Auditing Utilities(Level 3) ........................................................................................ 11-43

    Preparation............................................................................. 11-43Task Summary....................................................................... 11-43Tasks and Solutions.............................................................. 11-44

    Exercise Summary.......................................................................... 11-52

    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

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

    Retrieving Name Service Information ........................................ 12-20The getentCommand......................................................... 12-20Using the getentCommand ............................................. 12-21

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    13/794

    xiiiCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA.1

    Exercise: Reviewing Name Services............................................ 12-22Preparation............................................................................. 12-22Tasks ....................................................................................... 12-22Task Solutions....................................................................... 12-24

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

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

    Configuring the DNS Client During Installation ............... 13-2Editing DNS Client Configuration Files .............................. 13-5

    Setting Up an LDAP Client............................................................. 13-7Client Authentication ............................................................. 13-7Client Profile and Proxy Account......................................... 13-8Client Initialization ................................................................. 13-8Configuring the LDAP Client During Installation............ 13-9Initializing the Native LDAP Client................................... 13-12

    Copying the /etc/nsswitch.ldapFile to the /etc/nsswitch.confFile .......................................................... 13-14

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

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

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

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

    Preparation............................................................................. 13-19Task Summary....................................................................... 13-19Tasks ....................................................................................... 13-19

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

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

    Exercise Summary.......................................................................... 13-24

    Configuring the Network Information Service (NIS)....................14-1

    Objectives ......................................................................................... 14-1Introducing NIS Fundamentals ..................................................... 14-2

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

    Configuring 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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    14/794

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

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

    Configuring NIS Domain.............................................................. 14-16Generating NIS Maps ........................................................... 14-16

    Configuring the NIS Master Server.................................... 14-20Testing the NIS Service ........................................................ 14-23Configuring 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 MakefileFile........................................... 14-33

    Troubleshooting NIS ..................................................................... 14-38

    Troubleshooting NIS Server Failure Messages................. 14-38Troubleshooting NIS Client Failure Messages ................. 14-41Performing the Exercises .............................................................. 14-43Exercise: Configuring NIS (Level 1) ............................................ 14-44

    Preparation............................................................................. 14-44Tasks ....................................................................................... 14-45

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

    Exercise: Configuring NIS (Level 3) ............................................ 14-55

    Preparation............................................................................. 14-55Task Summary....................................................................... 14-56Tasks and Solutions............................................................. 14-57

    Exercise 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

    Zone Concepts.................................................................................. 15-5Zone Types............................................................................... 15-5Zone Daemons........................................................................ 15-7Zone File Systems ................................................................... 15-7Zone Networking.................................................................... 15-9Zone Command Scope ........................................................... 15-9Zone States ............................................................................. 15-10

    Configuring Zones......................................................................... 15-12

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    15/794

    xvCopyright 2005 SunMicrosystems, Inc. AllRightsReserved.SunServices,RevisionA.1

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

    Viewing the Zone Configuration File ................................ 15-19Using the zoneadm Command .....................................................15-20Verifying a Configured Zone .............................................. 15-20Installing a Configured Zone .............................................. 15-21Booting a Zone....................................................................... 15-21Halting a Zone....................................................................... 15-22Rebooting a Zone .................................................................. 15-22Logging Into and Working With the Zone........................ 15-22Deleting a Zone ..................................................................... 15-24

    Describing the Custom JumpStart Configurations.....................16-1Objectives ......................................................................................... 16-1

    Introducing JumpStart Configurations......................................... 16-2Purpose of JumpStart ............................................................. 16-2Boot Services............................................................................ 16-3Identification Services ............................................................ 16-5Configuration Services ........................................................... 16-7Installation Services ................................................................ 16-8

    Implementing a Basic JumpStart Server..................................... 16-11Spooling the Operating System Image .............................. 16-11Editing the sysidcfgFile.................................................... 16-13Running the check Script .................................................... 16-21Running the add_install_clientScript........................ 16-23Booting the JumpStart Client .............................................. 16-26Exercise: Configuring a Software Installation

    Procedure Using JumpStart.............................................. 16-26Task Preparation ................................................................... 16-26Task Summary....................................................................... 16-27Worksheet for Configuring a Software Installation

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

    Setting Up JumpStart Software Configuration Alternatives ... 16-34Introducing the JumpStart Client Boot Sequence ............ 16-35Setting Up a Boot-Only Server............................................ 16-42Setting Up Identification Service Alternatives ................. 16-46Setting Up Configuration Service Alternatives ................ 16-50Setting Up Installation Service Alternatives ..................... 16-63Troubleshooting JumpStart ................................................. 16-65Resolving Boot Problems..................................................... 16-65Resolving Identification Problems ..................................... 16-68

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    16/794

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

    Resolving Configuration Problems .................................... 16-70Resolving Installation Problems ......................................... 16-71Resolving Begin and Finish Script Problems .................... 16-72Identifying Log Files............................................................ 16-73

    Exercise: Configuring a Software Installation Procedure

    Using JumpStart to Create a RAID-1 Volume and Adda Patch During the JumpStart Process ..................................... 16-74Preparation............................................................................. 16-74Task Summary....................................................................... 16-74Worksheet for Configuring a Software Installation

    Procedure Using JumpStart Software............................. 16-75Tasks ...................................................................................... 16-76

    Exercise Summary.......................................................................... 16-82Configuring NIS for JumpStart Procedures............................... 16-83

    Performing a Flash Installation .................................................... 17-1Objectives ......................................................................................... 17-1

    Introducing the Flash Installation Feature ................................... 17-2Uses 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-7Administering a Flash Archive.......................................... 17-10

    Using a Flash Archive for Installation ........................................ 17-12Using a Flash Archive With JumpStart Software............ 17-20Locating the Installation Logs ............................................. 17-26Live Upgrade ......................................................................... 17-27WANboot ............................................................................... 17-27

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

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    17/794

    Preface-xxiCopyright2005 SunMicrosystems, Inc. AllRights Reserved.SunServices,Revision A.1

    Preface

    AboutThisCourse

    Course Goals

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

    Describe network basics

    Manage virtual file systems and core dumps

    Manage storage volumes

    Control access and configure system messaging

    Set up name services

    Perform advanced installation procedures

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    18/794

    Course Map

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

    Course Map

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    19/794

    Topics Not Covered

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

    Topics Not Covered

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

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

    The vieditor Covered in SA-100:UNIX Essentials Featuring theSolaris 10 Operating System

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

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

    Patch maintenance Covered in SA-200:Intermediate System

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

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

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

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

    Advanced file permissions Covered in SA-200:Intermediate System

    Administration for the Solaris 10 Operating System

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

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

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

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

    10 for Experienced System Administrators

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

    System tuning Covered in SA-400:Enterprise System PerformanceManagement

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    20/794

    Topics Not Covered

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

    Detailed shell programming Covered in SA-245:Shell Programmingfor System Administrators

    Detailed network administration concepts Covered inSA-300:Network Administration for the Solaris 10 Operating System

    Refer to the Sun Educational Services catalog for specific informationon course content and registration.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    21/794

    How PreparedAre You?

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

    How Prepared Are You?

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

    Can you install and boot the Solaris 10 Operating System(Solaris 10 OS) on a stand-alone workstation?

    Can you implement basic system security?

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

    Can you use the pkgaddcommand to add software packages?

    Can you monitor and mount file systems?

    Can you manage disk devices and processes?

    Can you perform backups and restorations?

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    22/794

    Introductions

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

    Introductions

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

    Name Company affiliation

    Title, function, and job responsibility

    Experience related to topics presented in this course

    Reasons for enrolling in this course

    Expectations for this course

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    23/794

    How to Use Course Materials

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

    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:

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

    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.

    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.

    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/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    24/794

    Conventions

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

    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.

    Power user Indicates additional supportive topics, ideas, or otheroptional information.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    25/794

    Conventions

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

    Typographical Conventions

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

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

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

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

    Courier italicsis used for variables and command-line placeholders

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

    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+rwxfilenameto grant read, write, and executerights forfilename.

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

    Read Chapter 6 in theUsers Guide.

    These are calledclassoptions.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    26/794

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    27/794

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

    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:

    Control and monitor network interfaces

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

    The course map in Figure 1-1 shows how this module fits into the currentinstructional goal.

    Figure 1-1 Course Map

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    28/794

    Controlling and Monitoring Network Interfaces

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

    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:

    Use the ifconfig -acommand

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

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

    # 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 MAC address is listed as 8:0:20:93:c9:afin this example.

    You can also retrieve the MAC address from a system that has not yetbeen booted by running the bannercommand at the okprompt.

    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/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    29/794

    Controlling and Monitoring Network Interfaces

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

    Displaying the IP Address

    The ifconfig -acommand displays the current configuration for thenetwork interfaces.

    With the -aoption, the ifconfigcommand 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 of127.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 ifconfigcommand 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 UPflag for hme0is no longer present. When an interface isflagged as UP, it is ready to communicate.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    30/794

    Controlling and Monitoring Network Interfaces

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

    The following example shows that when you mark an interface as up, theUPstatus appears in the flags field of the ifconfigcommand 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 pingcommand:

    #ping sys41sys41 is alive

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

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

    The interface must be plumbed.

    The interface must be configured.

    The interface must be up.

    The interface must be physically connected.

    The interface must have valid routes configured.

    For more information on ifconfigand plumbed, see the ifconfigmanpage.

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    31/794

    Controlling and Monitoring Network Interfaces

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

    Capturing and Inspecting Network Packets

    You can use the snooputility to capture and inspect network packets todetermine what kind of data is transferred between systems. You can usethe snooputility 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 -aoption 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 snoopoptions include:

    Note Press Control-C to stop the snooputility.

    snoop Summary output

    snoop -V Summary verbose output

    snoop -v Detailed verbose output

    snoop -ofilename Redirects the snooputility output tofilenamein summary mode

    snoop-i filename Displays packets that were previouslycaptured infilename

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    32/794

    Configuring IPv4 Interfaces at Boot Time

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

    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:

    The svc:/network/physical:defaultservice

    The /etc/hostname.xxnfile

    The /etc/inet/hostsfile

    The svc:/network/physical:defaultService

    The svc:/network/physical:defaultservice calls the/lib/svc/method/net-physicalmethod script. It is one of thestartup scripts that runs each time you boot the system. This script usesthe ifconfigutility to configure each interface with an IP address andother required network information. The script searches for files calledhostname.xxnin the /etcdirectory, wherexxis an interface type andnis the instance of the interface. For every file named /etc/hostname.xxn,

    the script uses the ifconfig command with the plumb option to make thekernelready to talk to this type of interface. The script then configuresthe named interface using other options to the ifconfigcommand. 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/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    33/794

    Configuring IPv4 Interfaces at Boot Time

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

    The /etc/hostname.xxnFile

    The /etc/hostname.xxnfile 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 qfecode is an abbreviation forQuad Fast Ethernet.

    The /etc/hostname.hme0file contains either the host name or the IPaddress of the system that contains the hme0interface. 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/hostsfile.

    # cat /etc/hostname.hme0

    sys41

    or

    # cat /etc/hostname.hme0

    192.168.30.41

    Table 1-1 The /etc/hostname.xxnFile Entries and CorrespondingInterfaces

    Entry Interface

    /etc/hostname.hme0 First hmeEthernet interface in the system

    /etc/hostname.hme1 Second hmeEthernet interface in the system

    /etc/hostname.qfe0 First qfeEthernet interface in the system

    /etc/hostname.eri0 First eriEthernet interface in the system

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    34/794

    Configuring IPv4 Interfaces at Boot Time

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

    The /etc/inet/hostsFile

    The /etc/inet/hostsfile 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/hostsfile.

    The /etc/inet/hostsfile 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 hostsfile. The symbolic link /etc/inet/hostsexists forBerkeley Software Distribution (BSD) compatibility.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    35/794

    Configuring IPv4 Interfaces at Boot Time

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

    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:

    The /etc/nodenamefile

    The /etc/hostname.xxnfile

    The /etc/inet/hostsfile

    Note If crash dump is enabled on the system, the system name needs tobe changed under /var/crash. Older versions of Solaris also had thehostnamein 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/nodenamefile:

    # cat /etc/nodenamesys41

    You can change the canonical name by editing the /etc/nodenamefile,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.xxnfile contains either the host name or the IPaddress of the system that contains the named interface.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    36/794

    Configuring IPv4 Interfaces at Boot Time

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

    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.

    Editing the/etc/inet/ipnodesFile

    The ipnodesfile is a local database that associates the names of nodeswith their Internet Protocol (IP) addresses. The ipnodesfile is populatedwith IPv4 addresses and host names during installation. If an attempt tochange the system IP address is made by editing the /etc/inet/hostsfile and the system is then rebooted, the IP address will NOT be changed.

    The sys-unconfigCommand

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

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

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    37/794

    Configuring IPv4 Interfaces at Boot Time

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

    The sys-unconfigcommand does the following:

    Saves the current /etc/inet/hostsfile information in the/etc/inet/hosts.savedfile.

    If the current /etc/vfstabfile contains Network File System (NFS)

    mount entries, it saves the /etc/vfstabfile to the/etc/vfstab.origfile.

    Restores the default /etc/inet/hostsfile.

    Removes the default host name in the /etc/hostname.xxnfiles forall configured interfaces.

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

    Restores the time zone to PST8PDTin the /etc/TIMEZONEfile.

    Resets naming services to local files.

    Removes the/etc/inet/netmasks

    file. Removes the /etc/defaultrouterfile.

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

    Removes the /etc/.rootkeyfile for NIS+.

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

    Removes the /etc/resolv.conffile for DNS clients.

    Disables Lightweight Directory Access Protocol (LDAP) byremoving:

    The /var/ldap/ldap_client_cachefile

    The /var/ldap/ldap_client_filefile

    The /var/ldap/ldap_client_credfile

    The /var/ldap/cachemgr.logfile

    Regenerates keys for the Secure Shell Daemon (sshd).

    When the sys-unconfigcommand is finished, it performs a systemshutdown. The sys-unconfig command is a potentially dangerous utility

    and can only be run by the rootuser.

    When you restart the system, a configuration script prompts you toconfigure the system information. The sys-unconfigcommand is notavailable on diskless clients.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    38/794

    Performing the Exercises

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

    Performing the Exercises

    You have the option to complete any one of three versions of a lab. Todecide which to choose, consult the following descriptions of the levels:

    Level 1 This version of the lab provides the least amount ofguidance. Each bulleted paragraph provides a task description, butyou must determine your own way of accomplishing each task.

    Level 2 This version of the lab provides more guidance. Althougheach step describes what you should do, you must determine whichcommands (and options) to input.

    Level 3 This version of the lab is the easiest to accomplish becauseeach step provides exactly what you should input to the system. Thislevel also includes the task solutions for all three levels.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    39/794

    Exercise: The Solaris OS Network Commands (Level 1)

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

    Exercise: The Solaris OS Network Commands (Level 1)

    In this exercise, you use basic network-related commands.

    Preparation

    To prepare for this exercise, perform the following tasks:

    Check that you have two systems listed in each /etc/inet/hostsfile on each system.

    Work with a partner for this exercise, and perform all steps on bothsystems, unless noted otherwise.

    Tasks

    Complete the following steps:

    Note Be sure to work closely with your partner during the lab to ensureyou are both working on the same steps.

    Allow the snooputility to run through this exercise.

    Use the ifconfig -acommand to list the IP address, Ethernet

    address, netmask, and current status of your primary networkinterface. Record this information. Start a snoopsession on bothsystems, and monitor the output.

    Use the ping command to contact your partners system, and recordthe snoopoutput. On one system, mark the primary interface asdown. Record the new ifconfigoutput for this interface. Use thepingcommand to contact that host, and record related snoopoutput.

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    40/794

    Exercise: The Solaris OS Network Commands (Level 2)

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

    Exercise: The Solaris OS Network Commands (Level 2)

    In this exercise, you use basic network-related commands.

    Preparation

    To prepare for this exercise, perform the following tasks:

    Check that you have two systems listed in each /etc/inet/hostsfile on each system.

    Work with a partner for this exercise, and perform all steps on bothsystems, unless noted otherwise.

    Task Summary

    Perform the following tasks:

    Allow the snooputility to run through this exercise.

    Use the ifconfig -acommand to list the IP address, Ethernetaddress, netmask, and current status of your primary networkinterface. Record this information. Start a snoopsession on bothsystems, and monitor the output.

    Use the ping command to contact your partners system, and record

    the snoopoutput. On one system, mark the primary interface asdown. Record the new ifconfigoutput for this interface. Use theping command to contact that host, and record related snoop outputincluding:

    How many requests the pingcommand makes

    What the pingcommand requests have in common

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    41/794

    Exercise: The Solaris OS Network Commands (Level 2)

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

    Tasks

    Complete the following steps using the ifconfigutility, the pingcommand, and the snooputility.

    Note Be sure to work closely with your partner during the lab to ensureyou are both working on the same steps.

    1. On both systems, log in as the rootuser, and open a terminalwindow. Using the ifconfig -acommand, display basicconfiguration information about your network interfaces.

    For your primary interface (usually hme0), what does the ifconfigcommand report for the following attributes? Enter your values intoTable 1-2.

    2. On both systems, open a new terminal window. In the new window,enter the snoopcommand to display the network traffic betweenyour two systems only.

    3. Use the pingcommand to verify that your system can contact thenetwork interface on your partners system.

    4. Observe the output from the snoopcommand. Which protocol doesthe pingcommand use?

    Does the snoopoutput contain requests and replies (yes or no)?

    Requests: Replies:

    5. On one system, use the ifconfigcommand to mark its primaryinterface as down and then again to display its configurationinformation.

    Has anything changed in the information that the ifconfigcommand reports?

    ________________________________________________

    Table 1-2 Primary Interface Values

    Attribute Value

    IP address

    Ethernet address

    Interface up/down

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    42/794

    Exercise: The Solaris OS Network Commands (Level 2)

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

    6. On the system whose interface remains up, attempt to use the pingcommand to contact the system whose interface is down.

    What does the pingcommand report?

    ________________________________________________

    7. Observe the output from the snooputility on both systems. Howdoes the snoop output differ from the ping command output beforeand after you marked the interface as down?

    How many requests does the pingcommand send by default?

    ________________________________________________

    Does the target system see the pingcommand requests? If so, howare these requests handled?

    ________________________________________________

    8. On the system whose interface is down, use the ifconfig commandto mark its primary interface as up. Check that the change tookplace.

    9. On the system whose interface remained up, use the ping commandto contact the other system.

    What does the pingcommand report?

    ________________________________________________

    Does the snooputility report a reply from the target host?

    ________________________________________________

  • 8/9/2019 Student Guide - SA-202-S10 Advanced System Administration Forthe Solaris

    43/794

    Exercise: The Solaris OS Network Commands (Level 3)

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

    Exercise: The Solaris OS Network Commands (Level 3)

    In this exercise, you use basic network-related commands.

    Preparation

    To prepare for this exercise, perform the following tasks:

    Check that you have two systems listed in each /etc/inet/hostsfile on each system.

    Work with a partner for this exercise, and perform all steps on bothsystem