Saturday, April 17, 2010

Useful videos’ “Worth Watching It”

Special category of videos’ “Worth Watching It”

Technology

http://www.youtube.com/watch?v=XdBd14rjcs0&feature=related (Cloud Computing)

http://www.youtube.com/watch?v=wRbYCnzj1x0&feature=related (Cloud Computing)

http://www.youtube.com/watch?v=48ZEvHYmul4&feature=related (Intel VT)

http://www.youtube.com/watch?v=p11lJOnALS4&feature=fvw (Virtualization)

http://www.youtube.com/watch?v=oBlJqQ4oP1M (Hypervisor)

http://www.youtube.com/watch?v=-EQIKmE35As&NR=1

Gnu/Linux & Open Source

http://www.redhat.com/

http://www.linuxhomenetworking.com/

http://www.ubuntu.com/

Sports

General

http://www.youtube.com/watch?v=vVkFb26u9g8 (Money As Debit)

http://www.youtube.com/watch?v=vVkFb26u9g8 (Money As Debit)

http://www.ted.com/talks/kiran_bir_sethi_teaches_kids_to_take_charge.html (Ted Talks )

http://www.ted.com/talks/tom_wujec_build_a_tower.html (Ted Talks)

http://www.ted.com/talks/bill_gates.html

http://www.youtube.com/watch?v=kU-Wn85ZEow

http://www.youtube.com/watch?v=izzNFCtFyyY

http://www.ted.com/talks/rory_sutherland_sweat_the_small_stuff.html

http://www.ted.com/talks/vilayanur_ramachandran_on_your_mind.html

http://www.ted.com/tal/vs_ramachandran_the_neurons_that_shaped_civilization.html#top



Entertainment

http://www.youtube.com/watch?v=saalGKY7ifU

http://www.youtube.com/watch?v=izzNFCtFyyY (The meaning of Namaste )


WORTH WATCHING MOVIES 

The pursuit of happyness
field of dreams
Good will hunting
stand anddeliver
It's a wonderful life
hossiers
forrest gump
ruby
rocky
The Shawshank Redemption
Lord of the Rings
Troy
Avatar
The Blide side



Websites

http://www.ted.com/

http://www.howstuffworks.com/

http://www.drbd.org/

https://turtlejar.com

http://w3schools.com

http://www.tutorialspoint.com

Interview Great Websites 

http://pastebin.com
http://careercup.com
http://leetcode.com

How to Recover Gnu/Linux Grub After Windows Installation

How to Recover Gnu/Linux Grub After Windows Installation


Today i destroyed my Grub2 via installing windows on my notebook which .
Here is the step by step guide to recover Grand Unified BootLoader(Grub) :

You will need a LIVE cd if you are going to recover an Ubuntu Box.Download Ubuntu Jaunty, Karmic whatever you want.Open the system with Live CD (I assume you are using Ubuntu Live CD).

$sudo fdisk -l

This will show your partition table.Here is my table to understand it better :

/dev/sda1 29 8369 66999082+ 83 Linux
/dev/sda2 * 8370 13995 45190845 7 HPFS/NTFS
/dev/sda3 13996 14593 4803435 5 Extended
/dev/sda5 13996 14593 4803403+ 82 Linux swap / Solaris

Now i will mount Linux (sda1 here), i have no external boot partition as you can see.(IF YOU HAVE external one, do not forget to mount it! )

$sudo mount /dev/sda1 /mnt
$sudo mount --bind /dev /mnt/dev
$sudo mount --bind /proc /mnt/proc

The following command is optional (it copies resolv.conf)

$sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

Now chroot into the enviroment we made :

sudo chroot /mnt

After chrooting, you do not need to add sudo before your commands because from now, you will run commands as root.

You may want to edit /etc/default/grub file to fit your system (timeout options etc)

#nano -w /etc/default/grub

Play with the options if you want.(But do not forget to give grub-update command if you saved it ;) )

Now install/recover Grub2 via :

#grub-install /dev/sda

