• No results found

D90758GC10_ag1

N/A
N/A
Protected

Academic year: 2021

Share "D90758GC10_ag1"

Copied!
282
0
0

Loading.... (view fulltext now)

Full text

(1)Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Oracle Linux 7: Advanced Administration Activity Guide – Volume I D90758GC10 Edition 1.0 | September 2015 | D92967. Learn more from Oracle University at oracle.com/education/. a.

(2) Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent Author l i Craig McBride nim Stu u o@ e this Technical Contributors and Reviewers rs coHaraldo Van usBreederode, Joel Goodman, Manish ฺ Avi Miller, Elena Zannoni, Wim Coekaerts, n t a Kapur, Yasar Akthar, AntoinettejO’Sullivan, ( u nseGavin Bowe, Steve Miller, Herbert Van Den Bergh, s Todd Vierling and John Haxby ria e lice a o abl s r co published er using: Oracle Tutor f s n This book was jua -tran non Trademark Notice. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners..

(3) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Table of Contents Practices for Lesson 1: Course Introduction ........................................................................................... 1-1 Course Practice Environment: Security Credentials.................................................................................. 1-2 Practices for Lesson 1: Overview............................................................................................................. 1-3 Practice 1-1: Exploring the dom0 Environment ......................................................................................... 1-4 Practice 1-2: Starting, Stopping, and Listing VM Guests ........................................................................... 1-11 Practice 1-3: Exploring the host01 VM ..................................................................................................... 1-13 Practice 1-4: Exploring the host02 VM ..................................................................................................... 1-17 Practice 1-5: Exploring the host03 VM ..................................................................................................... 1-20 Practice 1-6: Logging Off from Your Student PC ...................................................................................... 1-22 Practices for Lesson 2: Network Addressing and Name Services .......................................................... 2-1 Practices for Lesson 2: Overview............................................................................................................. 2-2 Practice 2-1: Configuring a DHCP Server................................................................................................. 2-3 Practice 2-2: Configuring a DHCP Client .................................................................................................. 2-6 Practice 2-3: Viewing and Testing the DNS Configuration......................................................................... 2-9 Practice 2-4: Configuring a Caching-Only Nameserver ............................................................................. 2-16. a s a h 3-1 ) Practices for Lesson 3: Authentication and Directory Services .............................................................. o c ideฺ3-2 ฺ u Practices for Lesson 3: Overview............................................................................................................. d Gu e ฺ r Practice 3-1: Configuring an OpenLDAP Server ....................................................................................... 3-3 ita dent l i Practice 3-2: Implementing OpenLDAP Authentication ............................................................................. 3-21 nim Stu Practice 3-3: Authenticating from an OpenLDAP Client ............................................................................ 3-26 u s i @ Practices for Lesson 4: Pluggable Authentication Modules ......................................................... 4-1 o (PAM) th s r e o Practices for Lesson 4: Overview............................................................................................................. 4-2 us ฺc to........................................................................ n Practice 4-1: Configuring PAM for a Single Login Session 4-3 a (ju Non-root seLogin......................................................................... 4-8 Practice 4-2: Configuring PAM tosPrevent n e ia EmaillServices rand ic ..................................................................................... 5-1 Practices for Lesson 5: Web a e l so5: Overview Practices for Lesson r rab............................................................................................................. 5-2 o Practice 5-1:cConfiguringfe the Apache Web Server .................................................................................... 5-3 n ans juafor Lesson Practices tr 6: Installing Oracle Linux 7 by Using Kickstart...................................................... 6-1 n Practices nofor Lesson 6: Overview............................................................................................................. 6-2 Practice 6-1: Performing a Kickstart Installation........................................................................................ 6-3 Practice 6-2: Using Rescue Mode............................................................................................................ 6-14 Practices for Lesson 7: Samba Services.................................................................................................. 7-1 Practices for Lesson 7: Overview............................................................................................................. 7-2 Practice 7-1: Configuring a Samba Server ............................................................................................... 7-3 Practice 7-2: Accessing Samba Shares from a Client Host ....................................................................... 7-8 Practice 7-3: Accessing a Linux Samba Share from a Windows System ................................................... 7-12 Practices for Lesson 8: Advanced Software Package Management........................................................ 8-1 Practices for Lesson 8: Overview............................................................................................................. 8-2 Practice 8-1: Exploring the host04 VM ..................................................................................................... 8-3 Practice 8-2: Managing Yum Plug-Ins ...................................................................................................... 8-9 Practice 8-3: Using Yum Utilities .............................................................................................................. 8-16 Practice 8-4: Creating an RPM Package .................................................................................................. 8-22 Practice 8-5: Managing Software Updates with PackageKit ...................................................................... 8-31 Practice 8-6: Working with Yum History and Yum Cache .......................................................................... 8-39 Practices for Lesson 9: Advanced Storage Administration ..................................................................... 9-1 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Oracle Linux 7: Advanced Administration Table of Contents i.

(4) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Practices for Lesson 9: Overview............................................................................................................. 9-2 Practice 9-1: Creating and Mounting a File System .................................................................................. 9-3 Practice 9-2: Implementing Access Control Lists ...................................................................................... 9-6 Practice 9-3: Setting Disk Quotas ............................................................................................................ 9-9 Practice 9-4: Encrypting a File System ..................................................................................................... 9-13 Practice 9-5: Using kpartx ....................................................................................................................... 9-16 Practice 9-6: Exploring and Configuring Udev .......................................................................................... 9-20 Practices for Lesson 10: Advanced Networking ...................................................................................... 10-1 Practices for Lesson 10: Overview ........................................................................................................... 10-2 Practice 10-1: Configuring Network Bonding by Using the GUI ................................................................. 10-3 Practice 10-2: Configuring Network Bonding from the Command Line....................................................... 10-21 Practice 10-3: Working with Bonded Interfaces ........................................................................................ 10-26 Practice 10-4: Configuring 802.1Q VLAN Tagging by Using the GUI ......................................................... 10-37 Practice 10-5: Configuring 802.1Q VLAN Tagging from the Command Line .............................................. 10-46 Practice 10-6: Working with VLAN Interfaces ........................................................................................... 10-49 Practice 10-7: Configuring a Site-to-Site VPN .......................................................................................... 10-58. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n t ua s..................................................................................... e j Practices for Lesson 12: iSCSI and Multipathing 12-1 ( n s e a Practices for Lesson 12: Overview ........................................................................................................... 12-2 i c li (Target)................................................................................. 12-3 aanr iSCSIleServer Practice 12-1: Configuring o b Client (Initiator)................................................................................. 12-14 rs eanraiSCSI oConfiguring Practice 12-2: c f Practice ns iSCSI Multipathing .......................................................................................... 12-21 an12-3:tConfiguring a u j r - 13: Control Groups (Cgroups)................................................................................ 13-1 Practices for Lesson nonfor Lesson 13: Overview........................................................................................................... 13-2 Practices. Practices for Lesson 11: OCFS2 and Oracle Clusterware........................................................................ 11-1 Practices for Lesson 11: Overview ........................................................................................................... 11-2 Practice 11-1: Preparing for an OCFS2 Configuration............................................................................... 11-3 Practice 11-2: Verifying that the Required Software Is Installed ................................................................ 11-9 Practice 11-3: Configuring the Cluster Layout .......................................................................................... 11-10 Practice 11-4: Configuring and Starting the O2CB Cluster Stack Service .................................................. 11-14 Practice 11-5: Creating an OCFS2 Volume .............................................................................................. 11-17 Practice 11-6: Mounting an OCFS2 Volume ............................................................................................. 11-21 Practice 11-7: Tuning and Debugging OCFS2.......................................................................................... 11-26. Practice 13-1: Exploring cgroup Integration Into systemd.......................................................................... 13-3 Practice 13-2: Exploring cgroup Hierarchies and cgroup Subsystem Parameters ...................................... 13-10 Practice 13-3: Controlling Access to System Resources ........................................................................... 13-15 Practices for Lesson 14: Virtualization with Linux................................................................................... 14-1 Practices for Lesson 14: Overview ........................................................................................................... 14-2 Practice 14-1: Preparing the Virtualization Host for KVM .......................................................................... 14-3 Practice 14-2: Starting the Virtual Machine Manager and Preparing to Create a Virtual Machine................ 14-9 Practice 14-3: Creating a Virtual Machine ................................................................................................ 14-22 Practice 14-4: Managing Your Virtual Machine ......................................................................................... 14-36 Practices for Lesson 15: Linux Containers (LXC) .................................................................................... 15-1 Practices for Lesson 15: Overview ........................................................................................................... 15-2 Practice 15-1: Completing Linux Container Prerequisites.......................................................................... 15-3 Practice 15-2: Creating an Oracle Linux Container ................................................................................... 15-7 Practice 15-3: Using lxc Commands ........................................................................................................ 15-11 Practices for Lesson 16: Docker .............................................................................................................. 16-1 Practices for Lesson 16: Overview ........................................................................................................... 16-2 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Oracle Linux 7: Advanced Administration Table of Contents ii.

(5) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Practice 16-1: Using sftp to Upload Docker Package and Images ............................................................. 16-3 Practice 16-2: Installing and Configuring Docker ...................................................................................... 16-5 Practice 16-3: Using Docker Commands.................................................................................................. 16-9 Practice for Lesson 17: Security Enhanced Linux (SELinux) .................................................................. 17-1 Practice for Lesson 17: Overview ............................................................................................................ 17-2 Practice 17-1: Exploring SELinux............................................................................................................. 17-3 Practice 17-2: Configuring an SELinux Boolean ....................................................................................... 17-11 Practice 17-3: Configuring SELinux Context ............................................................................................. 17-15 Practices for Lesson 18: Core Dump Analysis......................................................................................... 18-1 Practices for Lesson 18: Overview ........................................................................................................... 18-2 Practice 18-1: Configuring Kdump ........................................................................................................... 18-3 Practice 18-2: Creating a Core Dump File ................................................................................................ 18-12 Practice 18-3: Preparing Your System to Analyze the vmcore................................................................... 18-14 Practice 18-4: Using the crash Utility........................................................................................................ 18-16 Practices for Lesson 19: Dynamic Tracing with DTrace .......................................................................... 19-1 Practices for Lesson 19: Overview ........................................................................................................... 19-2 Practice 19-1: Using sftp to Upload DTrace Packages .............................................................................. 19-3 Practice 19-2: Installing the DTrace Packages ......................................................................................... 19-8 Practice 19-3: Using DTrace from the Command Line .............................................................................. 19-12 Practice 19-4: Creating and Running D Scripts......................................................................................... 19-20. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ta ent i l i Appendix - NIS Configuration................................................................................................................... 20-1 nim Stud Appendix - Overview ............................................................................................................................... 20-2 u s i @ h Practice A-1: Configuring an NIS Server .................................................................................................. 20-3 o rs se t o Practice A-2: Configuring an NIS Client.................................................................................................... 20-9 c u ฺ........................................................................................ n o Practice A-3: Implementing NIS Authentication 20-11 t a (ju.................................................................................................. se Practice A-4: Testing NIS Authentication 20-15 n s e a i c Practice A-5: Auto-Mounting a User Home li Directory ................................................................................ 20-17 arSystems e l o Practice A-6: Restoring the to s rab Their Original State...................................................................... 20-20 r o c Access Appendixes: Remote fe Options...................................................................................................... 21-1 s n n a Appendixes: Overview............................................................................................................................. 21-2 ju -tra Appendix n an NX Client to Connect to dom0................................................................................ 21-3 no A:B: Using Appendix Using an NX Player to Connect to dom0............................................................................... 21-7 Appendix C: Using VNC (TightVNC) to Connect Directly to VM Guests ..................................................... 21-13 Appendix D: Using NoMachine Version 4 to Connect to dom0 .................................................................. 21-16. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Oracle Linux 7: Advanced Administration Table of Contents iii.

(6) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. a.

(7) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. s a h o) eฺ c ฺ du Guid e ฺ r t 1: Practices lfor n ita Lesson e i Course Introduction tud nim S u o@ 1 this s Chapter e r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 1. a.

(8) Course Practice Environment: Security Credentials. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. For OS usernames and passwords, see the following: •. If you are attending a classroom-based or live virtual class, ask your instructor or LVC producer for OS credential information.. •. If you are using a self-study format, refer to the communication that you received from Oracle University for this course.. For product-specific credentials used in this course, see the following table: Product-Specific Credentials Virtual Machines/Application. Username. Password. host01/OS. root. oracle. host01/OS. oracle. oracle. s a h host02/OS root oracle o) eฺ c ฺ host02/OS oracle oracle du Guid e ฺ r host03/OS root nt ita doracle l e i m tu oracle host03/OS oracle uni S s i @ h o rs se t o c u ฺ n o t a (ju nse s ria e lice a o abl s r co sfer n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 2. a.

(9) Practices for Lesson 1: Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Practices Overview In these practices, you will: • Log in to your classroom PC and become familiar with the Oracle VM Server for x86 environment installed on your classroom PC • Connect to the virtual machines used for the hands-on practices and become familiar with the VM guest configurations. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 3. a.

(10) Practice 1-1: Exploring the dom0 Environment Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. In this practice, you explore the dom0 configuration and directory structure.. Assumptions • •. Your instructor has assigned a student PC to you. Your student PC is running Oracle VM Server for x86 version 3.2.1.. •. You are logged in to your student PC as vncuser with the password vnctech.. • •. The GNOME desktop is installed on dom0. There are three guests (virtual machines): host01, host02, and host03.. •. All guest VMs have Oracle Linux 7 installed.. Tasks 1.. s a Open a terminal window. h o) in theeฺ c • Begin this task from the dom0 GNOME virtual desktop window as shown ฺ du Guid following screenshot: e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Double-click the Terminal icon on the GNOME desktop. • A terminal window opens.. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 4. a.

(11) 2.. Become the root user.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. Enter the commands from an open terminal window as shown in the following screenshot:. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n t a u e j ( s Become the root user by The root password is oracle. s usingicthe ensuthe- command. a i r l Confirm that you are root by printing user identity with the whoami command: a le o $ su o–rs ferab c n ans oracle juaPassword: tr #nwhoami noroot 3.. a. Determine the operating system that is running on dom0. Use the uname –a command to display the operating system version. # uname –a Linux edddr20p1 2.6.39-300.22.2.el5uek #1 SMP Fri Jan 4 12:40:29 PST 2013 x86_64 x86_64 x86_64 GNU/Linux • In this example, the operating system is Linux. •. The Linux kernel is 2.6.39-300.22.2.el5uek.. •. The host name is edddr20p1. (Your host name is different.). Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 5.

(12) 4.. Determine the network configuration of dom0. Use the ifconfig –a command to display the network configuration. Only partial output is shown.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. # ifconfig -a ... bond0. Link encap:Ethernet ... inet addr:10.150.30.83 .... ... eth0 ... lo ... vif... ... virbr0. Link encap:Ethernet ... Link encap:Local Loopback ... inet addr:127.0.0.1 .... a s a h ) o c ideฺ ฺ u Link encap:Ethernet ... d Gu e ฺ r inet addr:192.0.2.1 ... ta ent i l i ... im Stud n u virbr1 Link encap:Ethernet ... [email protected] this s inet addr:192.168.1.1 r co o us ฺ ... n ua se t ... j virbr2 Link encap:Ethernet ( saddr:192.168.2.1 en a i inet ... c r i l a e l ... rso rabencap:Ethernet ... o fLink c e virbr3 s n jua -tran inet addr:192.168.3.1 ... n n•o... In this example, the network interface for dom0 is bond0 and is assigned an IP Link encap:Ethernet .... address of 10.150.30.83. The IP address of your system is different.. •. The lo interface is a software loopback interface that identifies the localhost. It is always assigned an IP address of 127.0.0.1.. •. The virbr0 interface is a xen bridge interface used by VM guests. It is assigned an IP address of 192.0.2.1.. •. The virbr1 interface is a second xen bridge interface used by VM guests. It is assigned an IP address of 192.168.1.1.. •. The virbr2 interface is a third xen bridge interface used by VM guests. It is assigned an IP address of 192.168.2.1.. •. The virbr3 interface is a fourth xen bridge interface used by VM guests. It is assigned an IP address of 192.168.3.1.. •. You also notice vif<#>.<#> entries. These are virtual interfaces that are tied to the VM/domU IDs. You can get the VM/domU IDs from the xm list command, which you run later in this practice. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 6.

(13) 5.. Explore the /OVS directory structure on dom0.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. a.. Explore the top level of the /OVS directory. (Only partial output is shown.) # ls –l /OVS drwxrwxrwx ... iso_pool drwxrwxrwx ... publish_pool drwxrwxrwx ... running_pool drwxrwxrwx ... seed_pool drwxrwxrwx ... sharedDisk • There are five directories in the /OVS directory.. b.. Explore the /OVS/runing_pool directory: # cd /OVS/running_pool # ls –l drwxr-xr-x ... host01 drwxr-xr-x ... host02 drwxr-xr-x ... host03 drwxr-xr-x ... host04 drwxr-xr-x ... host05 drwxr-xr-x ... vpn-host1 drwxr-xr-x ... vpn-host2 • The files needed to create the VMs are in separate directories in the /OVS/running_pool directory.. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n uasevenseVMt directories exist, for VMs host01, host02, j ( • This example shows that shost05,icvpn-host1, en a i host03, host04, and vpn-host2. r l a le o • Therhost04 bis preconfigured with access to Oracle’s Public Yum Server. This ra oissusedfeinVM c VM “Practices for Lesson 8: Advanced Software Package Management.” s n ahost05 n VM has the virtualization package groups installed. This VM is used in jua• The r t n “Practices for 14: Virtualization with Linux.” n•o The “vpn” VMsLesson are used in “Practice 10-7: Configuring a Site-to-Site Virtual Private Network (VPN).”. c.. Explore the host01 VM directory. # cd /OVS/running_pool/host01 # ls –l -rw-r--r-- ... system.img -rw-r--r-- ... u01.img -rw-r--r-- ... u02.img -rwxr-xr-x ... vm.cfg • The system.img file is the operating system virtual disk. • •. The u01.img and u02.img files are utility virtual disks that are used in various practices in this course. The vm.cfg file is the configuration file for the virtual machine. This file is read when the virtual machine is created. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 7.

(14) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. d.. View the vm.cfg file. # cat vm.cfg name = ‘host01’ builder = ‘hvm’ memory = 1536 boot = ‘cd’ disk = [ ‘file:/OVS/running_pool/host01/system.img,xvda,w’, ‘file:/OVS/running_pool/host01/u01.img,xvdb,w’, ‘file:/OVS/running_pool/host01/u02.img,xvdd,w’, ‘file:/OVS/seed_pool/OracleLinux-R7-U1-Server-x86_64dvd.iso,xvdc:cdrom,r’] vif = [ ‘mac=00:16:3e:00:01:01, bridge=virbr0’, ‘mac=00:16:3e:00:02:01, bridge=virbr1’, ‘mac=00:16:3e:00:03:01, bridge=virbr2’, ‘mac=00:16:3e:00:04:01, bridge=virbr3’] device_model = ‘/usr/lib/xen/bin/qemu-dm’ kernel = ‘/usr/lib/xen/boot/hvmloader’ vnc = 1 vncunused=1 vcpus = 1 timer_mode = 0 apic = 1 acpi = 1 pae = 1 serial = ‘pty’ on_reboot = ‘restart’ on_crash = ‘restart’ usb = 1 usbdevice = 'tablet' • Note that there are three virtual disks represented by the three .img files.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. a. •. Note that the Oracle Linux dvd.iso is mounted on a virtual CD ROM device.. •. Note that there are four virtual network interfaces. The interface on the virbr0 bridge is eth0, the interface on the virbr1 bridge is eth1, the interface on the virbr2 bridge is eth3, and the interface on the virbr3 bridge is eth4.. e.. Explore the /OVS/sharedDisk directory: # cd /OVS/sharedDisk # ls –l -rw-r--r-- ... physDisk1.img •. The physDisk1.img file is used as a shared disk (shared by all VM guests) in “Practices for Lesson 11: OCFS2 and Oracle Clusterware.”. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 8.

(15) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. f.. Explore the /OVS/seed_pool directory: # cd /OVS/seed_pool # ls –l drwxr-xr-x ... debug drwxr-xr-x ... dtrace_rpms drwxr-xr-x ... host07 -rw-r--r-- ... OracleLinux-R7-U1-Server-x86_64-dvd.iso -rw-r--r-- ... physDisk1.tgz drwxr-xr-x ... sfws -rw-r--r-- ... system01.tgz -rw-r--r-- ... system02.tgz -rw-r--r-- ... system03.tgz -rw-r--r-- ... system04.tgz -rw-r--r-- ... system05.tgz -rw-r--r-- ... u01_01.tgz -rw-r--r-- ... u01_03.tgz -rw-r--r-- ... u02_01.tgz -rw-r--r-- ... u02_02.tgz -rw-r--r-- ... u02_03.tgz -rw-r--r-- ... u03_02.tgz -rwxr-xr-x ... vm01.cfg -rwxr-xr-x ... vm02.cfg -rwxr-xr-x ... vm03.cfg -rwxr-xr-x ... vm04.cfg -rwxr-xr-x ... vm05.cfg -rwxr-xr-x ... vmvpn1.cfg -rwxr-xr-x ... vmvpn2.cfg -rw-r--r-- ... vpn-host1.tgz -rw-r--r-- ... vpn-host2.tgz • This directory contains many files that are used to create the initial environment. • Oracle Linux 7.1 is installed on the host01, host02, and host03 VMs from the OracleLinux-R7-U1-Server-x86_64-dvd.iso file in this directory.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. •. Other files in this directory are used in various practices.. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 9. a.

(16) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. g.. Explore the /var/www/html/repo/OracleLinux/OL7/1/x86_64 directory: •. Your system is configured as a local Yum repository.. • •. This directory contains the contents of the Oracle Linux 7.1 ISO. Note that the RPM software packages are in the Packages directory.. •. A .repo file exists on each VM pointing to this Yum repository. # ls -l addons EFI EULA GPL. /var/www/html/repo/OracleLinux/OL7/1/x86_64 images RELEASE-NOTES-U1-en RPM-GPG-KEY-oracle isolinux RELEASE-NOTES-U1-en.html TRANS.TBL LiveOS repodata Packages RPM-GPG-KEY. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 10. a.

(17) Practice 1-2: Starting, Stopping, and Listing VM Guests Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. In this practice, you use xm commands to list, create, and shut down virtual machines.. Assumptions • •. You are logged on to dom0. You have a terminal window open.. •. You are the root user.. Tasks 1.. List all currently active guests, as well as dom0 itself. Use the xm list command. The output shown here is a sample, the ID and Time(s) values will be different on your system.. 2.. a s a h # xm list ) o ฺ c Time(s) e ฺ Name ID Mem VCPUs State d u i d Gu 281.1 e ฺ Domain-0 0 2048 2 r----r ta ent host01 1 1536 1 ili -b---157.6 d m -b---i u t n host02 2 1536 1 159.0 u is S @ host03 3 1536 13.2 so se 1th -b---r o • You have three guests (host01, uand host03) running. ฺc host02, n o t a Shut down a VM. (ju nse s e command to shut down the host03 VM. The –w cname> ria–w <VM Use the xm shutdown i l a le until all services in the domain shut down cleanly. Run xm osystematobwait option tells rthe s r o the list tocdisplay VMs. erunning f s n axmn shutdown command takes a few seconds to complete. jua• The r t n•onNote that host03 is no longer active. # xm shutdown –w host03 Domain host03 terminated All domains terminated # xm list Name ID Domain-0 0 host01 1 host02 2. Mem VCPUs 2048 2 1536 1 1536 1. State r-----b----b----. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 11. Time(s) 289.6 157.6 159.0.

(18) 3.. Start a VM.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Use the xm create <config_file> command to start the host03 VM. The <config_file> is named vm.cfg and is located in the /OVS/running_pool/<VM_name> directory. Run xm list to display the running VMs. •. Note that host03 is now active.. •. The State column for dom0 and host03 shows ‘r’ (run state). The State column for host01 and host02 shows ‘b’ (blocked). The following describes these values: •. r: The domain is currently running and healthy. •. b: The domain is blocked, and not running or runnable. This can be caused because the domain is waiting on IO (a traditional wait state) or has gone to sleep because there was nothing else for it to do.. # cd /OVS/running_pool/host03 # xm create vm.cfg Using config file “./vm.cfg”. Started domain host03 (id=#) # xm list Name ID Mem VCPUs Domain-0 0 2048 2 host01 4 1536 1 host02 2 1536 1 host03 3 1536 1. a s a h ) o c ideฺ ฺ u d GuTime(s) State e ฺ r t 304.5 n itar----l e i d m -b---18.7 tu ni S u 159.0 o@ e this -b---s r r----13.2 co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 12.

(19) Practice 1-3: Exploring the host01 VM. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Overview In this practice, you perform the following: • Log in to host01. • View the storage devices available on host01. • View the network configuration on host01. • View the Unbreakable Enterprise Kernel version on host01. •. View the Yum repository configuration on host01.. Assumptions •. You are logged on to dom0 as the root user.. •. The host01 VM guest is running.. a s a Tasks h ) o c ideฺ 1. Explore the host01 VM guest. ฺ u d Gu e ฺ a. Use the ssh command to log in to host01. r t ncommand itassh,dthe l e i • Because this is the first time you have logged in using checks to u t nim make sure that you are connecting to the u host that you think you are connecting to. S s i @ Enter yes. so se th r o • The root password is oracle u ฺc (alltlowercase). n o a • If you get a message,ju “ssh: connect to host host01 port 22: No route to host”, wait a e ( s n s few seconds toaallow host01 ri e lice to boot and then run the ssh host01 command a again. l o acommand b s r • The hostname confirms you have successfully logged in to host01. co sfer n n ahost01 jua# ssh r t n authenticity of host ‘host01 (192.0.2.101)’ can’t be noThe established. RSA key fingerprint is ... Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘host01,192.0,2,101’ (RSA) to the list of known hosts. root@host01’s password: oracle [root@host01 ~]# hostname host01.example.com b.. Use the fdisk command to view the storage devices. # fdisk –l | grep /dev Disk /dev/xvda: 12.9 GB, /dev/xvda1 * 2048 /dev/xvda2 1026048 Disk /dev/xvdb: 10.7 GB, Disk /dev/xvdd: 10.7 GB,. 12884901888 bytes, 25165824 sectors 1026047 512000 83 Linux 25165823 12069888 8e Linux LVM 10737418240 bytes, 20971520 sectors 10737418240 bytes, 20971520 sectors. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 13.

(20) Disk /dev/mapper/ol-root: 11.0 GB, 11022630912 bytes, ... Disk /dev/mapper/ol-swap: 1287 MB, 1287651328 bytes, ... • Three devices are available: /dev/xvda, /dev/xvdb, and /dev/xvdd.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. Do not run the following commands, this is information only: •. The /dev/xvda disk device represents a 12 GB system image file created with the following command (in the /OVS/running_pool/host01 directory on dom0): # dd if=/dev/zero of=system.img bs=1M count=12288. •. The /dev/xvdb disk device represents a 10 GB utility image file created with the following command (in the /OVS/running_pool/host01 directory on dom0): # dd if=/dev/zero of=u01.img bs=1M count=10240. •. The /dev/xvdd disk device represents a 10 GB utility image file created with the following command (in the /OVS/running_pool/host01 directory on dom0): # dd if=/dev/zero of=u02.img bs=1M count=10240. a s a h ) o ฺ cInstall Base e ฺ • The /dev/xvda device has Oracle Linux 7.1 installed – Minimal d u i d Gu e ฺ Environment. r nt itaswapdepartitions. l • This system disk uses LVM volumes for the rootiand im Stu n u c. Use the ip addr command to display the network interfaces. @ this o s r # ip addr o se c u ฺ n 1: lo: <LOOPBACK,UP,LOWER_UP> to mtu 65536 qdisc noqueue ... a u e j ( 00:00:00:00:00:00:00: link/loopback brd 00:00:00:00:00:00 ns s e a i c r i l inet addr:127.0.0.1/8 scope host lo o a able ... ors ceth0:s<BROADCAST,MULTICAST,UP,LOWER_UP> er f 2: mtu 1500 qdisc ... n an jua -trlink/ether 00:16:3e:00:01:01 brd ff:ff:ff:ff:ff:ff n o inet 192.0.2.101/24 brd 192.0.2.255 scope global eth0 n. ... 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:02:01 brd ff:ff:ff:ff:ff:ff 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:03:01 brd ff:ff:ff:ff:ff:ff 5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:04:01 brd ff:ff:ff:ff:ff:ff • The system has four Ethernet network interfaces, eth0, eth1, eth2, and eth3. • • •. The eth0 interface is on the 192.0.2 subnet, and provides access to dom0 and the other VM guest systems. The remaining interfaces do not have IP addresses. The eth1 interface is configured in “Practices for Lesson 2: Network Addressing and Name Services.” The eth2 and eth3 interfaces are configured as part of a bonded network interface in “Practices for Lesson 10: Advanced Networking.” Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 14.

(21) • d.. View the /etc/hosts file on host01. •. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. The eth1 interface is configured on a private subnet, 192.168.1, and is used in “Practices for Lesson 11: OCFS2 and Oracle Clusterware.” No changes are needed in this file. # cat /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.0.2.1 example.com dom0 192.0.2.101 host01.example.com host01 192.0.2.102 host02.example.com host02 192.0.2.103 host03.example.com host03. e.. Use the uname -r command to determine your running kernel version. •. The kernel is UEK Release 3. # uname -r 3.8.13-55.1.6.el7uek.x86_64. s a h o) eฺ f. View the /etc/yum/repos.d directory. c ฺ id a duLinuxG7uand • Two .repo files exist, the Public Yum repository file forrOracle e ฺ t custom repository file, vm.repo, for the local Yumilrepository ita deonndom0. nim Stu # cd /etc/yum.repos.d u # ls o@ e this s r public-yum-ol7.repo vm.repo co o us ฺ n t repositories in both files. utoaview enabled e g. Use the grep command j ( s s file contains en an enabled repository (enabled=1). a i • Only the vm.repo c r i l o a ab*le s # grep enabled r co sfer public-yum-ol7.repo:enabled=0 n an juapublic-yum-ol7.repo:enabled=0 r t n no.... a. vm.repo:enabled=1 h.. Use the cat command to view the contents of vm.repo. •. Note that the baseurl references the local Yum repository on dom0 (192.0.2.1). # cat vm.repo [OL7.1Dom0] Name="Oracle Linux 7.1 Dom0 Repo" baseurl=http://192.0.2.1/repo/OracleLinux/OL7/1/x86_64 enabled=1 gpgkey=http://192.0.2.1/repo/OracleLinux/OL7/1/x86_64/RPM-GPGKEY-oracle gpgcheck=1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 15.

(22) i.. Use the exit command to log off host01. # exit. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. logout Connection to host01 closed.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 16. a.

(23) Practice 1-4: Exploring the host02 VM. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Overview In this practice, you perform the following: • Log in to host02. • View the storage devices available on host02. • View the network configuration on host02.. Assumptions •. You are logged on to dom0 as the root user.. •. The host02 VM guest is running.. Tasks 1.. a s a h a. Use the ssh command to log in to host02. ) o ฺ to c idchecks e ฺ • Because this is the first time you have logged in using ssh, the command u dyou areGconnecting u e make sure that you are connecting to the host that you r think to. ฺ t a t n Enter yes. ili ude m i t • The root password is oracle (all lowercase). n S u o@ e this # ssh host02 s r co‘host02 us(192.0.2.102)’ can’t be The authenticity of host ฺ n o t a established. RSA key is ... e ju fingerprint ( s n s Are you sure ia you want eto continue connecting (yes/no)? yes r licadded ‘host02,192.0.2.102’ (RSA) to the a Warning:o Permanently e l b rs known listoof rahosts. c e f s nroot@host02’s password: oracle n a jua[root@host02 r t ~]# hostname n o n host02.example.com Explore the host02 VM guest.. • b.. The hostname command confirms whether you have successfully logged in to host02. Use the fdisk command to view the storage devices.. # fdisk –l | grep /dev Disk /dev/xvda: 21.5 GB, 21474836480 bytes, 41943040 sectors /dev/xvda1 * 2048 1026047 512000 83 Linux /dev/xvda2 1026048 41943040 20458496 8e Linux LVM Disk /dev/xvdb: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/xvdd: 21.5 GB, 21474836480 bytes, 41943040 sectors Disk /dev/xvde: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/mapper/ol-root: 18.8 GB, 18798870528 bytes, ... Disk /dev/mapper/ol-swap: 2147 MB, 2147483648 bytes, ... • Four devices are available: /dev/xvda, /dev/xvdb, /dev/xvdd and /dev/xvde. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 17.

(24) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. Do not run the following commands; this is for information only: • The /dev/xvda disk device represents a 20 GB system image file created with the following command (in the /OVS/running_pool/host02 directory on dom0): # dd if=/dev/zero of=system.img bs=1M count=20480 •. The /dev/xvdb disk device represents a 10 GB shared disk image file created with the following command (in the /OVS/sharedDisk directory on dom0): # dd if=/dev/zero of=physDisk1.img bs=1M count=10240. •. The /dev/xvdd disk device represents a 20 GB utility image file created with the following command (in the /OVS/running_pool/host02 directory on dom0): # dd if=/dev/zero of=u02.img bs=1M count=20480. •. The /dev/xvde disk device represents a 10 GB utility image file created with the following command (in the /OVS/running_pool/host02 directory on dom0): # dd if=/dev/zero of=u03.img bs=1M count=10240. a s a h ) o ฺ c GUIidBase e ฺ • The /dev/xvda device has Oracle Linux 7.1 installed – Server with u d Gu Environment. e ฺ r nt itaswapdepartitions. l • This system disk uses LVM volumes for the rootiand tu niminterfaces. S c. Use the ip addr command to display the network u o@ e this s # ip addr r co omtu us 65536 qdisc noqueue ... ฺ 1: lo: <LOOPBACK,UP,LOWER_UP> n t a (ju00:00:00:00:00:00:00: se link/loopback brd 00:00:00:00:00:00 n s e a i c inet addr:127.0.0.1/8 scope host lo ar le li o ... rs ab r o c e f <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... n2: eth0: ans jua -trlink/ether 00:16:3e:00:01:02 brd ff:ff:ff:ff:ff:ff n no inet 192.0.2.102/24 brd 192.0.2.255 scope global eth0. ... 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:02:02 brd ff:ff:ff:ff:ff:ff inet 192.168.1.102/24 brd 192.168.1.255 scope global eth1 ... 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:03:02 brd ff:ff:ff:ff:ff:ff 5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:04:02 brd ff:ff:ff:ff:ff:ff • The system has four Ethernet network interfaces, eth0, eth1, eth2, and eth3. • •. The eth0 interface is on the 192.0.2 subnet, and provides access to dom0 and the other VM guest systems. The eth1 interface is on a private subnet, 192.168.1, and is used in “Practices for Lesson 11: OCFS2 and Oracle Clusterware.” Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 18.

(25) •. The eth2 and eth3 interfaces are configured as part of a bonded network interface in “Practices for Lesson 10: Advanced Networking.”. The /etc/hosts, kernel version, and Yum configuration is the same on all three VM guests.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. d.. Use the exit command to log off host02. # exit logout Connection to host02 closed.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 19. a.

(26) Practice 1-5: Exploring the host03 VM. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Overview In this practice, you perform the following: • Log in to host03. • View the storage devices available on host03. • View the network configuration on host03.. Assumptions •. You are logged on to dom0 as the root user.. •. The host03 VM guest is running.. Tasks 1.. a s a h a. Use the ssh command to log in to host03. ) o ฺchecks ccommand e ฺ • Because this is the first time you have logged in by using ssh,uthe d i d youG e to make sure that you are connecting to the host that you think areuconnecting ฺ r t to. Enter yes. lita den i m tu • The root password is oracle (all lowercase). ni S u is successfully logged in to @ youthhave • The hostname command confirms owhether s r e host03. co o us ฺ n # ssh host03 ua se t j ( s of ichost en ‘host03 (192.0.2.103)’ can’t be The authenticity a i r l established. lekey fingerprint is ... o a aRSA b s r Areco you surer you want to continue connecting (yes/no)? yes fe s n Warning: Permanently added ‘host03,192.0.2.103’ (RSA) to the n a a known hosts. ju list trof n noroot@host03’s password: oracle Explore the host03 VM guest.. [root@host03 ~]# hostname host03.example.com b.. Use the fdisk command to view the storage devices. The host03 VM has the same disk configuration as the host01 VM. # fdisk –l | grep /dev Disk /dev/xvda: 12.9 GB, 12884901888 bytes, 25165824 sectors /dev/xvda1 * 2048 1026047 512000 83 Linux /dev/xvda2 1026048 25165823 12069888 8e Linux LVM Disk /dev/xvdb: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/xvdd: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/mapper/ol-root: 11.0 GB, 11022630912 bytes, ... Disk /dev/mapper/ol-swap: 1287 MB, 1287651328 bytes, ... • Three devices are available: /dev/xvda, /dev/xvdb, and /dev/xvdd. •. This is the same disk configuration as host01. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 20.

