Showing posts with label ntp. Show all posts
Showing posts with label ntp. Show all posts

Friday 20 October 2017

How to configure NTP server and client on Solaris 10 and Solaris 11

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

NTP Service on Solaris 10 and Solaris 11:

Solaris 10 used the SMF utility (Service Management Facility) and the NTP service is now managed by SMF (Service Management Facility). NTP daemon configured using Service management facility (svc:/network/ntp:default) and a bunch of sample ntp.conf files to quickly configure a machine as a client or as a server. On Solaris 11 only ships with NTP v. 4, the NTP v. 4 service is identified by the name ntp4. You can check the ntp status using below command.

!-[solaris]# svcs status ntp

STATE  STIME   FMRI
online 10:14:23 svc:/network/ntp:default

If you see the above command output it is shown that network time protocol services is enable and online on the server.

Steps for Configuring a NTP client:

Suppose your machine is just a client machine, then you can just take the /etc/inet/ntp.client file and copy it to /etc/inet/ntp.conf.

multicastclient 127.0.0.1

If you see the configuration it's a passive configuration for a Server host which listens for NTP server putting packets on the NTP multicast network, 127.0.0.1. If your machine is on LAN without NTP server then in that case we are not recveied any packet and for this we need to use Public NTP server for host.

In my case, I'm using the Indian pool in.pool.ntp.org and my configuration file contains:

server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Normally NTP requires a poll period to elapse before starting synchronizing your clock. If you want NTP to start immediately, which you most probably will if you're configuring a desktop environment, you can take advantage of iburst keyword, introduced in NTP v. 4: it instructs NTP to start the synchronization almost right away.

server 2.in.pool.ntp.org ibrust
server 1.asia.pool.ntp.org ibrust
server 3.asia.pool.ntp.org ibrust

You must make sure you're configuring NTP implementation corresponding to the syntax you're using.

Setting up the drift file:

The last thing which is remaining for NTP server setup in the client machine is to set up  drift file location. On my machine it is 

driftfile /var/ntp/ntp.drift

After setup the drift file configuration we will start the NTP servivce again 

!-[solaris]# svcadm restart svc:/network/ntp:default
!-[solaris]# svcs status svc:/network/ntp:default
STATE  STIME   FMRI
online 12:20:12 svc:/network/ntp:default 

Once the service is running, you can check which server you're using with ntpq, Please run the below command to check the ntpq.

!-[solaris]# ntpq -p

Setting up an NTP server:

Now in above step you see the NTP service has been started successfully, so now, you'll probably want to setup all of your machines.

If you're in a LAN, you can setup an internal NTP server which will provide data to other clients on your LAN. As before, you can take inspiration from the server configuration file shipped with Solaris 10 or Solaris 11, /etc/inet/ntp.server.

After setting up the drift file and the clients you're going to use, you can examine the other options and fine-tune them at your taste. Let's give a quick look at it.

server 127.127.XType.0

Now you have configured the NTP server properly. Please comment on the post if you have any suggestion.

Friday 7 July 2017

How to configure NTP Server on AIX Operating system

NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

Their are several ways to configure the NTP server in different linux servers but if you are doing configuration on AIX operating system it's seems tricky, So in this post you can aware about the step by step configuration of NTP in AIX.

Step by Step Configuration of NTP Server:

➤ In the initial step we must verify that we have check the available NTP server on AIX server. For this please run the below command.

ibm_aix:/>lssrc -ls xntpd
-----------------------------------------------
 Program name:    /usr/sbin/xntpd
 Version:         3
 Leap indicator:  00 (No leap second today.)
 Sys peer:        ntp.aix.in.com
 Sys stratum:     4
 Sys precision:   -18
 Debug/Tracing:   DISABLED
 Root distance:   0.014709
 Root dispersion: 0.066422
 Reference ID:    192.168.1.22
 Reference time:  dc721077.d3a8e000  Tue, Mar 14 2017  7:47:19.826
 Broadcast delay: 0.003906 (sec)
 Auth delay:      0.000122 (sec)
 System flags:    pll monitor filegen
 System uptime:   19248381 (sec)
 Clock stability: 0.000107 (sec)
 Clock frequency: 0.000000 (sec)
 Peer: ntp.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
 Peer: ntpuk.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            8520514      active
