Sunday, May 29, 2011

Linux Configure Tata Indicom Photon+ Mobile Broadband

EC1260 HSIA USB modem support download speed of upto 3.1Mbps and upload speed of upto 1.8Mbps.
The driver for this modem is provided with Linux kernel 2.6.20 or above. In other words any modern Linux distribution will able to use this modem out of box. The following instructions are tested on:
  1. Debian Linux 5.x
  2. Ubuntu Linux 9.10
  3. Fedora Linux 12 / Redhat & friends

Step #1: Get Required Software

=> wvdial - Text based PPP dialer with built-in intelligence.
OR
=> gnome-ppp - GUI based modem Internet c
onnection tool for the GNOME Desktop.

Linux Drivers For EC1260 CDMA HSIA USB modem

The following drivers are used by Linux:
  • usbserial - USB serial driver (modem driver).
  • usb-storage - USB pen driver.

Install Required Software

You can install any one of the above program from the CD/DVD or via the Internet (connect using Ethernet or any other medium). Once connected install the wvdial package under Debian / Ubuntu Linux, run:
# apt-get install wvdial gnome-ppp
If you are using Redhat / Fedora / CentOS Linux, enter:
# yum install wvdial

Step #2: Stop Services

Turn off other networking interface (such as vmware or virtual box networking):
# /etc/init.d/vmware stop
# ifconfig eth0 down

Make sure you remove other usb storage devices such as pen or external hard disk and remove usb-storage driver:
# rmmod usb_storage
Above will make sure you get correct routing table (you can turn on all other services once connected).
Note if you know how to set static routing using route command skip the step # 2.

Step #3: Install Modem

Insert the USB modem and monitor your /var/log/messages file, enter:
# tail -f /var/log/messages
Sample outputs:
Dec  4 10:08:30 vivek-desktop kernel: [ 3957.760015] usb 4-2: new full speed USB device using uhci_hcd and address 4
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.932103] usb 4-2: configuration #1 chosen from 1 choice
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.959732] Initializing USB Mass Storage driver...
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961031] scsi15 : SCSI emulation for USB Mass Storage devices
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961146] usbcore: registered new interface driver usb-storage
Dec 4 10:08:30 vivek-desktop kernel: [ 3957.961150] USB Mass Storage support registered.
Dec 4 10:08:30 vivek-desktop kernel: [ 3958.240046] usb 4-2: USB disconnect, address 4
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.520015] usb 4-2: new full speed USB device using uhci_hcd and address 5
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.703066] usb 4-2: configuration #1 chosen from 1 choice
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.717371] scsi19 : SCSI emulation for USB Mass Storage devices
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727347] USB Serial support registered for GSM modem (1-port)
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727388] option 4-2:1.0: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727481] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB0
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727495] option 4-2:1.1: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727550] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB1
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727563] option 4-2:1.2: GSM modem (1-port) converter detected
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727617] usb 4-2: GSM modem (1-port) converter now attached to ttyUSB2
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727639] usbcore: registered new interface driver option
Dec 4 10:08:31 vivek-desktop kernel: [ 3958.727642] option: v0.7.2:USB Driver for GSM modems
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.714729] scsi 19:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 0
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.717721] scsi 19:0:0:1: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.746710] sr3: scsi-1 drive
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.746951] sr 19:0:0:0: Attached scsi generic sg6 type 5
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.747085] sd 19:0:0:1: Attached scsi generic sg7 type 0
Dec 4 10:08:36 vivek-desktop kernel: [ 3963.807173] sd 19:0:0:1: [sdd] Attached SCSI removable disk
Type the following command to display information about USB buses in the system and the devices connected to them, enter:
# lsusb
Sample outputs:
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 12d1:140b Huawei Technologies Co., Ltd.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Step #4: wvdial Configuration

The wvdialconf command detects your modem, its maximum baud rate, and a good initialization string and generates or updates the wvdial configuration file based on this information. Type the following command:
# wvdialconf
Sample outputs:
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyS1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: +GMI: HUAWEI TECHNOLOGIES CO., LTD
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
WvModem<*1>: Cannot get information for serial port.
ttyUSB2<*1>: ATQ0 V1 E1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB2<*1>: Modem Identifier: ATI -- Manufacturer: +GMI: HUAWEI TECHNOLOGIES CO., LTD
ttyUSB2<*1>: Speed 9600: AT -- OK
ttyUSB2<*1>: Max speed is 9600; that should be safe.
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB2: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
Here is sample updated /etc/wvdial.conf file:
[Dialer Defaults]
Modem = /dev/ttyUSB2
Phone = #777
Username = internet
Password = internet
New PPPD = yes
stupid Mode = 1

How Do I Connect To The Internet?

Simply type the wvdial command, enter:
# wvdial
Sample outputs:

Fig.01: Configuring Photon+ Huawei EC 1260 in Linux (connected via ppp)
Fig.01: Configuring Photon+ Huawei EC 1260 in Linux (connected via ppp)

Test The Internet Connection

Send ping request, enter:
ping google.co.in
ping cyberciti.biz

If you cannot ping ...

Edit /etc/resolv.conf, enter:
# vi /etc/resolv.conf
Update it as follows:
nameserver 202.54.12.164
nameserver 202.43.29.5
Save and close the file. Test it again:
# ping google.com
Once connected you can start your vmware or bring back eth0 connections. Make sure routing setup correctly for other network device:
# route -n
To disconnect the Internet session (wvdia dialar) simply hit [CTRL]+[C] or run killall command:
# killall wvdial