(27) • •. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. c.. The /dev/xvda device has Oracle Linux 7.1 installed – Server with GUI Base Environment. This system disk uses LVM volumes for the root and swap partitions. Use the ip addr command to display the network interfaces.. # ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue ... link/loopback 00:00:00:00:00:00:00: brd 00:00:00:00:00:00 inet addr:127.0.0.1/8 scope host lo ... 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:01:03 brd ff:ff:ff:ff:ff:ff inet 192.0.2.103/24 brd 192.0.2.255 scope global eth0 ... 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:02:03 brd ff:ff:ff:ff:ff:ff inet 192.0.2.104/24 brd 192.0.2.255 scope global eth1 ... 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:03:03 brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global eth2 ... • The system has three Ethernet network interfaces: eth0, eth1, and eth2.. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s interfaces en are on the 192.0.2 subnet. These interfaces are • The eth0 and eth1 a i c r i l a lfor used ino “Practices e Lesson 12: iSCSI and Multipathing.” b s r a • The co eth2sfinterface er is on a private subnet, 192.168.1, and is used in “Practices for n Lesson 11: jua -tran OCFS2 and Oracle Clusterware.” n the cat command to view the /etc/resolv.conf file. d. o n• Use This file provides access to Domain Name Service (DNS) for host-to-IP address resolution. It identifies three DNS nameservers and the search domain.. # cat /etc/resolv.conf # Generated by NetworkManager search example.com nameserver 192.0.2.1 nameserver 152.68.154.3 nameserver 10.216.106.3 The /etc/hosts, kernel version, and Yum configuration is the same on all three VM guests. e.. Use the exit command to log off host03. # exit logout Connection to host03 closed. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 21.

