Saturday, 10 January 2009

 

Setting up NTP on Debian

Introduction

What is NTP? It is a UDP protocol for correcting system clocks.

Why am I using it? I've got a couple of Debian based machines running on VMWare, and the clock keeps going out of sync. I want to have as little overhead on these boxes as possible, so I set up an NTP Daemon on the VMWare host, and then the NTP Clients on the VMWare Guests.

My Sources

I followed this guide, but it was a little unclear, so I figured I'd follow it up and add my notes to the mix.

Setting up the server

Firstly, I had to get the NTPd running on the server. The Host machine is running Debian, but if you aren't, then provided you can install an NTP server on the server, you'll be OK.

I installed ntpdate and ntp from the Debian repositories using the following apt command:
apt-get install ntp ntpdate
Next, I stopped the NTPd using this command:
/etc/init.d/ntp stop
I then ran the ntpdate command (which won't run while the ntpd is running) to bring the clock into sync with the upstream server:
ntpdate pool.ntp.org
If you've got a more local NTP server, use that in place of the pool.ntp.org.

Next, use the date command to ensure the clock is closer to being in sync.

  • If you've got a local NTP server, you should edit the file /etc/ntp.conf and either add to the server lines (if you also want to keep access to the existing pool of NTP servers) or comment out the existing server lines.

  • Add your server in the format (where the server's IP address is 111.222.333.444):
    server 111.222.333.444
  • Start the NTP daemon using the command:
    /etc/init.d/ntp start
    Finally, type the following command:
    ntpq -p
    This may take a few moments, but should return some sort of text like the following:
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
    11.111.11.11 222.222.2.222 2 u 21 64 377 0.603 65.748 7.470
    Setting up the clients

    Essentially, the steps here are exactly the same as with the server, except, where you point all of your NTP sources at a common IP address for the host machine.

    Labels: , , , ,


     

    Sending E-Mail Using Sendmail Without A DNS Server

    I was struggling with this issue, until I found this post.

    If you're building your server in a DMZ without a DNS server, your first step is to update the Smart Host entry (listed as DS on the sendmail.cf file or SMART_HOST in the sendmail.mc file) to show the following

    DSsmtp:[123.123.123.123]

    OR

    dnl define(`SMART_HOST',`smtp:[123.123.123.123]')

    Update: 2009-02-09

    While trying to implement this on a box, I've noticed that there's a slight addition to make. You'll also need to make this change in the submit.cf file if you're editing the cf files directly.

    If you want your e-mails to come from a specific DNS name, search for the line beginning Df (which will probably be commented out) and make your hostname show in there. (This hint found here)

    Labels: , , ,


    Friday, 9 January 2009

     

    Do you have slow SCP speeds? If so, try this

    A colleague pointed me at this hint recently which in turn was a hint obtained from another website, that the author was unable to credit, due to him having lost the link.

    Edit your /etc/sysctl.conf file and add the following text to the bottom:
    net.ipv4.tcp_window_scaling = 1
    net.ipv4.tcp_rmem = 4096 87380 16777216
    net.ipv4.tcp_wmem = 4096 65535 16777216
    net.ipv4.tcp_mem = 8388608 8388608 16777216
    As to whether this is appropriate guidance any more, I don't know, but I thought I'd share it to make sure it doesn't get lost in the ether.

    Labels: , ,


    This page is powered by Blogger. Isn't yours?

    Subscribe to Posts [Atom]