How to use DynDNS service for your home Linux server behind the linksys router

Objective: You setup a home Linux server behind your Linksys wireless router, the server is connect to the router using network cable directly, you'd like to provide web services to the Internet with the fixed domain name although your home boardband connection IP address is dynamic.

Concept: Use Dyndns.com dynamic DNS domain service (dyndns.org for example), and ddclient running on your home Linux server as daemon to update your router external IP address on dyndns.com periodically.


Steps:

  • firstly, consider your dynamic domain name (e.g. jephe.dyndns.org). You must make sure the port 80 must be accessed from Internet to your home router. As I know, some boardband provider disabled the port 80 service coming to your router, for me, I use port 8888 because port 80 is not usable.
  • register your name on www.dyndns.com, I used name 'jephe' and password xxxxxx
  • add a host service as jephe.dyndns.org
  • download ddclient from dyndns.com, untar it to your home Linux server and run 'mkdir /var/cache/ddclient, the log information will be saved to /var/log/messages.
  • generate the ddclient configuration for your host which is jephe.dyndns.org from dyndns.com configuration generation service.
  • put the configuration into /etc/ddclient/ddclient.conf (mkdir /etc/ddclient first)
  • by default, the generated ddclient.conf is using checkip.dyndns.org web ip check service to update your router IP address for jephe.dyndns.org which is using http service, if your boardbard provider uses transparent web proxy, the ip will be wrong, you should change to your router status page update method.
  • here is my configuraiton file /etc/ddclient/ddclient.conf
## ddclient configuration file
daemon=600 # check every 600 seconds
syslog=yes # log update msgs to syslog
mail-failure=jephe_wu@yahoo.com # Mail failed updates to user
pid=/var/run/ddclient.pid # record PID in file.

## Detect IP with our CheckIP server (comment out by jephe, use the router status page instead below)
#use=web, web=checkip.dyndns.com/, web-skip='IP Address'

####added by jephe
use=linksys, fw=192.168.100.1:80 # via Linksys's internet FW
fw-login=admin, fw-password=xxxxxx # FW login and password
## To obtain an IP address from FW status page (using fw-login, fw-password)
use=fw, fw=192.168.100.1/Status_Router.asp, fw-skip='IP Address:' # found after IP Address
#note: above IP Address: must have colon
#### end

## DynDNS username and password here
login=jephe
password=xxxxxx

## Default options
protocol=dyndns2
server=members.dyndns.org

## Dynamic DNS hosts
jephe.dyndns.org

  • cp sample-etc_rc.d_init.d_ddclient.redhat to /etc/init.d/ddclient
  • chkconfig ddclient on
  • that's it , start up ddclient services 'service ddclient start', then tail -f /var/log/messages to check status and /var/cache/ddclient/ddclient.cache for information.
  • done.
note:
1. if your router real ip is the same as the one shown on page 'http://checkip.dyndns.ocm', then you can just use the default generated configuration from dyndns.com for ddclient.
2. or you can use inadyn which is another very simple dynamic dns update client, it only support http updating method.

how to setup hardware montoring for HP Proliant server under RHEL 5

note: this article is obsolete, please refer to http://linuxtechres.blogspot.com/2009/09/installing-hardware-monitoring-system.html

Objective: After installing RHEl 5 on HP Proliant server, whenever there's hardware failure, especially hard disk failure and server operating system restart, we will be notified by email.


Steps:

to follow the prompt from screen, and give the default answer except for SNMP trap server IP address and community string

  • setup snmp trap server, make /etc/snmp/snmptrapd.conf as follows:
[root@jephe snmp]# more snmptrapd.conf
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com jephe.wu@domain1.com
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com jephe.wu@domain2.com

  • start up snmptrapd services and make it automatic for next restart

You can configure to send out email as well after generating snmp trap:
  • go to /opt/compaq to edit cma.conf trapemail line
trapemail /bin/mail -s 'server1 HP Insight Management Agents Trap Alarm' root
  • that's it.

How to use HP ILO to do NFS diskless installation of RHEL 5.1 remotely

Objective: install RHEL 5.1 OS for one of HP server in datacenter remotely from office with DVD ISO file and NFS method, it won't require you to have any disk from office.


Steps:

  • download RHEL 5.1 DVD ISO file, put it on the one of datacenter NFS server, can be different network segment from the destination server. (In this case, during installation, you might need to set default gateway properly so that the destination sever can talk to this NFS server)
  • configuring NFS server export, in /etc/exports, put this:
/sourcefile/rh51 *(ro)

  • put rhel-5.1-server-i386-dvd.iso to /sourcefile/rh51 folder
  • mount this iso somewhere to copy out boot.iso to your local Windows PC in office which will be used for HP ILO virtual CDROM media image for booting up RHEL installation
  • startup NFS server - service portmap start; service nfs start
  • use IE to access HP ILO address
  • go to virtual media to mount this boot.iso image
  • use virtual power to reset the server
  • press enter to boot up OS installation virtual boot.iso disk
  • untick high performance mouse, and close the virutal media window to make USB mouse to work
  • continue to install until finish
  • that's it, done.