(28) Practice 1-6: Logging Off from Your Student PC Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. In this practice, you learn how to log off from your system.. Tasks 1.. Learn how to log off your student PC. a.. Open the System menu on the GNOME desktop.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran on n b. Select “Log Out vncuser” from the System menu. • • c.. You can click the Log Out button to log out. However, do not log out until the end of each day of training. Click the Cancel button to stay logged in.. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Introduction Chapter 1 - Page 22. a.

(29) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. s a h o) eฺ c ฺ du Guid e ฺ r t 2: Practices lfor n ita Lesson e i Network and tud nimAddressing S u Name o@ eServices this s r co Chapter us 2 ฺ n o t a (ju nse s ria e lice a o abl s r co sfer n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 1. a.

(30) Practices for Lesson 2: Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Practices Overview In these practices, you: • Configure host03 VM as a DHCP server and host01 VM as a DHCP client •. Dynamically obtain an IP address for eth1 on host01. • •. View and test the DNS server configuration on dom0 Configure host03 to as a caching-only nameserver. •. Test the DNS configuration. s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 2. a.

(31) Practice 2-1: Configuring a DHCP Server Overview. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. In this practice, you configure host03 VM as a DHCP server.. Assumptions You are the root user on dom0.. Tasks 1.. Log in to the host03 VM guest. Use the ssh command to log in to host03. •. The root password is oracle (all lowercase). [dom0]# ssh host03 root@host03’s password: oracle Last login: ... [host03]#. 2.. a s a h ) o c ideฺ ฺ u d Gu e ฺ r Install the dhcp package on host03 if necessary. ita dent l i a. Use the rpm command to check whether the dhcp tuis installed. nimpackage S u • In this example, only the dhcp-libs @ o and dhcp-common this packages are installed. s r e # rpm –qa | grep dhcp ฺco us n o t a dhcp-libs-... (ju nse s dhcp-common-... ria e lice a l b. Use the s yum available command, pipe the output to the grep command, o list b r a r string “dhcp”. o forfethe andcsearch s output is shown. n apartial n jua• Only r -t •onThe dhcp.x86_64 package needs to be installed in this example. n # yum list available | grep dhcp dhcp.x86_64 ... dhcp-libs.i686 ... c.. Use the yum command to install the dhcp package. •. You do not need to include the “.x86_64” extension.. •. Answer y when prompted “Is this ok”.. •. You are asked about the GPG key only the first time you use the yum install command. # yum install dhcp ... Transaction Summary ============================================================ Install 1 Package Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 3.

(32) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Total download size: 509 k Installed size: 1.4 M Is this ok [y/d/N]: y ... Retrieving key from http://192.0.2.1/repo/OracleLinux/OL7/... ... Is this ok [y/N]: y ... Complete! 3.. Use the vi editor to edit /etc/dhcp/dhcpd.conf as follows: Note: A preconfigured dhcpd.conf file exists on dom0 in the /OVS/seed_pool/sfws directory. •. 4.. a. You can edit the dhcpd.conf file as follows by using the vi command, or you can use the sftp command and copy /OVS/seed_pool/sfws/dhcpd.conf from dom0 to /etc/dhcp/dhcpd.conf on host03. See your instructor if you need help in using the sftp command.. s a h o) eฺ c ฺ du Guid e ฺ r ita dent # vi /etc/dhcp/dhcpd.conf l i option subnet-mask 255.255.255.0; nim Stu u option domain-name o@"example.com"; this s r e option domain-name-servers s co o u192.0.2.1; ฺ n t option broadcast-address 192.168.1.255; a (ju nse default-lease-time 21600; s e a i c r i l a le max-lease-time 43200; o b s r subnet 192.168.1.0 netmask 255.255.255.0 { ra corange e192.168.1.200 f s n 192.168.1.254; jua} -tran nonenabling and starting the dhcpd service, specify a command-line argument to Before. instruct the dhcpd service to only listen for DHCP requests on the eth2 network interface. a.. Use the cp command to copy the dhcpd.service file from the /usr/lib/systemd/system/ directory to the /etc/systemd/system/ directory. • •. The /usr/lib/systemd/system/ systemd units are included with the RPM packages and are not to be edited. The /etc/systemd/system/ systemd units are created and managed by the system administrator and take precedence. # cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 4.

(33) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. b.. Use the vi editor to edit the /etc/systemd/system/dhcpd.service file and append eth2 to the “ExecStart” line. # vi /etc/systemd/system/dhcpd.service ... ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid eth2 .... 5.. Enable and start the dhcpd service. a.. Use the systemctl command to enable the dhcpd service to start at boot time. •. Note that a symbolic link is created for the /etc/systemd/system/dhcpd.service file. # systemctl enable dhcpd ln –s ‘/etc/systemd/system/dhcpd.service’ ‘/etc/systemd/system/multi-user.target.wants/dhcpd.service’. a s a h b. Use the systemctl command to start the dhcpd service. ) o c ideฺ ฺ u # systemctl start dhcpd d Gu e ฺ r c. Use the systemctl command to view the status of the nt itadhcpddeservice. l i • Note that the server is only listening on eth2. nim Stu u o@ e this # systemctl status dhcpd s r co oDaemon dhcpd.service – DHCPv4 ฺServer us n t a Loaded: loaded(ju (/etc/systemd/system/dhcpd.service; enabled) e s n s Active: active since ... ce ria e (running) i l a ... o abl s r <date_time> co sferhost03...: Listening on LPF/eth2/00:16... n jua...-tran non. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 5.

(34) Practice 2-2: Configuring a DHCP Client. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Overview In this practice, you: • Configure host01 VM as a DHCP client •. Obtain an IP address from the DHCP server (host03) for the eth1 network interface. You begin this practice by opening a second terminal window on dom0 and logging in to host01 as the root user. You are already logged in as the root user to host03 from Practice 2-1.. Assumptions • • •. This practice is performed on host01 and host03 VMs. You are currently logged in to host03 (from Practice 2-1). The prompts in the solution section include either host01 or host03 to indicate which system to enter the command from.. a s a h ) o Tasks c ideฺ ฺ u d Gu 1. Log in to the host01 VM guest from dom0. e ฺ r ita dent a. Open a second terminal window on dom0. l i m su -tcommand u nithe b. From the second terminal window on dom0, u use to become the S s i @ root user. h o rs se t o • The root password is oracle. c u ฺ n o t a $ su – (ju nse s Password: oracle ria e lice a o abl # s r o user eron dom0, use the ssh command to log in to host01. f c. n As c the roots n aroot jua• The r t password is oracle (all lowercase). n o n [dom0]# ssh host01 root@host01’s password: oracle Last login: ... [root@host01]# 2.. Use the rpm command to verify that the dhclient package is installed on host01. •. In this example, the package is already installed. [host01]# rpm –q dhclient dhclient-4.2.5-36.0.1.el7.x86_64. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 6.

(35) 3.. Configure eth1 on host01 for DHCP. Use the vi editor and change /etc/sysconfig/network-scripts/ifcfg-eth1. •. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. The only change needed is ONBOOT=yes. The interface is configured to use DHCP by default. [host01]# vi /etc/sysconfig/network-scripts/ifcfg-eth1 TYPE=Ethernet BOOTPROTO=dhcp ... ONBOOT=yes. 4.. Use the ip addr command to display the network interfaces on host01. •. Note that eth1 does not have an IP address. [host01]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue ... link/loopback 00:00:00:00:00:00:00: brd 00:00:00:00:00:00 inet addr:127.0.0.1/8 scope host lo ... 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:01:01 brd ff:ff:ff:ff:ff:ff inet 192.0.2.101/24 brd 192.0.2.255 scope global eth0 ... 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:02:01 brd ff:ff:ff:ff:ff:ff .... 5.. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o raablease for eth1 from the DHCP server. orsrequest From host01, c e f n ans ja.uaUse-tthe r dhclient command to request a lease for eth1 from the DHCP server. n no[host01]# dhclient eth1. Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 7.

(36) b.. Use the ip addr command on host01 to verify that eth1 obtained an IP address.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. In this example, eth1 now has an IP address of 192.168.1.200. [host01]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue ... link/loopback 00:00:00:00:00:00:00: brd 00:00:00:00:00:00 inet addr:127.0.0.1/8 scope host lo ... 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:01:01 brd ff:ff:ff:ff:ff:ff inet 192.0.2.101/24 brd 192.0.2.255 scope global eth0 ... 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc ... link/ether 00:16:3e:00:02:01 brd ff:ff:ff:ff:ff:ff inet 192.168.1.200/24 brd 192.0.2.255 scope global eth1 .... 6.. s a h o) eฺ c ฺ View information about the lease. du Guid a. View information about the lease on the client (host01). arฺe it dent l i [host01]# cat /var/lib/dhclient/dhclient.leases im Stu n u lease { o@ e this s r interface “eth1”; co o us ฺ fixed-address 192.168.1.200; n t ua255.255.255.0; e j ( s option subnet-mask s icen a i r ... a le l o } ors ferab c b. n View information s about the lease on the server (host03). n a jua[host03]# r -t cat /var/lib/dhcpd/dhcpd.leases n o n ... lease 192.168.1.200 { starts ... ends ... ... hardware ethernet 00:16:3e:00:02:01 }. 7.. Use the exit command to log off host01.. •. [host01]# exit logout Connection to host01 closed. [dom0]# In this window, you are logged in as the root user on dom0.. •. Leave this window open for the next practice (Practice 2-3). Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 8. a.

