Friday, July 18, 2008

Cambiar el hostname en Solaris 10

Cambiar el hostname en los siguientes archivos:

/etc/nodename
/etc/hostname.*interface
/etc/inet/hosts
/etc/inet/ipnodes

Renombrar el directorio debajo de /var/crash.

# cd /var/crash
# mv oldname newname

Ejecutar el comando dumpadm -s /var/crash/

Ejecutar el comando hostname

Reiniciar el servidor.

Configurar la red en Solaris 10

Configurar la red en Solaris 10:

1. Añadir el nombre del host a /etc/nodename.
2. Añadir el nombre y la IP a /etc/hosts.
3. Añadir el hostname que se añadió a /etc/hosts al archivo /etc/hostname.interface. Donde interface es el nombre de la interfaz de red.

Por ejemplo, el contenido de mi /etc/hostname.bge0 es solaris-devx.

4. Añadir la información correspondiente a /etc/resolv.conf.
5. Añadir la IP del gateway (default router) a /etc/defaultrouter.
6. Reiniciar el servicio mediante svcadm restart svc:/network/physical:default.

Thursday, July 17, 2008

Activate NTP Service in Solaris

In our particular case we just need that the machine has its time synchronized:

At /etc/inet directory we have two files:

ntp.client
ntp.server


Copy the /etc/inet/ntp.client file into /etc/inet/ntp.conf.

The content of that file is as follows:

# ident "@(#)ntp.client 1.3 00/07/17 SMI"
#
# /etc/inet/ntp.client
#
# An example file that could be copied over to /etc/inet/ntp.conf; it
# provides a configuration for a host that passively waits for a server
# to provide NTP packets on the ntp multicast net.
#

multicastclient 224.0.1.1


This should work but the routers generally drops this kind of multicast messages, so we must do some changes in the file.

driftfile /var/ntp/ntp.drift
restrict 127.0.0.1
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
statsdir /var/ntp/ntpstats/


Make sure the /var/ntp/ntp.drift file exists (touch /var/ntp/ntp.drift).

Make sure the directory /var/ntp/ntpstats/ exists.

Start the service with svcadm enable ntp.

You could check /var/adm/messages and /var/svc/log/network-ntp:default.log logs.

You could query the service with ntpq –p.

remote refid st t when poll reach delay offset disp
==============================================================================
smtp.housefront enigma.wiredgoa 3 u 865 1024 377 105.15 10.086 0.43
*time.nist.gov .ACTS. 1 u 75 1024 377 110.12 0.315 1.59
+dnscache1.izoom ntp2.twc.weathe 2 u 160 1024 377 68.21 -32.835 11.49


The ntpdate host command could be used for a one time updating of the system time.