command.However you may get errors with that code like me.If so please use this command :

#grub-install --recheck /dev/sda

Now you can exit the chroot, umount the system and reboot your box :

#exit
$sudo umount /mnt/dev
$sudo umount /mnt/proc
$sudo umount /mnt
$sudo reboot

I hope the Grub will be acitve and working fine

Thank you so much for visiting my blog !!

Tuesday, April 13, 2010

Virtual Machine Migration ESX to KVM

Before converting any Windows Virtual Machine we have to enable IDE in the registry and uninstall VMware tools form VM.


1. Uninstall VMware tools form VM

2. Below is the process to enable IDE in Windows registry.

Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the

%SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder.

Now we will Import new registry settings into windows registry

Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.

Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file

3. Shutdown the VM and Copy VMDK,Flat.VMDK and VMX files to KVM machine.

#scp 10014-1001.vmdk 10014-1001-flat.vmdk 10014-1001.vmx user@KVM Server ip:/var/lib/libvirt/images/

4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml .

Below command to install virt-goodies in your KVM system.

#apt-get install virt-goodies

5. Convert 10014-1001.vmx to file.xml

#vmware2libvirt -f ./10014-1001.vmx > file.xml

Above command converts the VMware '10014-1001.vmx' file to the libvirt compatible 'file.xml'.

6. Define xml file

# virsh -c qemu:///system define file.xml

Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.


7. Now we will convert .vmdk file to qcow2 format

#qemu-img convert 10014-1001-flat.vmdk -O qcow2 new-diskname.qcow2


Now we have converted .vmx to .xml and .vmdk to .qcow2 file, we need to edit VMNAME, OS Arch & Disk name or source file name in xml file. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.

Below command will open file.xml to edit.

#virsh edit file.xml

In the above XML you can see my disk is pointed new-diskname.qcow2 which we have converted to qcow2 format.


Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:


hvm


vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.

Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.

The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:

2


8. Define the xml file and start the VM.

#virsh -c qemu:///system define file.xml

#virsh start vmname

Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.

Monday, April 12, 2010

How to resize ZFS FileSystem

One of the frequently asked questions regarding ZFS. Is it possible to resize a RAIDZ, RAIDZ2 or MIRRORED ZPOOL?

The answer is a littlebit complicated...
If you want to change the 'geometry' of the ZPOOL (for example: change from a mirrored pool to a raidz, or simply add a disk to a raidz, or change from raidz to raidz2) then the answer is no.

But it is possible to change the disks of a pool with bigger ones and use the space.

Here is what I've tested with a FreeNAS 0.7 (rev 3514) installed as a Virtual Machine.

I've used four 1 GByte HDs and four 2 GByte HDs. My mission was to get a raidz from 4 GByte (usable 3 GByte) to around 8 GByte (usable 6 GByte). The initial setup was one raidz with the four 1 GByte-HDs called 'datapool'. The disks da0, da1, da2, da3 are the 1 GByte-Drives. The disks da4, da5, da6, da7 are the 2 GByte-Drives.


Replace the first disk:

freenas:~# zpool replace datapool da0 da4

Check the status:

freenas:~# zpool status -v
pool: datapool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress, 16.44% done, 0h0m to go
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
replacing ONLINE 0 0 0
da0 ONLINE 0 0 0
da4 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

It will take a while until the pool is completly 'resilvered'

freenas:~# zpool status -v
pool: datapool
state: ONLINE
scrub: resilver completed with 0 errors on Tue Aug 12 16:03:34 2008
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

Proceed with the next disk...

freenas:~# zpool replace datapool da1 da5
freenas:~# zpool status -v
pool: datapool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress, 7.86% done, 0h0m to go
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
replacing ONLINE 0 0 0
da1 ONLINE 0 0 0
da5 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

freenas:~# zpool status -v
pool: datapool
state: ONLINE
scrub: resilver completed with 0 errors on Tue Aug 12 16:05:34 2008
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

Next one...

