You can use the sample profiles in this section as templates to create your own profiles, or you can use the sysconfig tool with the naming_services grouping to produce a profile based on your responses to prompts. See Creating a System Configuration Profile Using the SCI Tool and the sysconfig(1M) man page for more information about using sysconfig to create a system configuration profile.
This example profile performs the following configuration:
Enables NIS for my.domain.com
Uses broadcasting to discover the NIS server, which must be on the same subnet
Enables the name service cache service, which is required
<?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. --> <service_bundle type='profile' name='default'> <service name='network/nis/domain' type='service' version='1'> <property_group name='config' type='application'> <propval name='domainname' type='hostname' value='my.domain.com'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='network/nis/client' type='service' version='1'> <property_group name='config' type='application'> <propval name='use_broadcast' type='boolean' value='true'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='system/name-service/switch' type='service' version='1'> <property_group name='config' type='application'> <propval name='default' type='astring' value='files nis'/> <propval name='printer' type='astring' value='user files nis'/> <propval name='netgroup' type='astring' value='nis'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='system/name-service/cache' type='service' version='1'> <instance name='default' enabled='true' /> </service> </service_bundle>Example 11-10 Configuring NIS and Disabling DNS
This example profile performs the following configuration:
Configures name service NIS with automatic broadcasting for a NIS server, which must be on the same subnet
Configures the NIS domain my.domain.com
Enables the name service cache service, which is required
Disables the DNS name service
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <!-- service name-service/switch below for NIS only - (see nsswitch.conf(4)) --> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files nis"/> <propval type="astring" name="printer" value="user files nis"/> <propval type="astring" name="netgroup" value="nis"/> </property_group> <instance enabled="true" name="default"/> </service> <!-- service name-service/cache must be present along with name-service/switch --> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <!-- if no DNS, must be explicitly disabled to avoid error msgs --> <service version="1" type="service" name="network/dns/client"> <instance enabled="false" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="my.domain.com"/> </property_group> <instance enabled="true" name="default"/> </service> <!-- configure the NIS client service to broadcast the subnet for a NIS server --> <service version="1" type="service" name="network/nis/client"> <property_group type="application" name="config"> <propval type="boolean" name="use_broadcast" value="true"/> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>Example 11-11 Configuring NIS
The following profile configures name service NIS with server IP address 10.0.0.10 and domain mydomain.com. The NIS server is not required to be on the same subnet when the server IP address is explicitly specified.
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <!-- name-service/switch below for NIS only - (see nsswitch.conf(4)) --> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files nis"/> <propval type="astring" name="printer" value="user files nis"/> <propval type="astring" name="netgroup" value="nis"/> </property_group> <instance enabled="true" name="default"/> </service> <!-- name-service/cache must be present along with name-service/switch --> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <!-- if no DNS, must be explicitly disabled to avoid error msgs --> <service version="1" type="service" name="network/dns/client"> <instance enabled="false" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="mydomain.com"/> <!-- Note: use property with net_address_list and value_node as below --> <property type="net_address" name="ypservers"> <net_address_list> <value_node value="10.0.0.10"/> </net_address_list> </property> </property_group> <!-- configure default instance separate from property_group --> <instance enabled="true" name="default"/> </service> <!-- enable the NIS client service --> <service version="1" type="service" name="network/nis/client"> <instance enabled="true" name="default"/> </service> </service_bundle>Example 11-12 Enabling NIS and DNS For a Specified Domain
This example configures both DNS and NIS name services:
Specifies multiple DNS name servers
Specifies a DNS domain search list
Specifies a NIS domain
Specifies broadcasting to discover the NIS server
<?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. --> <service_bundle type='profile' name='default'> <service name='network/dns/client' type='service' version='1'> <property_group name='config' type='application'> <propval name='domain' type='astring' value='us.oracle.com'/> <property name='nameserver' type='net_address'> <net_address_list> <value_node value='130.35.249.52' /> <value_node value='130.35.249.41' /> <value_node value='130.35.202.15' /> </net_address_list> </property> <property name='search' type='astring'> <astring_list> <value_node value='us.oracle.com oracle.com oraclecorp.com' /> </astring_list> </property> </property_group> <instance name='default' enabled='true' /> </service> <service name='network/nis/domain' type='service' version='1'> <property_group name='config' type='application'> <propval name='domainname' type='hostname' value='mydomain.com'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='network/nis/client' type='service' version='1'> <property_group name='config' type='application'> <propval name='use_broadcast' type='boolean' value='true'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='system/name-service/switch' type='service' version='1'> <property_group name='config' type='application'> <propval name='default' type='astring' value='files nis'/> <propval name='host' type='astring' value='files dns'/> <propval name='printer' type='astring' value='user files nis'/> <propval name='netgroup' type='astring' value='nis'/> </property_group> <instance name='default' enabled='true' /> </service> <service name='system/name-service/cache' type='service' version='1'> <instance name='default' enabled='true' /> </service> </service_bundle>
The following example profile configures the following parameters:
Name service DNS
Server IP addresses 1.1.1.1 and 2.2.2.2
Domain dom.ain.com
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <!-- name-service/switch below for DNS only - (see nsswitch.conf(4)) --> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files"/> <propval type="astring" name="host" value="files dns"/> <propval type="astring" name="printer" value="user files"/> </property_group> <instance enabled="true" name="default"/> </service> <!-- name-service/cache must be present along with name-service/switch --> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/dns/client"> <property_group type="application" name="config"> <!-- Note: use property with net_address_list and value_node as below --> <property type="net_address" name="nameserver"> <net_address_list> <value_node value="1.1.1.1"/> <value_node value="2.2.2.2"/> </net_address_list> </property> <!-- Note: use property with astring_list and value_node, concatenating search names, as below --> <property type="astring" name="search"> <astring_list> <value_node value="dom.ain.com ain.com"/> </astring_list> </property> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>
This example profile configures the following parameters:
Name service LDAP with server IP address 10.0.0.10
Domain my.domain.com specified in service system/nis/domain
LDAP search base (required), dc=my,dc=domain,dc=com
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files ldap"/> <propval type="astring" name="printer" value="user files ldap"/> <propval type="astring" name="netgroup" value="ldap"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/dns/client"> <instance enabled="false" name="default"/> </service> <service version="1" type="service" name="network/ldap/client"> <property_group type="application" name="config"> <propval type="astring" name="profile" value="default"/> <property type="host" name="server_list"> <host_list> <value_node value="10.0.0.10"/> </host_list> </property> <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="my.domain.com"/> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>Example 11-15 Configuring LDAP With a Secure LDAP Server
This example profile configures the following parameters:
Name service LDAP with server IP address 10.0.0.10
Domain my.domain.com specified in service system/nis/domain
LDAP search base (required), dc=my,dc=domain,dc=com
LDAP proxy bind distinguished name cn=proxyagent,ou=profile,dc=my,dc=domain,dc=com
LDAP proxy bind password, encrypted as a security measure. You can find the encrypted value by using one of the following methods:
Take the bind_passwd property value from sysconfig create-profile.
Take the value from the SMF configuration on the LDAP server.
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files ldap"/> <propval type="astring" name="printer" value="user files ldap"/> <propval type="astring" name="netgroup" value="ldap"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/dns/client"> <instance enabled="false" name="default"/> </service> <service version="1" type="service" name="network/ldap/client"> <property_group type="application" name="config"> <propval type="astring" name="profile" value="default"/> <property type="host" name="server_list"> <host_list> <value_node value="10.0.0.10"/> </host_list> </property> <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/> </property_group> <property_group type="application" name="cred"> <propval type="astring" name="bind_dn" value="cn=proxyagent,ou=profile,dc=my,dc=domain,dc=com"/> <!-- note that the password below is encrypted --> <propval type="astring" name="bind_passwd" value="{NS1}c2ab873ae7c5ceefa4b9"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="my.domain.com"/> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>
The DNS name service can be used in conjunction with the LDAP name service. A typical usage is for DNS to resolve node names (including the LDAP server name), and for LDAP to resolve all other names. The service system/name-service/switch is used to specify DNS for node name search and LDAP to resolve other names, as shown in the first service element in this example.
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files ldap"/> <propval type="astring" name="host" value="files dns"/> <propval type="astring" name="printer" value="user files ldap"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/dns/client"> <property_group type="application" name="config"> <property type="net_address" name="nameserver"> <net_address_list> <value_node value="10.0.0.10"/> </net_address_list> </property> <propval type="astring" name="domain" value="my.domain.com"/> <property type="astring" name="search"> <astring_list> <value_node value="my.domain.com"/> </astring_list> </property> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/ldap/client"> <property_group type="application" name="config"> <propval type="astring" name="profile" value="default"/> <property type="host" name="server_list"> <host_list> <!-- here, DNS is expected to resolve the LDAP server by name --> <value_node value="ldapserver.my.domain.com"/> </host_list> </property> <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="my.domain.com"/> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>
NIS can be used in conjunction with DNS in a similar way.
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type="profile" name="sysconfig"> <service version="1" type="service" name="system/name-service/switch"> <property_group type="application" name="config"> <propval type="astring" name="default" value="files nis"/> <propval type="astring" name="host" value="files dns"/> <propval type="astring" name="printer" value="user files nis"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="system/name-service/cache"> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/dns/client"> <property_group type="application" name="config"> <property type="net_address" name="nameserver"> <net_address_list> <value_node value="10.0.0.10"/> </net_address_list> </property> <propval type="astring" name="domain" value="my.domain.com"/> <property type="astring" name="search"> <astring_list> <value_node value="my.domain.com"/> </astring_list> </property> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/nis/domain"> <property_group type="application" name="config"> <propval type="hostname" name="domainname" value="my.domain.com"/> </property_group> <instance enabled="true" name="default"/> </service> <service version="1" type="service" name="network/nis/client"> <property_group type="application" name="config"> <propval type="boolean" name="use_broadcast" value="true"/> </property_group> <instance enabled="true" name="default"/> </service> </service_bundle>