Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have...

19
Oracle Solaris 11 Hands On Lab For Oracle employees and authorized partners only. Do not distribute to third parties. © 2011 Oracle Corporation Page 1 of 19 Network Configuration 1 Introduction Participants will gain example-led awareness and understanding of how network configuration is accomplished in Oracle Solaris 11. With a few basic exercises we will introduce the learner to some new ways to administer network properties in Oracle Solaris 11. Upon completion of this lab, participants will have learned how to do some basic configuration and setup and be prepared to explore more detailed and expand their knowledge into the powerful Solaris network abilities. 2 Overview In this lab we’ll be practicing with some of the new Oracle Solaris 11 network commands. We’ll briefly review basic network planning and then execute setup of our network links and ip addressing. We’ll also review the updated method for configuring name service mapping in the Solaris 11 operating system. Some of the commands and concepts we’ll review are listed below. NCPs, Automatic and FixedDefault networking modes Manual networking configuration SMF services configuration netadm dladm ipadm svccfg This practice can be accomplished with a single VirtualBox Oracle Solaris 11 instance with some added virtual network interfaces.

Transcript of Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have...

Page 1: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 1 of 19

Network Configuration

1 Introduction Participants will gain example-led awareness and understanding of how network configuration is accomplished in Oracle Solaris 11. With a few basic exercises we will introduce the learner to some new ways to administer network properties in Oracle Solaris 11. Upon completion of this lab, participants will have learned how to do some basic configuration and setup and be prepared to explore more detailed and expand their knowledge into the powerful Solaris network abilities.

2 Overview In this lab we’ll be practicing with some of the new Oracle Solaris 11 network commands. We’ll briefly review basic network planning and then execute setup of our network links and ip addressing. We’ll also review the updated method for configuring name service mapping in the Solaris 11 operating system.

Some of the commands and concepts we’ll review are listed below.

NCPs, Automatic and FixedDefault networking modes Manual networking configuration SMF services configuration netadm dladm ipadm svccfg

This practice can be accomplished with a single VirtualBox Oracle Solaris 11 instance with some added virtual network interfaces.

Page 2: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 2 of 19

3 Pre-requisites This lab requires the use of the following elements:

A current laptop with at least 3GB memory and 100GB free disk space Oracle VirtualBox Software (4.0.16 with Extension Pack installed) Oracle Solaris 11 11/11 VirtualBox prebuilt image.

o Provided by instructor or downloaded on your own o Oracle Solaris VM for Oracle VM VirtualBox

The following assumptions have been made regarding the environment where this lab is being performed:

1. Network connectivity to the Internet is not necessary 2. 4 virtual network interfaces are setup in the VirtualBox environment

(instructions below) 3. Your Oracle Solaris 11 VirtualBox instance has been installed and you’ve

assigned a normal user/password and a root password. a. The recommended user name is ‘labuser’ b. The recommended password is ‘solaris11’ c. The recommended root password is ‘solaris11’

4 VirtualBox lab setup and pre-network configuration

In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on Network Settings below if you’ve already imported your Solaris 11 image. Your Oracle Solaris 11 image must be ‘off’ in order to configure the network interfaces in VirtualBox.

In the VirtualBox main window choose File > Import Appliance …

Page 3: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 3 of 19

From the Appliance Import Wizard click the Choose … button and navigate to the OracleSolaris11_11-11.ovf file which is the pre-built Oracle Solaris VM image you downloaded or obtained from the instructor

Confirm the default settings and choose “Import” to begin importing the virtual image.

Be patient while your image imports into the application. The process shouldn’t take more than 5-10 minutes depending on the speed of your system.

Page 4: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 4 of 19

After your image has finished importing select it in the VB application and choose “Settings” and navigate to “Network” settings. You should see tabs for up to 4 virtual network adapters and the first one should be configured for you already.