Saturday, May 21, 2011

Debian Linux Configure Wireless Networking With WPA2

I've Atheros AR5001 wifi a/b/g card detected and supported natively under Linux. How do I configure my wireless card with WPA2 networking using /etc/network/interfaces file?

Wi-Fi Protected Access II (WPA2 i.e. IEEE 802.11i) is security protocols for wireless communication. It introduces CCMP, a new AES-based encryption mode with strong security in mind. Under Debian Linux you need to install wpasupplicant to support for WPA and WPA2 networks. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands as root user:

Step #1: Install wpasupplicant

To install wpasupplicant simply type the following command as root user:
# apt-get install wireless-tools
OR
# apt-get install wpasupplicant

Step #2: Verify WiFi / Wireless Card Is Detected

Use the lspci command to verify that card is detected:
# lspci
# lspci | grep -i wlan
# lspci | grep -i wireless
# lspci | grep -i wifi
# lspci -nn | grep Network

Sample outputs:
0c:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300
This page explains the lspci command to find out Wireless driver chipset information under Linux. Or you can go to Linux wireless LAN support page and make sure your card is listed as supported device under Linux. You can also see your wireless interface name using the following command:
# ifconfig -a
OR
# dmesg | grep -i wlan
# dmesg | grep -i wireless

Step #3: Configure WPA2

Edit /etc/network/interfaces file, enter:
# vi /etc/network/interfaces
Setup wlan0 with the SSID and PSK as follows:
 
auto wlan0
iface wlan0 inet dhcp
wpa-ssid YOUR-SSID-HERE
wpa-psk YOUR-PASSWORD-HERE
 
Make sure you use strong pass-phrase. Save and close the file. You can now connect to the interface, enter:
# ifup wlan0
# ifconfig wlan0
# ping router-ip-here
# ping google.com

OR you can restart the networking service using any one of the following method:
# /etc/init.d/networking restart
OR
# service networking restart

Get Info About Your Network

To see more info about wifi, enter:
# iwconfig wlan0

Scan Your Wireless Network

Type the following command:
# iwlist wlan0 scan

Sample /etc/network/interface Config File

 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
 
# The wireless network interface with dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-ssid nixcraft
wpa-key-mgmt WPA-PSK
wpa-group TKIP CCMP
wpa-psk YOYR-PASSWORD-HERE
 

Troubleshooting wpa_supplicant

See wpa_supplicant log file /var/log/wpa_supplicant.*.log using the tail, more, or grep command:
# tail -f /var/log/wpa_supplicant.wlan0.log
# grep 'something' /var/log/wpa_supplicant.wlan0.log

A Note About GUI Configuration Tool

You can use NetworkManager - a graphical interfaces for GNOME and KDE. If you are using NetworkManager, avoid using Debian's /etc/network/interfaces file. See this page for more information about Gnome / KDE wireless network config tool.

Recommended readings:

Anytime you need assistance with Linux wifi configuration option, turn to the following man page first. It will give you detailed information, parameters and switches for wifi configurations. For example, man 5 interfaces opens the man page for the interfaces network configuration file:
$ man 5 interfaces
$ man 8 wpa_supplicant
$ man 8 iwconfig
$ man 8 iwlist

Howto: Upgrade Linux Kernel

How do I upgrade my Linux kernel? I would like to upgrade kernel without compiling from source code i.e. binary upgrade. How do I perform the actual upgrade of the kernel in Linux?

You need to compile kernel only if:
=> You need custom made kernel for specific task such as embedded kernel.
=> Apply third party security patches.
=> You need to apply specific patch to Linux

Upgrade of the kernel in Red Hat enterprise Linux version <= 4.x

If your system is registered with Red Hat Network (RHN), then you can use the up2date command as follows:
# up2date -f kernel
For SMP kernel (multi core or multiple CPU) use command:
# up2date -f kernel-smp

Upgrade of the kernel in Fedora Linux / CentOS / RHEL 5

Use yum command to upgrade kernel:
# yum update kernel
If you have downloaded RPM file use rpm command:
# rpm -ivh kernel*

Upgrade of the kernel in Debian or Ubuntu Linux

Use apt-get command. First find your kernel version:
$ uname -r
Next find available kernel images:
$ apt-cache search linux-image
Now install kernel by explicitly specifying version number:
# apt-get install linux-image-x.x.x-xx
OR
$ sudo apt-get install linux-image-x.x.x-xx

Linux: TMOUT To Automatically Log Users Out

How do I auto Logout my shell user in Linux after certain minutes of inactivity?

Linux bash shell allows you to define the TMOUT environment variable. Set TMOUT to automatically log users out after a period of inactivity. The value is defined in seconds. For example,

 
export TMOUT=120
 
The above command will implement a 2 minute idle time-out for the default /bin/bash shell. You can edit your ~/.bash_profile or /etc/profile file as follows to define a 5 minute idle time out:
 
# set a 5 min timeout policy for bash shell
TMOUT=300
readonly TMOUT
export TMOUT
 
Save and close the file. The readonly command is used to make variables and functions readonly i.e. you user cannot change the value of variable called TMOUT.

How Do I Disable TMOUT?

To disable auto-logout, just set the TMOUT to zero or unset it as follows:
$ export TMOUT=0

or
$ unset TMOUT

Please note that readonly variable can only be disabled by root in /etc/profile or ~/.bash_profile.

HowTo: Upgrade Red Hat Enterprise Linux 6 to to v6.1

RHEL version 6.1 has been released with new features and improvements. How do I upgrade my HP server running RHEL v6.0 to v6.1 using RHN?