------------------------------------------------------

You can found the above output once you run the above command to check the available NTP server. On my AIX machine if you see the sys peer should show a valid server (ntp.aix.in.com). If the server is not showing any ntp server then we need to correct it by adding a server line into /etc/ntp.conf and will take restart of "xntpd" services.

Note : In this post I will use my dummy NTP name instead of real NTP server because of security reason.

➤ As your NTP server is not configured and it is show "insame" then you need to add manual entry on the NTP configuration file.

ibm_aix:/>vi /etc/ntp.conf

server ntp.aix.in.com
server ntpuk.aix.in.com

Once you added these ntp server entry manually on the configuration file then please take a restart of NTP services.

ibm_aix:/>stopsrc -s xntpd
ibm_aix:/>startsrc -s xntpd

Using above command we can stop and start the "xntpd" service on AIX operating system.

➤ In this step you need to again verify the status of newly added NTP server.

ibm_aix:/>lssrc -ls xntpd

It is taking some time that time because it synchronize process is running. Once the synchronization has been complete and you run the above command you can found the NTP server entry as describe in Step 1.

Step by Step configuration of NTP Client:

➤ On the client machine you need to again verify that you have a server suitable for synchronization or not. For this please run the below command.

ibm_aix:/>ntpdate -d ntp.aix.in.com
-----------------------------------------------------------
14 Mar 08:16:21 ntpdate[64356890]: 3.4y
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
server 192.168.1.22, port 123
stratum 16, precision -6, leap 11, trust 000
refid [63.15.23.11], delay 0.03688, dispersion 24.00334
transmitted 4, in filter 4
reference time:      00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: dc721745.3ff1b000  Tue, Mar 14 2017  8:16:21.249
transmit timestamp:  dc721746.3d08a000  Tue, Mar 14 2017  8:16:22.238
filter delay:  0.03688  0.05624  0.00000  0.00000
               0.00000  0.00000  0.00000  0.00000
filter offset: -0.00081 -0.00750 0.000000 0.000000
               0.000000 0.000000 0.000000 0.000000
delay 0.03688, dispersion 24.00334
offset -0.000812

14 Mar 08:16:23 ntpdate[64356890]: no server suitable for synchronization found
--------------------------------------------------------------------------

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server also verify that no firewalls are blocking port 123.

➤ If the no server suitable for synchronization then you must specify the xntpd server in /etc/ntp.conf.

ibm_aix:/>vi /etc/ntp.conf

server ntp.aix.in.com

Once you added the NTP server entry on client configuration file then restart the "xntpd" service again.

ibm_aix:/>startsrc -s xntpd

➤ If you want to start the xntpd service on boot time then you need to uncomment the below lines on the configuration file.

ibm_aix:/>vi /etc/rc.tcpip

Unconmment the following line

start /usr/sbin/xntpd "$src-running"

➤ Now verify the NTP server on client machine has been synchronized or not. Please use the same command which we used for checking the status.

ibm_aix:/>lssrsc -ls xntpd

This time on the NTP client machine sys peer should display the IP Address or name of your "xntpd" server. As you know it is taking some time to synchronization so you must wait for time.

Tuesday 4 July 2017

Step by Step Configuration of NTP Server on HP-UX Server

In this post, I would like to explain how we configure the NTP (network time protocol) server on HP-UX operating system server. In my recent post you can found the NTP configuration on Solaris and AIX platform. 

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network. It is basaiclly used for time synchronization on Unix servers.

Step by Step Configuration of NTP Server on HP-UX:

➤ In the first step we will check the configuration files of "xntpd" daemon. By default the configuration file for this daemon is "/etc/rc.config.d/netdaemons".