Select Adapter 2, click on the check box to ‘Enable Network Adapter’ and make sure the drop down is selected as NAT – “Network Address Translation”

Do the same thing for Adapter 3 and Adapter 4 so all 4 virtual network adapters are enabled.

Page 5: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 5 of 19

If you scroll down in the Details section of the VB interface, your Network properties should show all 4 adapters enabled.

Click on the Start button to start your new VB Oracle Solaris 11 instance.

Page 6: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 6 of 19

The System Configuration Tool should start. Configure your system according to the below instructions. If you need further assistance please see lab # 2 – Advanced Installation for help with the system configuration utility

Recommended settings for lab use are listed below:

System Name: bootcamp1

Username: Lab User

User password: solaris11

Root password: solaris11

Local Time: Your choice

Network Configuration: Automatic

Once your virtual image has booted, open a Terminal and type in the command ‘dladm show-phys’ to

verify that the network interfaces are operational and being seen by Solaris 11.

Page 7: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 7 of 19

5 Lab Exercises

5.1 Planning the network deployment

This section is a very brief review of what you may encounter when configuring a system for a customers’ network. Review the checklist and proceed on to the exercises, keep in mind that we’re working with a very simple network model in our lab exercise but that in a customer environment things could get more complicated.

Task Description

Plan hardware requirements and network topology

Determine the equipment you’ll be using and the layout of the equipment at your site.

Obtain registered IP address(s) for your network if this is a new network

If communicating over the internet you must have a unique assigned IP address

Obtain or devise an IP addressing scheme based on IPv4 or IPv6

Determine how addresses are deployed at the customer site.

Obtain or create a list of IP addresses and host names that will be used on the network. Alternatively decide if customer will use DHCP for addressing.

Use the list to build network databases.

Determine the name service in use at the customer site.

DNS, NIS, LDAP, etc.

Establish administrative subdivisions if necessary.

Consult the site network admins or obtain this information from the customer.

Determine whether routers are in use or necessary within the configuration, routing protocols, etc.

If the network is large enough, routing will be a consideration.

If required, design a strategy for subnetting.

Subnets allow network control and help administration as well as allow more IP addresses to be made available to end users.

For more information on network planning see the Oracle Solaris 11 System Administration Guide: IP Services

Page 8: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 8 of 19

5.2 Network command basics

Your system should already have Oracle VirtualBox hypervisor software installed and ready to use with the Oracle Solaris 11 instance configured and up and running with 4 virtual network adapters added. We will be using a terminal application within the GUI for the following lab exercises.

5.3 Network Configuration Profiles (NCP)

Oracle Solaris 11 uses profile-based network configuration, which is comprised of two network configuration modes: manual and automatic.

The Automatic NCP uses DHCP to obtain basic network configuration (IP address, router, and DNS server) from any of the connected Ethernet interfaces. The DefaultFixed NCP disables automatic network configuration and requires the network interfaces to be manually configured using the dladm and ipadm commands. The name-services can be configured using SMF, the Oracle Solaris Service Management Facility.

Page 9: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 9 of 19

You can create your own NCPs and this makes Oracle Solaris 11 network management easier than always using the DefaultFixed NCP and manually configuring the network. The DefaultFixed NCP should be used on systems that will be reconfigured using Oracle Solaris Dynamic Reconfiguration or where hot-swappable interfaces are used. It must be used for IP multipathing, which is not supported when using the Automatic NCP. You can use netadm to find out what network profiles are active on a system:

# netadm list

As you can see from the output the Automatic NCP is enabled and active. We will need to switch to the DefaultFixed NCP in order to complete the rest of the lab. Let’s familiarize ourselves with the new network commands and see what our network looks like. Type to following commands to investigate your network based on its automatically obtained information. #dladm show-phys (shows us the physical interfaces) #dladm show-link (shows us the link state for the physical addresses)

Page 10: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 10 of 19

