LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Client unable to listen to NIS domain server (http://www.linuxquestions.org/questions/linux-newbie-8/client-unable-to-listen-to-nis-domain-server-802167/)

naman.jandial 04-15-2010 07:37 AM

Client unable to listen to NIS domain server
 
Client unable to listen to NIS domain server
I have configured an NIS server, which is working fine.
I then configured an NIS client to share some like passwd, shadow, etc.

By default the client was trying to communicate to the NIS server using the broadcast method as:
Quote:

domain naman.com broadcast
, but I wanted it to communicate hrough the client-server connection. Hence for that I edited the /etc/yp.conf file as:
Quote:

domain naman.com server station51.naman.com
as station51 is the host name for my server.

I then run the
Code:

service ypbind restart; chkconfig ypbind on
and it tries to communicate to the server and is able to Listen to the domain server.

However if I restart the client computer, it fails to communicate or Listen to the domain server. Once I login to the pc, I then check the /etc/yp.conf file and it switched back to the broadcast method.

Is there any way that I can make this entry: domain naman.com server station51.naman.com permanent so that even after the reboot it should communicate using the client-server connection rather than the broadcast connection.

Please help.

Thanks

engelienart 04-15-2010 07:52 AM

Everything about NIS, is found here:

http://www.linux-nis.org/nis-howto/

Sorry, that's all the help I can give you.

naman.jandial 04-16-2010 12:20 PM

Thanks engelienart for the link.

I tried to follow the documentation, but still stuck at the same problem.

I noticed where the problem is, but don't know the cure.

If I provide static IP to the client, then the entry in /etc/yp.conf remains as:
domain naman.com server station51.naman.com even after restarting the network services and it even survives the reboot and it continues to bind to the server.

But if I provide a dynamic IP to the client, then the entry in /etc/yp.conf changes to
domain naman.com broadcast after restarting the network srvices or reboot, and hence it doesn't binds to the server.

Is it possible to fix this entry: domain naman.com server station51.naman.com in /etc/yp.conf permanently so that it continues to bind even after restart without any problem.

Thanks

engelienart 04-20-2010 02:57 AM

Maybe edit the file /etc/yp.conf and make it readonly?

In the man of ypbind it says:

Code:

      A  broadcast  entry  in  the  configuration  file  will  overwrite  a
      ypserver/server entry and a ypserver/server  entry  broadcast.  If  all
      given server are down, ypbind will not switch to use broadcast.  ypbind
      will try at first /etc/hosts and then DNS for resolving the hosts names
      from /etc/yp.conf.  If ypbind couldn’t reconfigure the search order, it
      will use only DNS.  If DNS isn’t available,  you  could  only  use  IP-
      addresses  in  /etc/hosts.  ypbind  could  only reconfigure the search
      order with glibc 2.x.  If the -broadcast option  is  specified,  ypbind
      will  ignore  the configuration file.  If the file does not exist or if
      there are no valid entries, ypbind exit.

Maybe u should try IPadresses?

naman.jandial 04-21-2010 06:30 PM

Thanks engelienart,

I tried making the /etc/ypconf file as read-only but you won't believe it, once I restarted it it switched back to read-write mode, hence the entry remained as broadcast.

I also tried using the ipaddress, but no go.

This happens only when the client is accquiring IP address dynamically, there are no problems if I use a static IP.

But if u r an administrator and you have manage a large number of machines, I guess assigning a static IP would be a cumbersome process.

Any guesses how can I fix this and allow the client to accquire IP through DHCP?

Thanks again for your help

engelienart 04-22-2010 04:09 AM

Using a DHCP that gives static IPadresses based on MACadres?
Well for my small organisation (10 WorkStations), I can do that.
I will think about it some more :(

naman.jandial 04-22-2010 07:08 PM

hmmm, Mac Binding seems to be a better option.
Will try that and let u know

naman.jandial 04-27-2010 02:25 PM

Tried mac binding, still the same.
Switches back to domain naman.com broadcast

If its a bug, is there a fix?

naman.jandial 04-27-2010 07:20 PM

OK I have figured it out and resolved the issue, now the client is able to BIND TO THE NIS DOMAIN SERVER without any problems, whether I assign a static IP or it accquires through DHCP.

To accomplish that I modified the /sbin/dhclient-script file, since this is the file that was overwriting the /etc/yp.conf file.

I am using RHEL 5.2 so will mention the steps accordingly.

Code:

vim /sbin/dhclient-script
search for yp.conf within the file.
Then locate the string that reads:
Quote:

echo '# generated by /sbin/dhclient-script' > /etc/yp.conf
Then locate the string that reads:
Quote:

echo "domain $new_nis_domain broadcast" >> /etc/yp.conf
and change it as:
Code:

echo "domain $new_nis_domain server $nameserver" >> /etc/yp.conf
Save and exit the file:

Code:

service network restart
service ypbind restart; chkconfig ypbind on

Voilla!! the baby listens to papa now :)

I am so happy to fix this.

I posted here, so that someone may benefit from my experience, finally, I learnt something new. AWESOME.


All times are GMT -5. The time now is 09:26 PM.