Monday 27 November 2017

Install local NTP server and client configuration RHEL 6 & 7

Step 1

It's easy to install ntp server. Just enable the internet connection in the target server or client server and issue the following command in terminal.

yum install ntp -y

Step 2

Configure the ntp for server configuration. Goto the ntp configuration location and edit the ntp configuration file. /etc/ntp.conf

vi /etc/ntp.conf

If you want to use public ntp server then for your required timezone then choose it from online (http://www.pool.ntp.org/en/)

If you need local then just # all the available server list like below screenshot.

 

and allow your local or required subnets for ntp

restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap

also enable the log file on it with below line.

logfile /var/log/ntp.log

Add local clock for local ntp

server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

save and exit

Step 3

If you have firewall or iptables must allow 123 port and ntp service.

then start the ntp server with below command

service ntpd start

and enable it with below command

chkconfig ntpd on

verify the configuration with below command.

ntpq -p

and 

date -R

Step 4

Client server configuration.

Just install ntp like above.

yum install ntp -y

add the configuration in /etc/ntp.conf

# all the public pool already available on that and add like below.

server 192.168.2.3 prefer

save and exit

now start the service with below command

service ntpd start

chkconfig ntpd on

verify the connection

ntpq -p 

you can see the remote ip of your ntp server

if it not update then update with following command

ntpdate -u 192.168.2.3

that's all



No comments:

Post a Comment

Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...