Now let’s look at the ip layer and see what’s going on. # ipadm show-if (this will show us the existing interfaces on the system) # ipadm show-addr (this will show us the mac addresses and IP addresses)

Now let’s switch to manual mode in order to see what’s involved in manual network configuration. # netadm enable –p ncp DefaultFixed

# netadm list

Page 11: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 11 of 19

We can easily switch back to the Automatic NCP using the following command: # netadm enable -p ncp Automatic

# netadm list

It might take a few minutes for your instance to regain its network information but soon you will be back to your original state.

Return to the DefaultFixed ncp by typing in the following command: # netadm enable –p ncp DefaultFixed

Now that we’ve gone back to the manual network profile, let’s look at our interfaces again and see what’s happened.

Page 12: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 12 of 19

# dladm show-phys

# dladm show-link

# ipadm show-if

# ipadm show-addr

None of the interfaces should be configured. Now we have some work to do.

5.4 Manual network configuration

In the last lab we switched the NCP into DefaultFixed. Now we can start doing some manual network configuration.

On a machine with multiple physical networks, you can use dladm to determine how network interface names are mapped to physical interfaces. Oracle Solaris uses the concept of ‘vanity names’ to apply to the underlying links to avoid random changes resulting from interface additions and subtractions. # dladm show-phys

Page 13: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 13 of 19

The ipadm command is used to manually configure IP interfaces and addresses.

For example, a static IPv4 interface is configured as follows. Then use the ipadm show-if command to verify the interface.

# ipadm create-ip net0

# ipadm show-if

Now let’s assign an IP address to our interface with the following command:

# ipadm create-addr –T static –a local=10.9.8.7/24 \

net0/v4static

# ipadm show-addr

The -T option can be used to specify three address types: static, dhcp, and addrconf (for auto-configured IPv6 addresses). In this example, the system is configured with a static IPv4 address. Use the same syntax to specify a static IPv6 address with our second virtual interface.

# ipadm create-ip net1

# ipadm create-addr –T addrconf net1/v6auto

# ipadm show-if

# ipadm show-addr

Page 14: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 14 of 19

Now let’s create a dhcp interface using the same commands and our 3rd interface.

# ipadm create-ip net2

# ipadm create-addr –T dhcp net2/v4auto

# ipadm show-if

# ipadm show-addr

If an interface has already been configured and you want to change the address or type, you will need to remove it and then re-add it. Execute the following commands to change the address on net0 from 10.8.7.6 to 10.8.7.4. Then type the ipadm show-addr command to verify your changes.

# ipadm delete-ip net0

# ipadm create-ip net0

# ipadm create-addr –T static –a local=10.9.8.4/24 \

net0/v4static

# ipadm show-addr

Page 15: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 15 of 19

5.5 Displaying and configuring link interfaces when in manual mode

When you perform a fresh installation, all datalinks are automatically assigned generic names by using a net0, net1, and netNnaming convention, depending on the total number of network devices on a system. After installing, you can use different datalink names.

Display information about the datalinks on a system as follows:

# dladm show-phys

Display a datalink name, its device name, and its location in this manner:

# dladm show-phys –L net0

To rename a datalink type the following commands. If an IP interface is configured over the datalink, first remove the interface.

# ipadm show-if

Page 16: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 16 of 19

Since we don’t have net3 configured at this time let’s rename the link using the following commands:

# dladm rename-link net3 onboard3

# dladm show-phys

You’ve just renamed your datalink.

5.6 Name Services in Oracle Solaris 11

The SMF repository has replaced manually edited files as the primary method for configuring network naming services. Changes to network services information can now be made by interacting directly with the SMF services. And the services, for example, svc:/system/name-service/switch, svc:/network/dns/client, and svc:/system/name-service/cache must be enabled or refreshed for any changes to take effect.

The following table describes the naming service configuration information that has migrated to SMF.

Page 17: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 17 of 19

SMF Service Files Description