(37) Practice 2-3: Viewing and Testing the DNS Configuration. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. Overview In this practice, you: • View the DNS configuration on dom0 • Test the lookup functionality of DNS from host03. Assumptions • •. Dom0 is already configured as an authoritative nameserver for the example.com domain. This practice is performed on dom0 and on host03 VM.. •. You are logged in as the root user on dom0 from one terminal window.. •. You are logged in as the root user on host03 from a second terminal window.. •. The prompts in the solution section include either dom0 or host03 to indicate which system to enter the command from.. a.. Use the service command to verify that the named service is started on dom0.. a s a h ) o c ideฺ ฺ u Tasks d Gu e ฺ r 1. Use the rpm command to verify that the bind package is linstalled nt ita donedom0. i • In this example, the package is installed. nim Stu u [dom0]# rpm –qa | grep bind o@ this s r e bind-libs-... co o us ฺ n bind-utils-... ua se t j ( s icen bind-... a i r l is enabled and running on dom0. a service e 2. Ensure that the named l o b raand orsservice e • Usecthe chkconfig commands on dom0 because dom0 is running f s n n a Oracle VM Server for x86 version 3.2.1 ju -tra n the systemctl command on the host01, host02, and host03 virtual machines • o Use n because the VMs are running Oracle Linux 7.1. •. In this example, the service is running. [dom0]# service named status number of zones: 3 debug level: 0 ... server is up and running named (pid ...) is running.... Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 9.

