Monday, August 8, 2011

Static IP on debian / What is my DNS?/ Network Time Protocol (ntp) / watch

  • In opensuse is pretty straight forward using the Network Manager module. In debian  you only need to tweak your /etc/network/interfaces file. For example:

[sourcecode language="bash"]
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0

iface eth0 inet static

of course, you'll need to restart your networking service afterwards.

  • In order to know what your DNS is, just cat the content of the /etc/resolv.conf file.

  • network time protocol aka 'ntp' . Is an essential requirement for running a cluster without glitches, so the nodes are in agreement about the current time. Configuring a ntp server in opensuse is as easy as it gets, but I needed to get acquainted with a general approach, and found this nifty guide:

and although redundant, here's some information to configure it in opensuse.

One thing that caught my attention is that there's about +-1 second offset between server/clients. It seems that it gets more accurate in time. Some tutorials advise using ntpdate, but this is no longer encouraged as  ntpd -q, is a more appropriate way of doing an initial synchronization.

  • watch. As I was connecting to a remote system running the ntp client, I needed to get a hold of that system's hour in a basis of seconds in order to compare the exact hour between nodes. So I asked the linux guru, and this is what I got:

watch -n 1 'date'

simple,elegant,and did the trick.

No comments:

Post a Comment