svc:/system/name-service/switch:default /etc/nsswitch.conf Naming service switch configuration (Used by thenscd command)

svc:/system/name-

service/cache:default /etc/nscd.conf Naming service cache (nscd)

svc:/network/dns/client:default /etc/resolv.conf DNS naming service

svc:/network/nis/domain:default /etc/defaultdomain /var/yp/binding/$DOMAIN/*

Shared NIS domain configuration (Used by all NIS services). Also historical shared use by LDAP naming services

svc:/network/nis/client:default N/A NIS client naming service (ypbind and related files)

svc:/network/ldap/client:default /var/ldap/* LDAP client naming service (ldap_cachemgr and related

files)

svc:/network/nis/server:default N/A NIS server naming service (ypserv)

svc:/network/nis/passwd:default N/A NIS server passwd service

(rpc.yppasswd)

svc:/network/nis/xfr:default N/A NIS server xfr naming service

(ypxfrd)

svc:/network/nis/update:default N/A NIS server update naming service (rpc.ypupdated)

svc:/system/name-

service/upgrade:default N/A Naming legacy file to SMF

upgrade service

5.7 Name Services configuration using SMF

In this short lab we will use the svccfg command to set our DNS search string to company.com, adding a us, eu, companya, and company sub string. We’ll add two name server IP addresses (138.2.202.15 and 138.2.202.25) and set our database search files to look in files, and then DNS for its host information. Hopefully this information looks familiar if you’ve ever had to manually edit these files. When using services in this fashion if you do attempt to edit the files manually, they will be overwritten. All name services configuration should be done using SMF in Oracle Solaris 11.

Execute the following command sequence to configure the name services on our lab instance.

# svccfg

svc:> select dns/client

Page 18: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 18 of 19

svc:/network/dns/client> setprop config/search = astring: \

("us.company.com" "eu.company.com" "companya.com"

"companyb.com" "company.com" )

svc:/network/dns/client> setprop config/nameserver =

net_address: \

( 138.2.202.15 138.2.202.25 )

svc:/network/dns/client> select dns/client:default

svc:/network/dns/client:default> refresh

svc:/network/dns/client:default> validate

svc:/network/dns/client:default> select name-service/switch

svc:/system/name-service/switch> setprop config/host =

astring: "files dns"

svc:/system/name-service/switch> select system/name-

service/switch:default

svc:/system/name-service/switch:default> refresh

svc:/system/name-service/switch:default> validate

svc:/system/name-service/switch:default> end

Now we’ll need to enable the service, refresh the database and then we’ll confirm our work and make sure the files have been changed for us.

# svcadm enable dns/client

# svcadm refresh name-service/switch

# grep host /etc/nsswitch.conf

# cat /etc/resolv.conf

Page 19: Advanced Install Lab4 VirtualBox lab setup and pre-network configuration In prior labs we have imported the Oracle Solaris 11 11/11 pre-built VirtualBox image. Skip to the step on

Oracle Solaris 11 – Hands On Lab

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2011 Oracle Corporation

Page 19 of 19

6 Lab Summary In this lab you learned about the new networking commands, dladm and ipadm. You practiced using network configuration profiles and we created ip interfaces and assigned them to different IP protocols. We renamed links and took our first look at configuring name services through the SMF facility. There’s a ton more to networking in Oracle Solaris 11. It’s a very powerful feature that allows complete networks to be set up ‘in the box’ including switches, routers, and bridges. See the references section below on how to go deeper in your knowledge and discover all the powerful network features of Oracle Solaris 11.

7 References For more information and next steps, please consult additional resources: Click the hyperlinks to access the resource.

Oracle Solaris 11 General Cheatsheet (includes networking commands)

Networking Command Quick Reference

Documentation: Configuring an IP Interface

Documentation: How to rename a Datalink

Oracle Solaris 11 Technology Spotlights

Oracle Solaris 11 Information Library

Oracle Solaris 11 Product Documentation