freenas:~# zpool replace datapool da2 da6
freenas:~# zpool status -v
pool: datapool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress, 6.01% done, 0h0m to go
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 ONLINE 0 0 0
replacing ONLINE 0 0 0
da2 ONLINE 0 0 0
da6 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

You can also monitor the status via this command:

freenas:~# zpool iostat -v 5
capacity operations bandwidth
pool used avail read write read write
------------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 16 13 1.94M 912K
raidz1 715M 3.27G 16 13 1.94M 912K
da4 - - 11 11 968K 752K
da5 - - 5 20 440K 1.40M
replacing - - 0 45 0 1.56M
da2 - - 7 7 597K 399K
da6 - - 0 23 3.79K 1.60M
da3 - - 8 6 688K 313K
------------- ----- ----- ----- ----- ----- -----

capacity operations bandwidth
pool used avail read write read write
------------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 62 5 7.82M 19.6K
raidz1 715M 3.27G 62 5 7.82M 19.6K
da4 - - 10 0 893K 6.13K
da5 - - 23 1 1.87M 28.3K
replacing - - 0 67 0 2.62M
da2 - - 0 17 0 1.40M
da6 - - 0 33 0 2.64M
da3 - - 16 1 1.29M 26.2K
------------- ----- ----- ----- ----- ----- -----

capacity operations bandwidth
pool used avail read write read write
------------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 31 0 3.82M 2.29K
raidz1 715M 3.27G 31 0 3.82M 2.29K
da4 - - 38 1 3.09M 44.2K
da5 - - 26 1 2.09M 22.9K
replacing - - 0 31 0 1.28M
da2 - - 0 24 0 1.87M
da6 - - 0 17 0 1.30M
da3 - - 32 1 2.68M 22.9K
------------- ----- ----- ----- ----- ----- -----

freenas:~# zpool status -v
pool: datapool
state: ONLINE
scrub: resilver completed with 0 errors on Tue Aug 12 16:07:31 2008
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 ONLINE 0 0 0
da6 ONLINE 0 0 0
da3 ONLINE 0 0 0

errors: No known data errors

And this is the last one...

freenas:~# zpool replace datapool da3 da7
freenas:~# zpool status -v
pool: datapool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress, 3.02% done, 0h0m to go
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 ONLINE 0 0 0
da6 ONLINE 0 0 0
replacing ONLINE 0 0 0
da3 ONLINE 0 0 0
da7 ONLINE 0 0 0

errors: No known data errors

freenas:~# zpool iostat -v 5
capacity operations bandwidth
pool used avail read write read write
------------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 14 0 1.75M 0
raidz1 715M 3.27G 14 0 1.75M 0
da4 - - 13 0 1.12M 0
da5 - - 14 0 1.19M 510
da6 - - 13 0 1.13M 0
replacing - - 0 14 0 599K
da3 - - 0 19 0 1.58M
da7 - - 0 7 0 599K
------------- ----- ----- ----- ----- ----- -----

capacity operations bandwidth
pool used avail read write read write
------------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 68 0 8.51M 4.49K
raidz1 715M 3.27G 68 0 8.51M 4.49K
da4 - - 15 0 1.26M 1.70K
da5 - - 6 0 546K 1.20K
da6 - - 18 0 1.51M 1.40K
replacing - - 0 68 0 2.84M
da3 - - 0 21 0 1.75M
da7 - - 0 35 0 2.84M
------------- ----- ----- ----- ----- ----- -----

capacity operations bandwidth
pool used avail read write read write
---------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 21 11 2.62M 696K
raidz1 715M 3.27G 21 11 2.62M 696K
da4 - - 15 7 1.22M 430K
da5 - - 13 9 1.11M 583K
da6 - - 9 12 825K 834K
da7 - - 0 21 1007 1.59M
---------- ----- ----- ----- ----- ----- -----

capacity operations bandwidth
pool used avail read write read write
---------- ----- ----- ----- ----- ----- -----
datapool 715M 3.27G 0 0 0 0
raidz1 715M 3.27G 0 0 0 0
da4 - - 0 0 0 0
da5 - - 0 0 0 0
da6 - - 0 0 0 0
da7 - - 0 0 0 0
---------- ----- ----- ----- ----- ----- -----