(38) b.. Use the chkconfig command to verify that the named service is configured to start at boot time on dom0.. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. •. In this example, the service is configured to start when the system boots at either run level 2, 3, or 4. [dom0]# chkconfig named --list named 0:off 1:off 2:on 3:on. 3.. 4:on. 5:on. 6:off. View the DNS configuration on dom0. a.. View the main BIND configuration file, /etc/named.conf. • •. This file lists location and characteristics of your domain’s zone files. Note that the zone file, /var/named/data/master-example.com, is defined.. •. Note that a reverse lookup zone file, /var/named/data/reverse-192.0.2, is also defined. [dom0]# cat /etc/named.conf ... options { directory “/var/named”; ... zone “example.com” { type master; file “data/master-example.com”; allow-update { key “rndckey”; }; notify yes; }; ... zone “2.0.192.in-addr.arpa” IN { type master; file “data/reverse-192.0.2”; allow-update { key “rndckey”; }; notify yes; }; .... s a h o) eฺ c ฺ du Guid e ฺ r ita dent l i nim Stu u o@ e this s r co o us ฺ n ua se t j ( s icen a i r a le l o ors ferab c s n jua -tran non. b.. a. View the /var/named/data/master-example.com zone file. •. This file defines IPv4 addresses (“A” records) for the DNS server, the DNS domain, and the four VM guest systems. [dom0]# cat /var/named/data/master-example.com ... dns A 192.0.2.1 example.com A 192.0.2.1 host01 A 192.0.2.101 host02 A 192.0.2.102 host03 A 192.0.2.103 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 10.