You can upgrade the system using the yum command itself. Make a backup - it cannot be stressed enough how important it is to make a backup of your system before you do this. Most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell.
# uname -r
Sample outputs:
2.6.32-71.29.1.el6.x86_64
You can see current RHEL release details using cat command as follows:
# cat /etc/redhat-release
Sample outputs:
Red Hat Enterprise Linux Server release 6.0 (Santiago)
To upgrade RHEL to v6.1, enter:
# yum -y update
Sample outputs:
Dependency Installed:
abrt-plugin-mailx.x86_64 0:1.1.16-3.el6 gnutls-utils.x86_64 0:2.8.5-4.el6
libcacard.x86_64 0:0.1.2-2.el6 radvd.x86_64 0:1.6-1.el6

Updated:
Red_Hat_Enterprise_Linux-Release_Notes-6-en-US.noarch 0:1-26.el6
abrt.x86_64 0:1.1.16-3.el6
abrt-addon-ccpp.x86_64 0:1.1.16-3.el6
abrt-addon-kerneloops.x86_64 0:1.1.16-3.el6
abrt-addon-python.x86_64 0:1.1.16-3.el6
abrt-cli.x86_64 0:1.1.16-3.el6
abrt-libs.x86_64 0:1.1.16-3.el6
abrt-plugin-logger.x86_64 0:1.1.16-3.el6
abrt-plugin-rhtsupport.x86_64 0:1.1.16-3.el6
abrt-plugin-sosreport.x86_64 0:1.1.16-3.el6
at.x86_64 0:3.1.10-43.el6
audit.x86_64 0:2.1-5.el6
audit-libs.x86_64 0:2.1-5.el6
audit-libs-python.x86_64 0:2.1-5.el6
augeas-libs.x86_64 0:0.7.2-6.el6
authconfig.x86_64 0:6.1.12-5.el6
avahi-libs.x86_64 0:0.6.25-11.el6
bash.x86_64 0:4.1.2-8.el6
bfa-firmware.noarch 0:2.3.2.3-1.el6
bind-devel.x86_64 32:9.7.3-2.el6
bind-libs.x86_64 32:9.7.3-2.el6
bind-utils.x86_64 32:9.7.3-2.el6
binutils.x86_64 0:2.20.51.0.2-5.20.el6
blktrace.x86_64 0:1.0.1-4.el6
busybox.x86_64 1:1.15.1-11.el6
coreutils.x86_64 0:8.4-13.el6
coreutils-libs.x86_64 0:8.4-13.el6
cpp.x86_64 0:4.4.5-6.el6
cracklib.x86_64 0:2.8.16-4.el6
cracklib-dicts.x86_64 0:2.8.16-4.el6
crda.x86_64 0:1.1.1_2010.11.22-1.el6
cronie.x86_64 0:1.4.4-7.el6
cronie-anacron.x86_64 0:1.4.4-7.el6
cryptsetup-luks.x86_64 0:1.2.0-3.el6
cryptsetup-luks-libs.x86_64 0:1.2.0-3.el6
cups-libs.x86_64 1:1.4.2-39.el6
curl.x86_64 0:7.19.7-26.el6
device-mapper.x86_64 0:1.02.62-3.el6
device-mapper-event.x86_64 0:1.02.62-3.el6
device-mapper-event-libs.x86_64 0:1.02.62-3.el6
device-mapper-libs.x86_64 0:1.02.62-3.el6
dhclient.x86_64 12:4.1.1-19.P1.el6
dracut.noarch 0:004-53.el6
dracut-kernel.noarch 0:004-53.el6
e2fsprogs.x86_64 0:1.41.12-7.el6
e2fsprogs-libs.x86_64 0:1.41.12-7.el6
ebtables.x86_64 0:2.0.9-6.el6
efibootmgr.x86_64 0:0.5.4-9.el6
elfutils.x86_64 0:0.152-1.el6
elfutils-libelf.x86_64 0:0.152-1.el6
elfutils-libs.x86_64 0:0.152-1.el6
file.x86_64 0:5.04-6.el6
file-libs.x86_64 0:5.04-6.el6
fipscheck.x86_64 0:1.2.0-5.el6
fipscheck-lib.x86_64 0:1.2.0-5.el6
gcc.x86_64 0:4.4.5-6.el6
glib2.x86_64 0:2.22.5-6.el6
glibc.x86_64 0:2.12-1.25.el6
glibc-common.x86_64 0:2.12-1.25.el6
glibc-devel.x86_64 0:2.12-1.25.el6
glibc-headers.x86_64 0:2.12-1.25.el6
glibc-static.x86_64 0:2.12-1.25.el6
gpxe-roms-qemu.noarch 0:0.9.7-6.7.el6
grub.x86_64 1:0.97-70.el6
gtk2.x86_64 0:2.18.9-6.el6
hal.x86_64 0:0.5.14-11.el6
hal-libs.x86_64 0:0.5.14-11.el6
httpd.x86_64 0:2.2.15-9.el6
httpd-devel.x86_64 0:2.2.15-9.el6
httpd-manual.noarch 0:2.2.15-9.el6
httpd-tools.x86_64 0:2.2.15-9.el6
hwdata.noarch 0:0.233-7.1.el6
initscripts.x86_64 0:9.03.23-1.el6
ipmitool.x86_64 0:1.8.11-7.el6
iproute.x86_64 0:2.6.32-16.el6
iptables.x86_64 0:1.4.7-4.el6
iptables-ipv6.x86_64 0:1.4.7-4.el6
iputils.x86_64 0:20071127-16.el6
irqbalance.x86_64 2:0.55-29.el6
iscsi-initiator-utils.x86_64 0:6.2.0.872-21.el6
iwl6000-firmware.noarch 0:9.221.4.1-1.el6
iwl6050-firmware.noarch 0:41.28.5.1-2.el6
kernel-firmware.noarch 0:2.6.32-131.0.15.el6
kernel-headers.x86_64 0:2.6.32-131.0.15.el6
kexec-tools.x86_64 0:2.0.0-188.el6
kpartx.x86_64 0:0.4.9-41.el6
krb5-devel.x86_64 0:1.9-9.el6
krb5-libs.x86_64 0:1.9-9.el6
libblkid.x86_64 0:2.17.2-12.el6
libcgroup.x86_64 0:0.37-2.el6
libcom_err.x86_64 0:1.41.12-7.el6
libcom_err-devel.x86_64 0:1.41.12-7.el6
libcurl.x86_64 0:7.19.7-26.el6
libdrm.x86_64 0:2.4.23-1.el6
libgcc.x86_64 0:4.4.5-6.el6
libgomp.x86_64 0:4.4.5-6.el6
libgssglue.x86_64 0:0.1-11.el6
libgudev1.x86_64 0:147-2.35.el6
libnl.x86_64 0:1.1-14.el6
libpciaccess.x86_64 0:0.10.9-4.el6
libselinux.x86_64 0:2.0.94-5.el6
libselinux-devel.x86_64 0:2.0.94-5.el6
libselinux-python.x86_64 0:2.0.94-5.el6
libselinux-utils.x86_64 0:2.0.94-5.el6
libss.x86_64 0:1.41.12-7.el6
libstdc++.x86_64 0:4.4.5-6.el6
libtirpc.x86_64 0:0.2.1-3.el6
libudev.x86_64 0:147-2.35.el6
libuuid.x86_64 0:2.17.2-12.el6
libvirt.x86_64 0:0.8.7-18.el6
libvirt-client.x86_64 0:0.8.7-18.el6
libvirt-python.x86_64 0:0.8.7-18.el6
lvm2.x86_64 0:2.02.83-3.el6
lvm2-libs.x86_64 0:2.02.83-3.el6
man-pages.noarch 0:3.22-17.el6
man-pages-overrides.noarch 0:2.5-1.el6
mdadm.x86_64 0:3.2.1-1.el6
microcode_ctl.x86_64 1:1.17-4.el6
mod_ssl.x86_64 1:2.2.15-9.el6
net-snmp-libs.x86_64 1:5.5-31.el6
net-tools.x86_64 0:1.60-105.el6
netcf-libs.x86_64 0:0.1.7-1.el6
nfs-utils.x86_64 1:1.2.3-7.el6
nfs-utils-lib.x86_64 0:1.1.5-3.el6
nspr.x86_64 0:4.8.7-1.el6
nss.x86_64 0:3.12.9-9.el6
nss-softokn.x86_64 0:3.12.9-3.el6
nss-softokn-freebl.x86_64 0:3.12.9-3.el6
nss-sysinit.x86_64 0:3.12.9-9.el6
nss-util.x86_64 0:3.12.9-1.el6
openldap.x86_64 0:2.4.23-15.el6
openldap-devel.x86_64 0:2.4.23-15.el6
openssh.x86_64 0:5.3p1-52.el6
openssh-clients.x86_64 0:5.3p1-52.el6
openssh-server.x86_64 0:5.3p1-52.el6
openssl.x86_64 0:1.0.0-10.el6
openssl-devel.x86_64 0:1.0.0-10.el6
pam.x86_64 0:1.1.1-8.el6
parted.x86_64 0:2.1-13.el6
perl.x86_64 4:5.10.1-119.el6
perl-ExtUtils-MakeMaker.x86_64 0:6.55-119.el6
perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-119.el6
perl-Module-Pluggable.x86_64 1:3.90-119.el6
perl-Pod-Escapes.x86_64 1:1.04-119.el6
perl-Pod-Simple.x86_64 1:3.13-119.el6
perl-Test-Harness.x86_64 0:3.17-119.el6
perl-devel.x86_64 4:5.10.1-119.el6
perl-libs.x86_64 4:5.10.1-119.el6
perl-version.x86_64 3:0.77-119.el6
php.x86_64 0:5.3.3-3.el6
php-cli.x86_64 0:5.3.3-3.el6
php-common.x86_64 0:5.3.3-3.el6
php-devel.x86_64 0:5.3.3-3.el6
php-gd.x86_64 0:5.3.3-3.el6
php-imap.x86_64 0:5.3.3-3.el6
php-mbstring.x86_64 0:5.3.3-3.el6
php-mysql.x86_64 0:5.3.3-3.el6
php-pdo.x86_64 0:5.3.3-3.el6
php-pecl-memcache.x86_64 0:3.0.5-3.el6
php-xmlrpc.x86_64 0:5.3.3-3.el6
plymouth.x86_64 0:0.8.3-22.el6
plymouth-core-libs.x86_64 0:0.8.3-22.el6
plymouth-scripts.x86_64 0:0.8.3-22.el6
prelink.x86_64 0:0.4.4-1.el6
procps.x86_64 0:3.2.8-17.el6
python.x86_64 0:2.6.6-20.el6
python-ethtool.x86_64 0:0.6-1.el6
python-libs.x86_64 0:2.6.6-20.el6
python-pycurl.x86_64 0:7.19.0-8.el6
python-tools.x86_64 0:2.6.6-20.el6
python-urlgrabber.noarch 0:3.9.1-8.el6
python-virtinst.noarch 0:0.500.5-3.el6
qemu-img.x86_64 2:0.12.1.2-2.160.el6
qemu-kvm.x86_64 2:0.12.1.2-2.160.el6
ql2400-firmware.noarch 0:5.03.16-1.el6
ql2500-firmware.noarch 0:5.03.16-1.el6
quota.x86_64 1:3.17-16.el6
redhat-release-server.x86_64 0:6Server-6.1.0.2.el6
rhn-check.noarch 0:1.0.0-61.el6
rhn-client-tools.noarch 0:1.0.0-61.el6
rhn-setup.noarch 0:1.0.0-61.el6
rhnlib.noarch 0:2.5.22-10.el6
rpm.x86_64 0:4.8.0-16.el6
rpm-libs.x86_64 0:4.8.0-16.el6
rpm-python.x86_64 0:4.8.0-16.el6
rsyslog.x86_64 0:4.6.2-3.el6
seabios.x86_64 0:0.6.1.2-3.el6
selinux-policy.noarch 0:3.7.19-93.el6
selinux-policy-targeted.noarch 0:3.7.19-93.el6
setup.noarch 0:2.8.14-12.el6
shadow-utils.x86_64 2:4.1.4.2-9.el6
smartmontools.x86_64 1:5.39.1-3.el6
sos.noarch 0:2.2-8.el6
strace.x86_64 0:4.5.19-1.10.el6
sudo.x86_64 0:1.7.4p5-5.el6
sysstat.x86_64 0:9.0.4-18.el6
systemtap-runtime.x86_64 0:1.4-6.el6
sysvinit-tools.x86_64 0:2.87-4.dsf.el6
tcsh.x86_64 0:6.17-12.el6
tkinter.x86_64 0:2.6.6-20.el6
udev.x86_64 0:147-2.35.el6
upstart.x86_64 0:0.6.5-10.el6
util-linux-ng.x86_64 0:2.17.2-12.el6
vgabios.noarch 0:0.6b-3.6.el6
vim-common.x86_64 2:7.2.411-1.6.el6
vim-enhanced.x86_64 2:7.2.411-1.6.el6
vim-minimal.x86_64 2:7.2.411-1.6.el6
virt-manager.noarch 0:0.8.6-4.el6
virt-top.x86_64 0:1.0.4-3.8.el6
virt-viewer.x86_64 0:0.2.1-3.el6
virtio-win.noarch 0:1.2.0-1.el6
vte.x86_64 0:0.25.1-6.el6
yum.noarch 0:3.2.29-17.el6
yum-metadata-parser.x86_64 0:1.1.2-16.el6
yum-plugin-priorities.noarch 0:1.1.30-6.el6
yum-utils.noarch 0:1.1.30-6.el6

