| Solaris |
|
|
| Authors: | Slava Leanovich <Viachaslau.Leanovich@Sun.COM> |
|---|---|
| Version: | 0.1 |
| Date: | 2007-06-27 |
| Status: | DRAFT |
Contents
The Name Service discovery procedure works in the following way:
hosts = dns [NOTFOUND=return] files
Refer to nsswitch.conf(4).
Assume that DHCP server (known as in.dhcpd(1M), which is basically the smf(5) service named network/dhcp-server) is unconfigured and therefore disabled.
# dhcpconfig -Sq dhcpconfig: Error - failed to read DHCP server parameters. # svcs dhcp-server STATE STIME FMRI disabled 12:42:43 svc:/network/dhcp-server:default
So, firstly DHCP must be initialized. Simpliest way of doing that is to create DHCP configuration database as a number of plain text files somewhere in /var/dhcp:
# dhcpconfig -D -r SUNWfiles -p /var/dhcp Created DHCP configuration file. Created dhcptab. Added "Locale" macro to dhcptab. Added server macro to dhcptab. DHCP server started.
If you're not ok with that "dhcpconfig -D" starts DHCP service automatically after initialization, do "dhcpconfig -Sd" or "svcadm -v disable dhcp-server" to stop it.
NOTE: "dhcpconfig -U" unconfigures everything.
Now you can configure the network, supposed to be served by this DHCP server. As an example, if your network is 10.18.138.0/26, then you can create the network table in the following way:
# pntadm -C 10.18.138.0
NOTE: before adding the network definition, make sure you have correct netmask specified in the netmasks(4) database:
# getent netmasks 10.18.138.0 10.18.138.0 255.255.255.192
The next step is to create the macro containing your DNS, NIS, NIS+ settings. The name of this macro can be equal to the network name, so all DHCPDISCOVER or DHCPINFORM requests coming from this network will get the DHCPOFFER or DHCPACK with the settings in this macro.
Example: add the macro 10.18.138.0 with the network settings, DNS and NIS options:
# dhtadm -A -m 10.18.138.0 -d \ ':Subnet=255.255.255.192'\ ':Router=10.18.138.1'\ ':NISdmain="lab.sun.com"'\ ':NISservs=129.157.72.244'\ ':DNSdmain="lab.sun.com"'\ ':DNSserv=10.18.138.43 10.18.138.22:'
NOTE: DHCP option names are declared in the /etc/dhcp/inittab file, see dhcp_inittab(4) for a details.
So, it's time to start/restart the DHCP server
# svcadm -v enable dhcp-server svc:/network/dhcp-server:default enabled.
In order to verify whether the DHCP does respond with the right options, it's possible to run snoop(1M) on the server machine and dhcpinfo(1) on the client machine.
Example: snoop(1M) running at the server machine:
# snoop -v dhcp Using device eri0 (promiscuous mode) ... DHCP: Message type = DHCPINFORM DHCP: Maximum DHCP Message Size = 1472 bytes DHCP: Client Class Identifier = "SUNW.i86pc" ... DHCP: Message type = DHCPACK DHCP: DHCP Server Identifier = 10.18.138.22 DHCP: DNS Servers at = 10.18.138.43 DHCP: DNS Servers at = 10.18.138.22 DHCP: DNS Domain Name = lab.sun.com DHCP: NIS Servers at = 129.157.72.244 DHCP: NIS Domainname = lab.sun.com DHCP: Subnet Mask = 255.255.255.192 DHCP: Router at = 10.18.138.1 DHCP: Broadcast Address = 10.18.138.63 ...
Example: dhcpinfo(1) running at the client machine, where bge0 is the statically configured network interface, so the DHCPINFORM needs to be sent explicitly using ifconfig(1M):
# ifconfig -a
lo0: <UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
inet 127.0.0.1 netmask ff000000
bge0: <UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS>
inet 10.18.138.12 netmask ffffffc0
# ifconfig bge0 dhcp status
ifconfig: bge0: interface is not under DHCP control
# ifconfig bge0 dhcp inform
# dhcpinfo -i bge0 DNSdmain
lab.sun.com
# ifconfig bge0 dhcp drop
DHCP server looks up and running.
The default config file for the named(1M) DNS server, also known as network/dns/server in smf(5), is the /etc/named.conf.
The minimal /etc/named.conf may look like the following:
# cat /etc/named.conf
options {
directory "/var/named";
recursion no;
};
zone "lab.sun.com" {
type master;
file "lab.sun.com";
};
where:
* options -- server options:
Here is an example of the zone file:
# cat /var/named/lab.sun.com
$TTL 86400
lab.sun.com. IN SOA ascaris root.ascaris (
20070530 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ; minimum TTL of 1 day
)
IN NS ascaris
ascaris IN A 10.18.138.22
adorus IN A 10.18.138.43
_ldap._tcp._ns IN SRV 0 0 389 adorus
IN SRV 1 0 389 ascaris
IN TXT "NS_LDAP_SERVERS=10.18.138.43"
IN TXT "NS_LDAP_SEARCH_BASEDN=dc=lab"
IN TXT "NS_LDAP_CREDENTIAL_LEVEL=anonymous"
where:
* $TTL -- default Time To Live (sec.) for resource records;
+~---------- the priority of this target host | +~-------- relative weight for entries with | | the same priority | | +~------ service port | | | +~-- service host V V V V 0 0 389 adorus
Now try to start / restart the DNS server:
# svcadm -v enable dns/server svc:/network/dns/server:default enabled.
The verification lookup may be the following:
# nslookup -type=any _ldap._tcp._ns.lab.sun.com 10.18.138.22 Server: 10.18.138.22 Address: 10.18.138.22#53 _ldap._tcp._ns.lab.sun.com service = 0 0 389 adorus.lab.sun.com. _ldap._tcp._ns.lab.sun.com text = NS_LDAP_SERVERS=10.18.138.43 _ldap._tcp._ns.lab.sun.com text = NS_LDAP_CREDENTIAL_LEVEL=anonymous _ldap._tcp._ns.lab.sun.com text = NS_LDAP_SEARCH_BASEDN=dc=lab
So, we have the reference to the LDAP Name Service in DNS.
Here is the summary table, contains properties recognized by the native ldap client:
| Name in DUA profile | Name in Native LDAP | Default value |
|---|---|---|
| -- | NS_LDAP_FILE_VERSION | 2.0 |
| attributeMap | NS_LDAP_ATTRIBUTEMAP | |
| authenticationMethod | NS_LDAP_AUTH | |
| bindTimeLimit | NS_LDAP_BIND_TIME | 10 |
| certificatePath | NS_LDAP_HOST_CERTPATH | |
| credentialLevel | NS_LDAP_CREDENTIAL_LEVEL | |
| defaultSearchBase | NS_LDAP_SEARCH_BASEDN | |
| defaultSearchScope | NS_LDAP_SEARCH_SCOPE | one |
| defaultServerList | NS_LDAP_SERVERS | |
| followReferrals | NS_LDAP_SEARCH_REF | false |
| objectclassMap | NS_LDAP_OBJECTCLASSMAP | |
| preferredServerList | NS_LDAP_SERVER_PREF | |
| profileName | NS_LDAP_PROFILE | default |
| profileTTL | NS_LDAP_CACHETTL | 43200 |
| proxyDN | NS_LDAP_BINDDN | |
| proxyPassword | NS_LDAP_BINDPASSWD | |
| searchTimeLimit | NS_LDAP_SEARCH_TIME | 30 |
| serviceAuthenticationMethod | NS_LDAP_SERVICE_AUTH_METHOD | |
| serviceCredentialLevel | NS_LDAP_SERVICE_CRED_LEVEL | |
| serviceSearchDescriptor | NS_LDAP_SERVICE_SEARCH_DESC |
where:
* Name in DUA profile -- an attribute name used by the ldapclient(1M) and identified in RFC 4876 (http://www.ietf.org/rfc/rfc4876.txt);
NOTE: the NS_LDAP_FILE_VERSION property is not a part of DUA profile, it just used internally by the Native LDAP client.
Here is an example of the discover subcommand usage in the nscfg(1M):
# nscfg
nscfg> help discover
Usage: discover [ -n bec_name ] [ -w timeout_sec ]
Query DHCP and DNS to find Name Services back-end(s) available
on the network and store their configuration(s) under 'bec_name'
nscfg> discover
The name for the back-end configuration(s) is defaulting to 'auto'
Discover timeout is defaulting to 5 sec.
3 back-end(s) discovered
ldap auto
NS_LDAP_SERVERS = "10.18.138.43"
NS_LDAP_CREDENTIAL_LEVEL = "anonymous"
NS_LDAP_SEARCH_BASEDN = "dc=lab"
dns auto
domain = "lab.sun.com"
nameserver = "10.18.138.43 10.18.138.22"
nis auto
domainname = "lab.sun.com"
serverlist = "129.157.72.244"
nsswitch auto
passwd = "files ldap"
hosts = "dns [NOTFOUND=return] files"
...
PROF_profile_be_ldap = "auto"
PROF_profile_be_dns = "auto"
So, now there is the "auto" Name Service profile defined in the system:
# nsadm list
Profile 'auto' (LDAP:'auto', DNS:'auto')
Terms of Use
|
Privacy
|
Trademarks
|
Copyright Policy
|
Site Guidelines
|
Site Map
|
Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
© 2012, Oracle Corporation and/or its affiliates.