Saturday, 25 April 2015

Understanding traceroute working and output

There may be scenarios where one would like to know path that packet is following. We can trace path of packet by traceroute and tracert command.

Traceroute command is used in linux and tracert command is used under windows. These commands come handy when you are troubleshooting network related issues.

traceroute <destination url>

It will print complete list routers that packet visited to reach destination. In output, it lists out IP of routers.

Sometimes you will see '*' symbol in output of traceroute. '*' field in output depicts that required field is unable to fetch by traceroute. There are different reasons for getting '*' field in output but it will successfully reach to a destination.

If in the last line of output, destination is not visible then you can be sure that system is not able to reach to destination. Check following screenshot of traceroute command.

How it works:

Traceroute uses TTL(Time to live) field from IP packet. For those who are not aware of TTL field, this field describes lifetime of a packet. Usually value of TTL is set to 32 or 64. Each time a router receives any packet it decreases TTL value by one field. When TTL value becomes 0 then packet gets discarded and corresponding router sends error reply to a destination.

By using above situation, traceroute sends a packet using TTL value 1. Next router receives packet and sends error message to destination by decrementing TTL value to 0. This way traceroute go on by increasing TTL value and list out all the IP addresses between source and destination.

Modifying default options.

We can modify default option in traceroute command like TTL value, queries per hop etc. You can refer following link to modify default options in traceroute.

example:  traceroute

Wednesday, 1 April 2015

Install and Configure Samba server on linux

Samba is an open source software suite that provides file, directory and printer sharing between SMB/CIFS clients. In this tutorial we will explain how to configure SAMBA server.

First we will configure SAMBA server for anonymous file sharing and then we will configure authenticated SAMBA share.

In this tutorial, we will use following two machines.

Operating System: CentOS 6.0

Operatin System: Windows XP

Wednesday, 25 March 2015

Script to replace special characters from files or directories recursively.

As a linux administrator, there may be a situation where you may want to replace special characters from a file or directory name.

You can easily rename such file or folder by command "mv <old file name> <new file name>". But what if you want to replace special characters of all files and folders present inside a directory. And also it should replace special characters recursively.

You can use following script to replace special characters. In following script, we have replaced special characters by "_" character.

1) Following script will check for special characters in all files and directories present under /mailstore.

2) If you want to replace special characters from another directory then modify script by providing path name of new directory instead of /mailstore.

Monday, 23 March 2015

Mail migration via Imapsync tool

As an administrator in mail service provider company, there may be a situation where you may want to switch from old email provider to new one.

During migration from old to new setup, you may need to migrate emails from old server to new server.
You can migrate emails easily and freely via Imapsync utility.
Below is short description on working and usage of mails migration via Imapsync.

-To migrate mails from one server to another we use imapsync utility. It connects to server and synchronise mails from source to destination using IMAP protocol.

-Imapsync is a command line utility that incrementally and recursively transfers mails from one mailbox to another.

Imapsync command is available to download from epel.repo.

You need to install imapsync from epel repository on linux or you can download Imapsync from following link.

Install imapsync from epel repo.

For 32 Bit systems


For 64 bit Systems

Saturday, 11 October 2014

Migrating an existing LDAP database to a new computer.

I recently migrated the LDAP database from a old server to a new, fresh, powerful engine running on CentOS.
The hardest part of the migration was, without any doubt, the LDAP part. There’s nearly no documentation so here’s a little howto.

Open file slapd.conf located under /etc/openldap/slapd.conf. In debian based systems, this file is located under /etc/ldap/slapd.conf.

There are two ways of copying LDAP data. We will check out by ldapsearch/ldapadd command.

By using ldapsearch/ldapadd command, we do not need to stop slapd daemon on server. So we can extract and migrate data with zero downtime.

Wednesday, 26 February 2014

Download RPM Packages For Offline Installation On ...

OS knohow: Download RPM Packages For Offline Installation On ...: Linux is operating system where stability depends on updated software packages.Many of us install apps and updates daily on Redhat System.T...