Replaced:
cairo-spice.x86_64 0:1.8.7.1-4.el6
ffmpeg-spice-libs.x86_64 0:0.4.9-0.15.5spice.20080908.el6
pixman-spice.x86_64 0:0.13.3-5.el6

Complete!
(Note: yum command output is truncated)
Reboot the server:
# reboot
Verify that everything is working and new version is loaded:
# uname -a
Sample outputs:
2.6.32-131.0.15.el6.x86_64
Verify ports are open:
# netstat -tulpn
# tail -f /var/log/messages
# tail -f /path/to/log/file
# cat /etc/redhat-release

Sample outputs:
Red Hat Enterprise Linux Server release 6.1 (Santiago)

How to Add a new yum repository to install software under CentOS / Redhat Linux

CentOS / Fedora Core / RHEL 5 uses yum for software management. Yum allows you to add a new repository as a source to install binary software.

Understanding yum repository

yum repository configured using /etc/yum.conf file. Additional configuration files are also read from the directories set by the reposdir option (default is /etc/yum.repos.d and /etc/yum/repos.d.

RPMforge repository

Usually repository carries extra and useful packages. RPMforge is one of such repository. You can easily configure RPMforge repository for RHEL5 just by running following single RPM command:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
For 64 bit RHEL 5 Linux, enter:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Now you can install software from RPMforge.

How do I install 3rd party repository manually?

Let us say you would like to install 3rd party repository from foo.nixcraft.com. Create a file called foo:
# cd /etc/yum.repos.d
# vi foo

Append following code:
[foo]
name=Foo for RHEL/ CentOS $releasever - $basearch
baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt

Save and close the file.
Where,
  • [foo] : Repository name i.e. The [main] section must exist for yum to do anything.
  • name=Foo for RHEL/ CentOS $releasever - $basearch : A human readable string describing the repository name
  • baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/ : Must be a URL to the directory where the yum repository’s ‘repodata’ directory lives
  • enabled=1 : Enabled or disabled repo. To disable the repository temporarily, set the enabled to 0
  • gpgcheck=1 : Security feature, use GPG key
  • gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt : GPL file location
Also you need to import the gpg key for the repository as follows:
# rpm --import http://foo.nixcraft.com/RPM-GPG-KEY.txt
Now you are ready to install software from foo repository. For further information refer to yum.conf man page:
$ man yum.conf
$ man yum

Hope this tip will help you to configure repository as and when required

VSFTPD cap_set_proc and dead but subsys locked errors and solution

VSFTPD is the one of the easiest and secure FTP server out there. However today it bumps back with two errors.

#1: 500 OOPS: cap_set_proc error

After successful user login vsftpd will display an error:
$ ftp ftpserver.xyz.com
Output:
Connected to ftpserver.xyz.com.
220 (vsFTPd 2.0.5)
Name (localhost:vivek): vivek
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
500 OOPS: cap_set_proc
ftp: bind: Address already in use
cap_set_proc is POSIX capability manipulation on processes function (related to filesystems but I am not sure). After searching bit I found the solution. You need to load the standard Linux capabilities security module:
# modprobe capability

#2: vsftpd dead but subsys locked error

This is another error - one of my clients was receiving while starting vsftpd. There was already ftp server running and address 21 was bind to this ftp server. So vsftpd dead but subsys locked error was generated. xinetd was configured to run wu-ftpd (quite old ftp software). Solution was simple I had removed the wu-ftpd.

Fix corrupted RPM database on CentOS 5 / Redhat enterprise Linux 5 / Fedora 7

If rpm / yum command hangs during operations or you see error messages - it means your rpm database corrupted. /var/lib/rpm/ stores rpm database just delete the same and rebuild rpm database:

Command to rebuild rpm database

rm -f /var/lib/rpm/__db*
rpm --rebuilddb

Rebuilding corrupted RPM database

One of our client reported that he is getting an error and RPM database is corrupted. He is using Red Hat Linux
Sometime it is possible to fix RPM database errors. I am surprised that many admins do not make back up of RPM DB (/var/lib/rpm).
Anyways if you ever messed up with RPM database, here is a quick guide to fix it (you must have rpmdb tools installed):
Take system to single user mode to avoid further damage and to make backup/restore process easy:
# init 1

Method # 1

Remove /var/lib/rpm/__db* files to avoid stale locks:
# cd /var/lib
# rm __db*

Rebuild RPM database:
# rpm --rebuilddb
# rpmdb_verify Packages

Method # 2

If you are still getting errors, then try your luck with following commands:
# mv Packages Packages-BAKUP
# db_dump Packages-BAKUP | db_load Packages
# rpm -qa
# rpm --rebuilddb

Thursday, May 19, 2011

Linux disk recovery

After any power problem with the linux machine, the filesystem could be corrupted and you may not be able to login. When this happens, you will need e2fsck, the tool to recover ext2 or ext3 partitions. (Do not ever use it with a partition that has AFS or another format).

Boot with a live cd or the first cd of Redhat and write "linux rescue".
Do not let the rescue mode to detect the linux partitions, else it would mount them and you do not want to mount the partitions yet, the file system check (e2fsck) can cause severe problems on a mounted partition.

When you are at the rescue mode prompt, write:

# e2fsck -c -c -v -y /dev/hda1
It is important to user "-c -c" (twice) this means that badblocks will scan using a non-destructive read-write test.
"-v" to verbose and see the status of fsck.
"-y" says to answer "yes" to all the questinons from fsck.

Logrotate in Linux server

Logs are important and usefull in security and administration. If a log grows too much, you compress it , back it up for some months or years and create a new log file. All this is done in a much better way by Logrotate. Logrotate enables you to compress the old logfile, and store it for as long as you want, to run every day, montly, or when you want, and if a file expires, it can send it to you by email or delete it, after for example, 2 years. Old logs can be stored in an alternative directory.

You set up logs configuring /etc/logrotate.conf or adding a new file in /etc/logrotate.d/
For example, a logrotate file for apache looks like this:
File: /etc/logrotate.d/httpd
-------8<-------
/usr/local/apache/logs/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}

