Fake SNTP server for testing
I want to setup an SNTP server for testing purposes that
- can be set to any arbitrary value (for example testing DST behaviour of the device under test)
- serve only on
eth1
on my RedHat Enterprise box. I want to limit it into a single interface (or192.168.1.255/24
network) so that it does not disrupt anything.
What is the easiest way to create such a setup? My must be always online on the other interface for e-mail etc. so I cannot set its time randomly.
Solution 1:
ntpdsim
is what you want:
The ntpdsim program is an adaptation of the ntpd operating system daemon. The program operates as a discrete time simulator using specified systematic and random driving sources. It includes all the mitigation and discipline algorithms of the actual daemon, but with the packet I/O and system clock algorithms driven by simulation. Most functions of the real ntpd remain intact, including the monitoring, statistics recording, trace and host name resolution features. Further information on the simulator is on the NTP Discrete Event Simulator page.
The simulator is most useful to study NTP behavior in response to time and/or frequency transients under specific conditions of network jitter and oscillator wander. For this purpose the daemon can be driven by pseudorandom jitter and wander sample sequences characteristic of real networks and oscillators. The jitter generator produces samples from a Poisson distribution, while the wander generator produces samples from a Guassian distribution.
http://www.eecis.udel.edu/~mills/ntpsim.html
http://www.eecis.udel.edu/~mills/ntp/html/ntpdsim.html
Solution 2:
Why do you just want SNTP and not regular NTP? either way the best way is the usual 'ntpd', OpenNTP or 'clockspeed'.