(39) host04 ... c.. 192.0.2.104. View the /var/named/data/reverse-192.0.2 file. •. Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. A. This file defines “PTR” records for reverse name resolution. [dom0]# cat /var/named/data/reverse-192.0.2 ... 1 PTR dns.us.oracle.com. 101 PTR host01.example.com. 102 PTR host02.example.com. 103 PTR host03.example.com. 104 PTR host04.example.com.. Perform the next task from host03. 4.. Test host name to IP resolution on host03.. a s a a. Use the ping command to contact host01 and host02. h ) o c ideฺ • You can successfully contact these systems by name, because ฺ/etc/hosts u d Gu resolves host names to IP addresses. e ฺ r ita dent l [host03]# ping host01 i tubytes of data. nim56(84) PING host01.example.com (192.0.2.101) S u 64 bytes from host01.example.com icmp_seq=1... o@ (192.0.2.101): this s r e o ... ฺc to us n a CTRL-C (ju nse s [host03]# ping host02 ia lice r a PING host02.example.com (192.0.2.102) 56(84) bytes of data. o able s r 64 cbytes o from er host02.example.com (192.0.2.102): icmp_seq=1... f s n ... an juaCTRL-C r t on n b. Use the vi editor to edit the /etc/hosts file and comment out the lines for the VMs with a # sign as follows. [host03]# vi /etc/hosts 127.0.0.1 localhost.localdomain 192.0.2.1 example.com #192.0.2.101 host01.example.com #192.0.2.102 host02.example.com #192.0.2.103 host03.example.com c.. localhost dom0 host01 host02 host03. Use the ping command to contact host01 and host02. •. You can still successfully contact these systems by name, because DNS is resolving host names to IP addresses. [host03]# ping host01 PING host01.example.com (192.0.2.101) 56(84) bytes of data. 64 bytes from host01.example.com (192.0.2.101): icmp_seq=1... Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 11.