Segmentation Fault Occur on Linux


Usually signal #11 (SIGSEGV) set, which is defined in the header file signal.h file. The default action for a program upon receiving SIGSEGV is abnormal termination. This action will end the process, but may generate a core file (also known as core dump) to aid debugging, or perform some other platform-dependent action. A core dump is the recorded state of the working memory of a computer program at a specific time, generally when the program has terminated abnormally.
Segmentation fault can also occur under following circumstances:
a) A buggy program / command, which can be only fixed by applying patch.
b) It can also appear when you try to access an array beyond the end of an array under C programming.
c) Inside a chrooted jail this can occur when critical shared libs, config file or /dev/ entry missing.
d) Sometime hardware or faulty memory or driver can also create problem.
e) Maintain suggested environment for all computer equipment (overheating can also generate this problem).

Suggestions to debug Segmentation Fault errors

To debug this kind of error try one or all of the following techniques :
  • Use gdb to track exact source of problem.
  • Make sure correct hardware installed and configured.
  • Always apply all patches and use updated system.
  • Make sure all dependencies installed inside jail.
  • Turn on core dumping for supported services such as Apache.
  • Use strace which is a useful diagnostic, instructional, and debugging tool.
  • Google and find out if there is a solution to problem.
  • Fix your C program for logical errors such as pointer, null pointer, arrays and so on.
  • Analyze core dump file generated by your system using gdb

