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
       address 192.168.1.10
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.1
[/sourcecode]

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

http://www.iceteks.com/forums/archive/t/3298/

http://linuxevangelist.blogspot.com/2007/04/setting-static-ip-for-opensuse-102.html

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


http://www.cyberciti.biz/faq/how-to-find-out-what-my-dns-servers-address-is/

  • 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:


http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch24_:_The_NTP_Server

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

http://doc.opensuse.org/products/opensuse/openSUSE/opensuse-reference/cha.netz.xntp.html

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.

http://en.wikipedia.org/wiki/Watch_%28Unix%29

No comments:

Post a Comment