hpx:/> vi /etc/rc.config.d/netdaemons

######################################
# xntp configuration.  See xntpd(1m) #
######################################
#
#  Time synchronization daemon
#
# NTPDATE_SERVER: name of trusted timeserver to synchronize with at boot
# (default is rootserver for diskess clients)
# XNTPD:        Set to 1 to start xntpd (0 to not run xntpd)
# XNTPD_ARGS:  command line arguments for xntpd
#
# Also, see the /etc/ntp.conf and /etc/ntp.keys file for additional
# configuration.
#
export NTPDATE_SERVER=
export XNTPD=0
export XNTPD_ARGS=

This is default configuration entry of this file so for xntpd daemon we need to change the variable which is defined.

export NTPDATE_SERVER='ntp.in.pool.org'
export XNTPD=1
export XNTPD_ARGS=

Note: You must change the NTPDATE server name.

➤ For ntp config please set the correct timezone is setup in /etc/TIMEZONE file.

hpx:/> cat /etc/TIMEZONE
TZ=IST-5:30
export TZ

You can edit the file in vi editor and change the time zone as per your location.

➤ Now, we need to make some changes in NTP configuration files. 

hpx:/> cat /etc/ntp.conf
#Configuration NTP des serveurs
server ntp.in.org.com
server ntpin.in.org.com

You need to replace ntp server name accordingly. In my post I will use dummy server name.

➤ After setting the NTP server name we need to restart the NTP service on HP-UX operating system and verify the ntp configuration.

hpx:/> /sbin/init.d/xntpd restart

hpx:/> ntpq -p

If it is showing you correct ntp server information now. You can match these information with the NTP server name which we use in above step.

Monday 29 May 2017

Important Linux TCP/IP Port Number

Please find the below complete list of TCP/IP port number in Linux system.

➤ 20- FTP ( File Transfer Protocol) -It is used for transfer the data using ftp connection

➤ 21- FTP Control - It is used this port for ftp connection.

➤ 22- SSH (Secure Shell)- It is used for connecting the secure shell which using SSL encryption.

➤ 23- TELNET - It is used for insecure remote connection.

➤ 25- SMTP (Simple Mail Transfer Protocol)- It is used as a mail transfer agent for email server.

➤ 53- DNS (Domain name system)- It is used for translate the domain name to IP address.

➤ 67- BOOTP (Bootstrap Protocol)- Used for automatically assign the IP address to network device.

➤ 68- DHCP (Dynamic host configuration protocol)- It is a network protocol to enable a server to automatically assign an IP address to system.

➤ 69- TFTP (Trivial file transfer protocol)- Used this protocol in PXE Boot services.

➤ 80- HTTP ( Hypertext Transfer protocol)- Used for WWW web connection.

➤ 88- Kerberos Protocol

➤ 110- POP3 (Post Office Protocol)- Used as a mail delivery agent.

➤ 113- XINETD (Extended Internet Daemon)

➤ 115- SFTP ( Secure File Transfer Protocol)

➤ 123- NTP (Network time protocol)- Used for time syncing uses UDP protocol

➤ 137- NetBIOS (Network basic Input/Output system)

➤ 139- NETBIOS-SESSION Service

➤ 143- IMAP (Internet Message Access Protocol)

➤ 161- SNMP (Simple Network Management Protocol)- Used for network monitoring.

➤ 389- LDAP (Lightweight Directory Access Protocol)

➤ 443- HTTPS ( Hypertext Transfer protocol secure)- Used with SSL encryption.

➤ 445- SMB (Server Message Block or SAMBA)

➤ 514- Syslogd (udp port)

➤ 840- NIS (Network Information Service)

➤ 873- rsync Used for file synchronization.

➤ 990- FTPS (File transfer protocol secure)

➤ 993- IMAPS ( For Secure Connection)

➤ 995- POP3s ( Mail delivery agent with secure connection)

➤ 2049- NFS ( Network file sharing)