freenas:~# zpool status -v
pool: datapool
state: ONLINE
scrub: resilver completed with 0 errors on Tue Aug 12 16:09:45 2008
config:

NAME STATE READ WRITE CKSUM
datapool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 ONLINE 0 0 0
da6 ONLINE 0 0 0
da7 ONLINE 0 0 0

errors: No known data errors

Finally it is necessary to reboot

freenas:~# reboot

And here you can see the result. It is possible to resize a ZPOOL if you have bigger disks...

freenas:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
datapool 7.97G 715M 7.27G 8% ONLINE -

Remote Graphical Console on a Ubuntu Server

Remote Graphical Console on a Ubuntu Server

In some rare situations, you need a GUI on a remote server which you have SSH access to. Trying to install full Linux desktop to get GUI has drawbacks as it consumes lot of System resources. Most optimal solution is install VNCserver and access gui over vncviewer.

In the below example: we assume you are remote and the only tool you have is windows putty, which has port forwarding ability via a ssh tunnel.



Install tightvncserver

# apt-get install tightvncserver xfonts-base xfonts-75dpi twm xterm

To start VNC server

# vncserver
will display the port number your can connect to "for example :1 means port 5901", :2 means port 5902

To change vnc password

# vncpasswd

From vncviewer

# vncviewer ip:1

From remote putty

Port foward localhost:5901:remote_ip:5901
vncviewer localhost:5901
You should now see the graphical X window.

Saturday, April 10, 2010

Linux System Information Gathering Tools

Linux-Explorer ( LINUXexplo ) - Linux System Information Gathering Tool

Linux Explorer ( LINUXexplo ) is a script that collects software and hardware information about a linux server for support purposes, similar to the Solaris explorer ( SUNWexplo ) , Redhat's "sysreport" and SuSE's "siga" script.

The script is designed to collect information about a server to help service departments support linux and have a common set of scripts for collecting information about linux no matter what distro users are using.

The information is stored in seperated directories, once all the information has been collected it then tar's up those directories into a single gzip tar file which can then be attached to an email for your support organization or copied to a remote server for safe keeping.

This script collects the following information :-
# release Section
# hardware
# process
# boot/grub/lilo
# /etc config information
# performance/System
# kernel
# disk
# raid information
# software information
# sysconfig
# Systems Log
# networking
# xinetd
# DNS
# clusters
# crontab
# printers
# openldap
# pam
# sendmail
# postfix
# time
# ppp
# apache
# openssh
# X11

Friday, April 9, 2010

Virtualization Technologies

Guest Operating System virtualization
guest OS virtualization technologies include example vmware server and virtual Box

Shared kernel Virtualization

The kernel in simple terms handles all the interactions between the operating system and the physical h/w
The second key component is the root file system which contains all the libraris files and utilites necessary for the operation system to function
Shared kernel virtualization the virtual guest system Each have their own root file system but share the kernel of the host operating system
The ability of the kernel to dynamically change the current root file systems with out having to reboot the entire system
Guest Os must be compatible with the version of the kernel


Kernel level Virtualization

The host operating system runs on a specially modified kernel which contains extensions designed to manage and control multiple virtual machines.
Eg: User mode linux (UML), Kernel based virtual Machine(KVM)

Hypervisor virtualization
Range of protection levels also known as rings in which code can execute. Ring0 has the highest privileges and it is in the ring the the os kernel normally runs. Code executing in ring0 is said to be running in system space, kernel mode or supervisor mode. Application running on the operating system operates in less privileges rings typically ring 3.
The task of the operating system is to handle resources and memory allocation for the virtual machines. The hypervisor occupying ring 0 of the cpu the kernel for any guest os running on the system must run in less privileged cpu rings.


Paravirtualization

Replacing any privileged operations that will only run in ring0 of the cpu with calls to the hypervisor. The hypervisor in turn performs the task on behalf of the Guest kernel