Wednesday, May 18, 2011

Heartbeat clustering in Linux


Its long time back I have learnt Heartbeat clustering around March-2008, but still this point I never implemented for production servers. This is my first attempt to do it and I am successful in implementing it for two node fail-over Cluster. Clustering is very complex and very advanced topic which I cannot deal with in one post. In this post I will give you some basics of Clustering, advantages of Clustering and configuration of simple fail-over Cluster
Let’s start.
What is a Cluster any way?Ans : A computer cluster is a group of linked computers, working together closely so that in many respects they form a single computer. The components of a cluster are commonly, but not always, connected to each other through fast local area networks. Clusters are usually deployed to improve performance and/or availability over that of a single computer, while typically being much more cost-effective than single computers of comparable speed or availability – www.wikipedia.org.
Cluster terminology.

Node : It’s one of the system/computer which participates with other systems to form a Cluster.
Heartbeat : This a pulse kind of single which is send from all the nodes at regular intervals using a UDP packet so that each system will come to know the status of availability of other node. It’s a kind of door knocking activity like pinging a system, So that each node which are participating in Cluster will come to know the status of other nodes availability in the Cluster.
Floating IP or Virtual IP : This is the IP assigned to the Cluster through which user can access the services. So when ever clients request a service they will be arrived to this IP, and client will not know what are the back-end/actual ip addresses of the nodes. This virtual IP is used to nullify the effect of nodes going down.