(40) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. ... CTRL-C [host03]# ping host02 PING host02.example.com (192.0.2.102) 56(84) bytes of data. 64 bytes from host02.example.com (192.0.2.102): icmp_seq=1... ... CTRL-C d.. Use the grep command to search for the “hosts” string in the /etc/nsswitch.conf file. •. The first “hosts” entry is a comment.. •. In the second “hosts” entry, “files” means to use the local /etc/hosts file to resolve host names to IP addresses. Also in the second “hosts” entry, “dns” means to use DNS to resolve host names to IP addresses when unable to resolve by using the /etc/hosts file.. •. a s a h [host03]# grep hosts /etc/nsswitch.conf ) o c ideฺ #hosts: db files nisplus nis dns ฺ u d Gu e hosts: files dns ฺ r nt the “dns” itaand dremove l e i e. Use the vi editor to edit the /etc/nsswitch.conf file im Stu argument from the “hosts” entry as follows. un o@ e this s [host03]# vi /etc/nsswitch.conf r co o us ฺ hosts: files dns # old entry n t a hosts: files (ju # new entry se n s e ria e toliccontact host01 and host02. f. Use the pingacommand l these systems by name now because DNS is no longer used. o contact b s • You cannot r a co sfer n [host03]# n ping host01 a juaping: r t n- unknown host host01 no[host03]# ping host02 ping: unknown host host02 g.. Use the vi editor to edit the /etc/nsswitch.conf file and restore the “dns” argument to the “hosts” entry as follows. [host03]# vi /etc/nsswitch.conf hosts: files hosts: files dns. h.. # old entry # new entry. Use the ping command to contact host01 and host02. •. You can now successfully contact these systems by name, because DNS is resolving host names to IP addresses. [host03]# ping host01 PING host01.example.com (192.0.2.101) 56(84) bytes of data. 64 bytes from host01.example.com (192.0.2.101): icmp_seq=1... ... Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 12.