Full Virtualization
The hypervisor provides cpu emulation to handle and modify privileges and protected cpu operations made by the unmodifed guest OS kernels. This emulation process requires both time and system resources.

hardware virtualization
Hardware virtualization leverage virtualization features built in to the latest generations of cpus's from both Intel VT and AMD-V provides extension necessary to run unmodified guest virtual machines without the over heads inherent in full virtualization cpu emulation. Provides additional privilege mode above ring0 in which the hypervisor can operate essentially

Virtualization Videos'

http://www.appzero.com/glossary
http://www.youtube.com/watch?v=p11lJOnALS4&feature=fvw
http://www.youtube.com/watch?v=oBlJqQ4oP1M
http://www.youtube.com/watch?v=48ZEvHYmul4&feature=related
http://www.youtube.com/watch?v=MnNX13yBzAU
http://www.youtube.com/watch?v=wRbYCnzj1x0&feature=related

Open Vpn Setup Behind Router

Router(192.168.155.1) VPN-Server (192.168.155.106) VPN Client range (172.16.17.0/24)

apt-get install openvpn openssl

cd /usr/share/doc/openvpn/examples

cp ./sample-config-files/server.conf.gz /etc/openvpn

cp -r ./easy-rsa/2.0 /etc/openvpn

cd /etc/openvpn

mv 2.0 easy-rsa

gzip -d server.conf.gz

cd /etc/openvpn/easy-rsa

vi ./vars

1. These are the default values for fields

1. which will be placed in the certificate.

1. Don't leave any of these fields blank.

export KEY_COUNTRY="US"

export KEY_PROVINCE="CA"

export KEY_CITY="SanFrancisco"

export KEY_ORG="Fort-Funston"

export KEY_EMAIL="me@myhost.mydomain"

. ./vars #run this command as root (sudo su)

./clean-all

./build-ca

./build-key-server server

./build-key client1

./build-key client2

./build-dh vi /etc/openvpn/server.conf

port 1194

proto udp

dev tun

ca ca.crt

cert server.crt

key server.key

dh dh1024.pem

server 172.16.17.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "redirect-gateway"

client-to-client

keepalive 10 120

tls-auth ta.key 0 # This file is secret

cipher BF-CBC # Blowfish (default)

cipher AES-128-CBC # AES

cipher DES-EDE3-CBC # Triple-DES

comp-lzo

max-clients 100

user nobody

group nogroup

persist-key

persist-tun

status /var/log/openvpn/status-ovpn.log

log-append /var/log/openvpn/status-ovpn.log

verb 3

mute 20

push "route 172.16.17.0 255.255.255.0"

push "route 192.168.155.0 255.255.255.0"

cd /etc/openvpn/easy-rsa/keys

cp ca.crt server.crt server.key dh1024.pem /etc/openvpn

Copy the client certificates and keys to wherever you want (you need them on your clients)

cp client1.crt client1.key ca.crt /home/client1 # Change the target folder to whatever you need it to be

/etc/init.d/openvpn restart

Making routes work

Before you can actually access the internet over your VPN you need to enable IPv4 forwarding and add some iptables rules.

Edit /etc/sysctl.conf

vim /etc/sysctl.conf

Uncomment net.ipv4.ipforward=1_ and save your changes.

Add the following rules to /etc/rc.local before the exit 0 statement

iptables -P FORWARD ACCEPT

iptables -t nat -A POSTROUTING -s 172.16.17.0/24 -o eth0 -j MASQUERADE Client Configuration


client

proto udp

dev tun

tls-client

remote hyd.hexagrid.net 1194

nobind

ca hyd-ca.crt

cert hyd-ranga.crt

key hyd-ranga.key

comp-lzo

verb 3

Popular Open source Technologies

