As part of OpenSolaris 2008.05 installation, Caiman installer automatically configures your ethernet card  to provide a dynamic IP address. This is perfectly fine if you are working from your laptop.

However, if you, like me installed it on your workstation like Sun Ultra 40 then you might want to do necessary things like assigning a static IP address with NIS authentication enabled etc to transition the system as a developer workstation. Now that I have tried out OpenSolaris 2008.05 LiveCD for more than 2 weeks now, I guess I am now ready to make OpenSolaris 2008.05 as my default OS. If you haven't yet, you might wanna download a copy from here

So, here is how I went ahead with this transition

- Disable Network AutoMagic(NWAM) service and enable traditional networking service

svcadm enable physical:default 

svcadm disable physical:nwam

-  Now, you need to configure the static IP address for your ethernet interface. You could do this by using the network configuration GUI - 'System->Administration->Network GUI window to configure this as shown here

Note: I am assuming that you know the IP address and the default gateway that you need to provide here. If not, you might want to talk to your Network administrator before you attempt this.

- Now, I will restart all network services by doing some thing like

 svcadm restart milestone/network


Now, I will move ahead and configure NIS for my system. Here is how it
worked for me

- Setup your domain name of your current network. NIS server need to reside within this domain as well.  So, let us save the current domain name of your network to /etc/defaultdomain file.

    pfexec domainname <name here> 

   pfexec domainname > /etc/defaultdomain

For example,

    pfexec domainname sfbay.sun.com

    pfexec domainname  > /etc/defaultdomain

- Copy /etc/nsswitch.nis to /etc/nsswitch.conf

    pfexec cp /etc/nsswitch.nis /etc/nsswitch.conf

- Configure NIS Services

    pfexec ypinit -c

This above command will walk you through and ask you to provide NIS server IP addresses etc. and then bind the configured NIS server.

    pfexec /usr/lib/netsvc/yp/ypbind -broadcast

- Finally, enable NIS service and restart all network services..

    svcadm enable nis/client

    svcadm restart milestone/network

- Now, you should be able to verify if NIS is working on your system by doing something like

    ypcat -k passwd -> should return a whole bunch of NIS user names within your domain.

That is all there to do to translate a OpenSolaris system running in DHCP to a static IP address with NIS enabled



Comments:

Hi Sriram. I am new to solaris from the windows world. I can't seem to find any documentation on how to create a NIS or NIS+ server. Everything points to a client. Can an opensolaris server be configured into a NIS server? If so how? Thx, your blog has been invaluable.

Posted by Vic on June 08, 2008 at 09:24 AM PDT #

Hi
Setting up a NIS Server is very easy. If you are using Solaris 10 or OpenSolaris, the below link will be very useful for you
http://www2.petervg.nl/cgi-bin/docs.cgi?a=read&doc=103

hope this helps

Posted by Sriram Natarajan on June 09, 2008 at 03:43 PM PDT #

Hi Sriram,
Thank you very much for this post.
I'm new to solaris and was looking how to disable "nwam".
Thank you so much.

Posted by James on August 01, 2008 at 10:04 PM PDT #

Siram,

I installed 2008.11 and can't get the nis/client service to work. It won't get out of maintenance mode. The log say ypbind is already started. I've tried everything.

maintenance 17:01:21 svc:/network/nis/client:default

svc:/network/nis/client:default (NIS (YP) client)
State: maintenance since Tue Jan 27 17:01:21 2009
Reason: Start method exited with $SMF_EXIT_ERR_CONFIG.
See: http://sun.com/msg/SMF-8000-KS
See: ypstart(1M)
See: /var/svc/log/network-nis-client:default.log
Impact: This service is not running.

cat /var/svc/log/network-nis-client:default.log
[ Jan 27 17:01:21 Enabled. ]
[ Jan 27 17:01:21 Executing start method ("/lib/svc/method/yp"). ]
/lib/svc/method/yp: ypbind is already running.
[ Jan 27 17:01:21 Method "start" exited with status 96. ]

Posted by tom amiro on January 27, 2009 at 02:24 PM PST #

hi
did you try
pfexec svcadm disable nis/client

ps -ef | grep ypbind (make sure ypbind process is not running. if running already, you might want to kill it)

pfexec svcadm enable nis/client

also, take a look at (by doing some thing like less )
/var/svc/log/network-nis-client:default.log

to see why server is not starting.

Posted by Sriram Natarajan on January 27, 2009 at 03:24 PM PST #

Hi Sriram, I am new to solaris. I am trying to use it for my nas. I want to change from dhcp to static ip. That worked so far, but with static ip I can't get internet access i.e. with firefox. I checked already that I added my gateway ip. Its there but it still doesn't work. If I go back to dhcp it ist working. I tried the same config on an xp machine(change from dhcp to static, adding gateway) and it needs an entry for the dns adress. My gateway and dns adress are still the same. I am using a router with dsl as gateway.
Where can I add that for solaris?

Posted by Emil on February 21, 2009 at 07:25 AM PST #

Hi Sriram, an addition:
I reinstalled my system. First I configured static ip and test with firefox was ok. Second I want to enable remote control for xvnc (I did that first before I tried to connect to the internet. See "http://blogs.sun.com/timthomas/entry/a_simple_vnc_server_and"). After trying that I recognized that static ip and firefox isn't working anymore. I have no idea why...
At least I need remote control with graphic from xp machine. Any tip to set powersaving is also welcome. I will use it as a nas if it will work.
Greetings Emil

Posted by Emil on February 21, 2009 at 12:07 PM PST #

Hi
I assume you are using OpenSolaris 2008.12. If yes, please post your questions to
http://forums.opensolaris.com/forum.jspa?forumID=7

now, if you wanted to be able to connect to this box remotely, you might want to do the following

click on system -> preferences -> desktop sharing

you will see a remote desktop sharing window

Under sharing , click on allow other to use desktop

Under security, Unclick on ask you for confirmation.

now click on close,

that is it

Posted by Sriram Natarajan on February 23, 2009 at 12:06 PM PST #

A couple of updates:

- I had to add my NIS servers to /etc/host or else 'ypinit -c' complained.

- Like tom amiro, I had the problem: "ypbind is already running". I wonder if Sriram's instructions are incorrect for 2008.11; he says to run:

pfexec /usr/lib/netsvc/yp/ypbind -broadcast

but that looks like it is the process which makes the nis/client service fail to start (I noticed it had a PID that was numerically higher than the current shell I was running on recently booted box).

In short, I think leaving out the 'ypbind -broadcast' is okay.

- And one more thing, a useful command to examine the state of a given service is

svcs -xv nis/client

This will direct you to the correct log file in the event the services is not online.
--
Quentin

Posted by qneill on February 27, 2009 at 01:08 PM PST #

This would be more useful if it actually did not ASSUME that we are all using the GUI. Why is it so difficult to find a how-to for changing from DHCP to STATIC without having to use X?

Posted by Scott on March 17, 2009 at 10:55 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by natarajan