Introduction to VMware Photon OS
February 8, 2017 – 3:34 pmI wanted to play with Photon, so I was looking for some ideas/purposes to deploy a Photon VM in a Windows “shop” 🙂
There’s always some docker packages you can find that can be useful (SMTP server for test/dev environments for example). One good use I found is to build our internal NTP server.
Here’s how I do it:
Create DNS record
an A record for the hostname, and a CNAME for an alias to refer to it in your various systems (time.mylab.com for example).
Set Static IP Address
mv /etc/systemd/network/10-dhcp-eth0.network /etc/systemd/network/static.network
then edit the static.network file using VI
[Match]
Name=eth0
[Network]
Address=10.10.10.10/24
Gateway=10.10.10.1
DNS=10.10.10.50
Domains=mylab.com
Set Hostname
hostnamectl set-hostname MYNTP.MYLAB.COM
hostname MYNTP
reboot
Disable IPTABLES (I know, not the most secure thing but that’s what I do)
Edit /etc/systemd/scripts/iptables
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
Update OS
tdnf update
set timezone
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
Install nano
tdnf install nano
Enable NTP Server
tdnf install ntp
nano /etc/ntp.conf
— add the following configs:
server 0.ca.pool.ntp.org
server 1.ca.pool.ntp.org
server 2.ca.pool.ntp.org
server 3.ca.pool.ntp.org
tinker panic
restrict 10.0.0.0 netmask 255.0.0.0 nomodify notrap
restrict default kod nomodify notrap nopeer
restrict 127.0.0.1
restrict -6 ::1
driftfile /var/lib/ntp/drift/ntp.drift
—
Start service
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
Troubleshooting commands
ntpq -p
date -R
ntpdate -q 0.ca.pool.ntp.org 1.ca.pool.ntp.org