Master node : This is the node most of the time where services are run in a High availability Cluster.
Slave node : This is the node which is used in High availability Cluster when master node is down. It will take over the role of servicing the users, when it will not receive heartbeat pulse from master. And automatically gives back the control when the master server is up and running. This slave comes to know about the status of master through heartbeat pulse/signals.
Types of Clusters: 
Cluster types can be divided in to two main types
1.
 High availability :

These types of Clusters are configured where there should be no downtime. If one node in the cluster goes down second node will take care of serving users without interrupted service with availability of five nines i.e. 99.999%.
2. Load balancing :These types of Clusters are configured where there are high loads from users. Advantages of load balancing are that users will not get any delays in their request because load on a single system is shared by two or more nodes in the Cluster.

Advantages of Cluster :
1.Reduced Cost : Its cheaper to by 10 normal servers and do cluster on them then buying a high end servers like blade servers, which will do more work than a single blade server which have more processing power.
2. Processing Power
3. Scalability
4. Availability
Configuration files details :Three main configuration files :· /etc/ha.d/authkeys
· /etc/ha.d/ha.cf
· /etc/ha.d/haresources

Some other configuration files/folders to know :/etc/ha.d/resource.d. Files in this directory are very important which contains scripts to start/stop/restart a service run by this Heartbeat cluster.
Before configuration of Heartbeat Cluster these below points to be noted.
Note1 : The contents of ha.cf file are same in all the nodes in a cluster, except ucastand bcast derivatives.
Note2 : The contents of authkeys and haresources files are exact replica on all the nodes in a cluster.
Note3 : A cluster is used to provided a service with high availability/high performance, that service may be a web server, reverse proxy or a Database.
Test scenario setup:1. The cluster configuration which I am going to show is a two node cluster with failover capability for a Squid reverse proxy..
2.For Squid reverse proxy configuration please click here..
3.
 Node details are as follows

Node1 :IpAddress(eth0):10.77.225.21
Subnetmask(eth0):255.0.0.0
Default Gateway(eth0):10.0.0.1
IpAddress(eth1):192.168.0.1(To send heartbeat signals to other nodes)
Sub net mask (eth1):255.255.255.0
Default Gateway (eth1):None(don’t specify any thing, leave blank for this interface default gateway).

Node2 :IpAddress(eth0):10.77.225.22
Subnetmask(eth0):255.0.0.0
Default Gateway (eth0):10.0.0.1
IpAddress(eth1):192.168.0.2(To send heartbeat signals to other nodes)
Sub net mask (eth1):255.255.255.0
Default Gateway(eth1):None(don’t specify any thing, leave blank for this interface default gateway).


tyle=”font-family: verdana;”>4. Floating Ip address:10.77.225.20
Lets start configuration of Heartbeat cluster. And make a note that ever step in this Heartbeat cluster configuration is divided in two parts parts
1.(configurations on node1) 
2.(configurations on node2) 

For better understanding purpose

Step1 :
 Install the following packages in the same order which is shown. If you did not find the packages online you can download it from our site, click here to download the packages.

Step1(a) : Install the following packages on node1
#rpm -ivh heartbeat-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-ldirectord-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-pils-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-stonith-2.1.2-2.i386.rpm

Step1(b) : Install the following packages on node2
#rpm -ivh heartbeat-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-ldirectord-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-pils-2.1.2-2.i386.rpm
#rpm -ivh heartbeat-stonith-2.1.2-2.i386.rpm



Step2 : By default the main configuration files (ha.cf, haresources and authkeys)are not present in /etc/ha.d/ folder we have to copy these three files from/usr/share/doc/heartbeat-2.1.2 to /etc/ha.d/
Step2(a) : Copy main configuration files from /usr/share/doc/heartbeat-2.1.2 to /etc/ha.d/ on node 1
#cp /usr/share/doc/heartbeat-2.1.2/ha.cf /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.2/haresources /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.2/authkeys /etc/ha.d/

Step2(b) : Copy main configuration files from /usr/share/doc/heartbeat-2.1.2 to /etc/ha.d/ on node 2
#cp /usr/share/doc/heartbeat-2.1.2/ha.cf /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.2/haresources /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.2/authkeys /etc/ha.d/



Step3 : Edit ha.cf file#vi /etc/ha.d/ha.cf
Step3(a) : Edit ha.cf file as follows on node1
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 25
warntime 10
initdead 50
udpport 694
bcast eth1
ucast eth1 192.168.0.1
auto_failback on
node rp1.linuxnix.com
node rp2.linuxnix.com

