Friday, March 25, 2011

How to change the timezone in redhat or centos linux system

Suppose your zone is CDT and you want to Change it to IST

The steps are as follows :

[root@server ~]# date
Fri Mar 25 00:28:23 CDT 2011
Remove the localtime file [You can take a backup copy if you want]
[root@server ~]# rm -rf /etc/localtime

Link the desired zone to /etc/localtime
[root@server ~]# ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
[root@server ~]# date
Fri Mar 25 10:59:02 IST 2011
[root@server ~]#

Thats it.

If you want to see time of any Country, Japan[say]. You can get it as.

[root@server ~]# zdump Japan
Japan  Fri Mar 25 14:32:48 2011 JST
[root@server ~]#

You can also do this with tzselect command. Read how to change timezone using the tzselect

How to create or bind a range of IP address to a redhat or centos linux system

Suppose you have a server with IP with OS rhel5

And you want to bind 10 IPs starting from to

All you have to do is create the following file and add these four lines.

[root@server ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0-range0

[root@server ~]#

IPADDR_START is the starting IP in the range.
IPADDR_END is the last IP in the range.
CLONENUM_START is the number that will be assigned to the first IP alias interface (eth0:0 in this example).