(41) Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ. CTRL-C [host03]# ping host02 PING host02.example.com (192.0.2.102) 56(84) bytes of data. 64 bytes from host02.example.com (192.0.2.102): icmp_seq=1... ... CTRL-C i.. View the /etc/resolv.conf file. •. •. DNS is only able to resolve host names to IP addresses because the /etc/resolv.conf file contains a valid search domain, example.com, and valid nameserver information. The nameserver 192.0.2.1 for the example.com domain stores the zone files that provide host name to IP address resolution. [host03]# cat /etc/resolv.conf # Generated by NetworkManager search example.com nameserver 192.0.2.1 nameserver 152.68.154.3 nameserver 10.216.106.3. a s a h ) o c ideฺ ฺ u d Gu e ฺ r ita dent l i u tcomment nimfile and j. Use the vi editor to edit the /etc/resolv.conf out all lines as S u s i @ follows. so se th r o [host03]# vi /etc/resolv.conf ฺc to u n a # Generated by NetworkManager (ju nse s #search example.com ia lice r a #nameserver le o 192.0.2.1 b s r a #nameserver co sfer152.68.154.3 n #nameserver jua -tran 10.216.106.3 n the ping command to contact host01 and host02. k. o n• Use You cannot contact these systems by name now. [host03]# ping host01 ping: unknown host host01 [host03]# ping host02 ping: unknown host host02 l.. Use the vi editor to edit the /etc/resolv.conf file and remove the # signs to uncomment the “search” and “nameserver” entries as follows. [host03]# vi /etc/resolv.conf # Generated by NetworkManager search example.com nameserver 192.0.2.1 nameserver 152.68.154.3 nameserver 10.216.106.3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Network Addressing and Name Services Chapter 2 - Page 13.

References

Related documents

Flow Processor (FP) (17xx) Console QFlow Collector (12xx or 13xx) Flow records port 32010 Router sending NetFlow data Span port on a switch Network tap ETH1 ETH2 ETH0 ETH3

„ External services are to be configured on 2 servers; 2 interfaces.. „ Addresses are

Prior to configure the Back-up mode settings, please ensure the Preferred Network Mode, as well as the Backup Network Mode are both configured in the router interface. (For

The “Ethernet 2 (Eth2)” interface of the Ingate Firewall/SIParator contains an IP address on the directly connected network located on the LAN. With the Netmask, the

When E1 is configured as a local loopback interface, the router transmits test traffic simultaneously to the CSU and to the receiver at the E1 interface. When E1 is configured as

Table 4.6 : Average distances between the object and its 1 0 rotated versions (Binary object results are given in the first row, and Grayscale object results are given in

The relevance of ABA signaling in the responses of woody plants to abiotic stress is evidenced by the fact that overexpression of pyrabactin resistance-like abscisic acid recep-

NIDS  are  typically  configured  with  more  than  one  network  interface  card  (NIC)  –  the  hardware  connecting  your  computer  to  the  physical