Step3(b) : Edit ha.cf file as follows on node2debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 25
warntime 10
initdead 50
udpport 694
bcast eth1
ucast eth1 192.168.0.2
auto_failback on
node rp1.linuxnix.com
node rp2.linuxnix.com
Let me explain each entry in detail:Debugfile : This is the file where debug info with good details for your heartbeat cluster will be stored, which is very much useful to do any kind of troubleshooting.
Logfile : This is the file where general logging of heartbeat cluster takes place.
Logfacility : This directive is used to specify where to log your heartbeat logs(if its local that indicates store logs locally or if it’s a syslog then store it on remote serverand none to disable logging). And there are so many other options, please explore yourself.
Keepalive : This directive is used to set the time interval between heartbeat packetsand the nodes to check the availability of other nodes. In this example I specified it as two seconds(keepalive 2).
Deadtime : A node is said to be dead if the other node didn’t receive any update form it.
Warntime : Time in seconds before issuing a “late heartbeat” warning in the logs.
Initdead : With some configurations, the network takes some time to start working after a reboot. This is a separate “deadtime” to handle that case. It should be at leasttwice the normal deadtime.

Udpport : This is the port used by heartbeat to send heartbeat packet/signals to other nodes to check availability(here in this example I used default port:694).
Bcast : Used to specify on which device/interface to broadcast the heartbeat packets.
Ucast : Used to specify on which device/interface to uni-cast the heartbeat packets.
auto_failback : This option determines whether a resource will automatically fail back to its “primary” node, or remain on whatever node is serving it until that node fails, or an administrator intervenes. In my example I have given as on that indicate if the failed node come back online, control will be given to this node automatically. Let me put it in this way. I have two nodes node1 and node2. My node one machine is a high end one and node is for serving temporary purpose when node 1 goes down. Suppose node1 goes down, node2 will take the control and serve the service, and it will check periodically for node1 starts once it find that node 1 is up, the control is given to node1.
Node : This is used to specify the participated nodes in the cluster. In my cluster only two nodes are participating (rp1 and rp2) so just specify that entries. If in your implementation more nodes are participating please specify a
ll the nodes.



Step4 : Edit haresources file#vi /etc/ha.d/haresources
Step4(a) : Just specify below entry in last line of this file on node1rp1.linuxnix.com 10.77.225.20 squid
Step4(b) : Just specify below entry in last line of this file on node1rp1.linuxnix.com 10.77.225.20 squid
Explanation of each entry :rp1.linuxnix.com is the main node in the cluster
10.77.225.20 
is the floating ip address of this cluster.

Squid : This is the service offered by the cluster. And make a note that this is the script file located in /etc/ha.d/ resource.d/.Note : By default squid script file will not be there in that folder, I created it according to my squid configuration.

What actually this script file contains?Ans : This is just a start/stop/restart script for the particular service. So that heartbeat cluster will take care of the starting/stoping/restarting of the service(here its squid).
Here is what squid script file contains.
http://sites.google.com/site/surendra/Home/squid.txt.txt?attredirects=0&d;=1
Step5 : Edit authkeys file, he authkeys configuration file contains information for Heartbeat to use when authenticating cluster members. It cannot be readable or writeable by anyone other than root. so change the permissions of the file to 600 on both the nodes..

Two lines are required in the authkeys file:A line which says which key to use in signing outgoing packets.
One or more lines defining how incoming packets might be being signed.

Step5 (a) : Edit authkeys file on node1#vi /etc/ha.d/authkeys
auth 2
#1 crc
2 sha1 HI!
#3 md5 Hello!
Now save and exit the file

Step5 (b) : Edit authkeys file on node2#vi /etc/ha.d/authkeys
auth 2
#1 crc
2 sha1 HI!
#3 md5 Hello!
Now save and exit the file



Step6 : Edit /etc/hosts file to give entries of host-names for the nodes


Step6(a) : Edit /etc/hosts file on node1 as below

10.77.225.21 rp1.linuxnix.com rp1
10.77.225.22 rp2.linuxnix.com rp2


Step6(b) : Edit /etc/hosts file on node2 as below

10.77.225.21 rp1.linuxnix.com rp1
10.77.225.22 rp2.linuxnix.com rp2
Step7 : Start Heartbeat cluster
Step7(a) : Start heartbeat cluster on node1
#service heartbeat start

Step7(b) : Start heartbeat cluster on node2#service heartbeat start
Checking your Heartbeat cluster:If your heartbeat cluster is running fine a Virtual Ethernet Interface is created onnode1 and 10.77.225.20Clipped output of my first node
# ifconfig

Eth0 Link encap:Ethernet HWaddr 00:02:A5:4C:AF:8E
inet addr:10.77.225.21 Bcast:10.77.231.255 Mask:255.255.248.0
inet6 addr: fe80::202:a5ff:fe4c:af8e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5714248 errors:0 dropped:0 overruns:0 frame:0
TX packets:19796 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1533278899 (1.4 GiB) TX bytes:4275200 (4.0 MiB)
Base address:0×5000 Memory:f7fe0000-f8000000

Eth0:0 
Link encap:Ethernet HWaddr 00:02:A5:4C:AF:8E
inet addr:10.77.225.20 Bcast:10.77.231.255 Mask:255.255.248.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0×5000 Memory:f7fe0000-f8000000

Eth1 
Link encap:Ethernet HWaddr 00:02:A5:4C:AF:8F
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::202:a5ff:fe4c:af8f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:145979 errors:0 dropped:0 overruns:0 frame:0
TX packets:103753 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:38966724 (37.1 MiB) TX bytes:27640765 (26.3 MiB)
Base address:0×5040 Memory:f7f60000-f7f80000

Try accessing your browser whether Squid is working fine or not. Please follow up coming posts how to troubleshoot heartbeat cluster.