1. OpenNebula
2. OpenNMS
3. Vyatta Community Edition 5 (VC5) iso
4. Ubuntu
5. openVAS
6. EON
7. Apache
8. TomCat
9. MySQL
10. Java
11. FreeNX
12. Puppet
13. PostgresSQL
14. Hobbit
15. osTicket
16. Mantis Bug Tracker
17. Rock Cluster
18. Centos , Debian , Back Track
19. Open Solaris
20. Nagios
21. Eucalyptus EC2
22. Vittualizatio: KVM/Qemu,Virtual Box
23. Open-VPN, VCL (Virtual computing Labs )

Under Construction yet to come few More ...

Linux Bond or Team multiple network interfaces(NIC) into single interface

Linux bond or team multiple network interfaces (NIC) into single interface

by LinuxTitli · 53 comments

Finally today I had implemented NIC bounding (bind both NIC so that it works as a single device). We have two Dell servers that need setup with Intel Dual Gig NIC. My idea is to improve performance by pumping out more data from both NIC without using any other method.

This box act as heavy duty ftp server. Each night I need to transfer over 200GB data from this box to another box. Therefore, the network would be setup is two servers on a switch using dual network cards. I am using Red Hat enterprise Linux version 4.0.

Linux allows binding multiple network interfaces into a single channel/NIC using special kernel module called bonding. According to official bonding documentation, "The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical "bonded" interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed."

Setting up bounding is easy with RHEL v4.0.
Step #1: Create a bond0 configuration file

Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you need to create bond0 config file:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0Append following lines to it:DEVICE=bond0
IPADDR=192.168.1.20
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yesReplace above IP address with your actual IP address. Save file and exit to shell prompt.
Step #2: Modify eth0 and eth1 config files:

Open both configuration using vi text editor and make sure file read as follows for eth0 interface# vi /etc/sysconfig/network-scripts/ifcfg-eth0Modify/append directive as follows:DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneOpen eth1 configuration file using vi text editor:# vi /etc/sysconfig/network-scripts/ifcfg-eth1Make sure file read as follows for eth1 interface:DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneSave file and exit to shell prompt.
Step # 3: Load bond driver/module

Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You need to modify kernel modules configuration file:# vi /etc/modprobe.confAppend following two lines:alias bond0 bonding
options bond0 mode=balance-alb miimon=100Save file and exit to shell prompt. You can learn more about all bounding options in kernel source documentation file (click here to read file online).
Step # 4: Test configuration

First, load the bonding module:# modprobe bondingRestart networking service in order to bring up bond0 interface:# service network restartVerify everything is working:# less /proc/net/bonding/bond0Output:

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:59

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:63

List all interfaces:# ifconfigOutput:

bond0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:2804 errors:0 dropped:0 overruns:0 frame:0
TX packets:1879 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:250825 (244.9 KiB) TX bytes:244683 (238.9 KiB)

eth0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:2809 errors:0 dropped:0 overruns:0 frame:0
TX packets:1390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:251161 (245.2 KiB) TX bytes:180289 (176.0 KiB)
Interrupt:11 Base address:0x1400

eth1 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:258 (258.0 b) TX bytes:66516 (64.9 KiB)
Interrupt:10 Base address:0x1480



NIC BONDING IN SUN SOLARIS


First enable all network interfaces
Check all interfaces
- dladm show-link
- ifconfig e1000g0 plumb
- repeat for all other interfaces

Run /usr/bin/setup
Assign temporary static Ip addresses like 1.1.1.10/11/12/13 for the network interfaces.
The reason for assigning temporary static Ip's is because we want to create an aggregate interface.

Since we have multiple NICs, we need to aggregare them and bind to one interface

ifconfig e1000g0 unplumb
ifconfig e1000g1 unplumb
dladm create-aggr -d e1000g0 -d e1000g1 1
dladm show-aggr
dladm show-link
#Now assign static IP
ifconfig aggr1 plumb 10.10.20.117 netmask 255.255.255.0 up
#If we have to assign seperate IP's to each NIC card
ifconfig bge0 plumb 10.10.20.117 netmask 255.255.255.0 up
ifconfig bge1 plumb 10.10.10.118 netmask 255.255.255.0 up