Saturday, August 25, 2012

Zeroshell- Netbalancer and failover Configuration

In my office network I have one broadband and one T1 line.I planning a solution to accomplish that if any one connection disconnected the end user need not be affected at the same time to implement this the cost has to be considered. After long way of hunting finally I found Zeroshell it very lite and easy to implement and can be configure using a browser.

My scenario


Let Start

1. Downloaded Zeroshell from this Here and write it to cd
2. Boot the system with zeroshell cd
3. After Booting into the press "I" to enter into interface configuration mode where I changed Ip address of ETH00 to 10.10.20.20 and subnet mask to 255.255.255.192 default gateway as 10.10.20.20 ( later it will be disabled )
4. Then rebooted the system
5. After Booting go to any system in that network open a browser and type ip address in a address bar as 10.10.20.20 and hit enter it will now ask user name and password as I didn't changed default I entered admin as user name and zeroshell as password and entered into console.
6. now created a profile in hard disk so that in the future the configuration will be saved otherwise everytime after rebooting we need to configure again and again.
7. To create profile go to home page and find the profile tab and hit enter. It will now show the hardisk as sda or hda select it and click create profile now in the form filled out description abt the server (optiona) and everything filled out and save.
8. Profile created now I configured interfaces by go to network tab and configured ETH01 and ETH02 with 219.xxx.xxx.xx and 192.168.3.2 respectively.
9. Now configured Nat for ETH01 and ETH02.
10. After that configured gateway by go to Netbalancer and add default gateway for Both T1 and Broadband routers as their respective Ip addresses.
11. Disable the default gateway the system selected itself as 10.10.20.20 and make other two gateways active. Make ICMP failover checking enabled, and give failover addresses as google's and open dns addresses (8.8.8.8, 4.2.2.2, 208.67.222.222)and enabled them.
12. and then in the Http prox tab add capturing rules for eth00 and enable http proxy.
13. Its a transparent Proxy so we don't need to change anything in client system. We just add default gateway and dns server address as zeroshell's address (10.10.20.20 in my case).
14. If you want add QOS then enter into qos tab and add class manager as you required I did like accounts, reception, backoffice, billing, IT Dept and administrators)
15. Configure Classifiers (ie users belonging to that class managers ) If the network been segregated as separate departments it will be so easy as we have to just mention starting Ip and end Ip add.
16. Now add class to interface eth00 in interface manager tab in qos.

Thats it now the network will be without internet failure ..


Monday, November 15, 2010

Asterisk Installation on Fedora core

Asterisk installation on Fedora Core 2 final
Introduction

This how-to guide outlines the process for a fresh installation of Redhat Linux (Fedora Core 2 Final) and Asterisk. The purpose of this document is to get you up and running (making and receiving phone calls) in about an hour. Experimenting with Asterisk, enabling more features and unlocking its potential is left up to you!

This configuration was created and tested on:

DELL PowerEdge 400SC ($350)
---------------------------
Intel Pentium 4 2.40Ghz
256MB RAM
Standard configuration, no extra hardware


Installing Redhat Fedora Core 2 Final

- Download Redhat Fedora Core 2 FINAL from http://fedora.redhat.com/download and burn the CD ISO images (you only need CDs 1 and 2)
- Insert the CD and reboot into setup
- Hit enter to start graphical setup
- Skip the media test
- After the graphical setup starts, click Next to continue
- Select a language and click Next
- Select a keyboard configuratoin and click Next
- If asked, select "Install Fedora Core" and click Next
- Select an installation type of Custom and click Next
- Select Automatically Partition and click Next
- If asked, select "Remove all partitions on this system". WARNING: This will erase ALL data on your computer!
- Select Yes to confirm removing all data on your computer.
- Click Next to accept default Disk Setup
- Click Next to accept default Boot Loader Configuration
- Click Next to accept default Network Configuration
- Select No Firewall for the Firewall Configuration and click Next. WARNING: We do not recommend connecting this test server directly to the Internet! This server is configured without a firewall for simplicity. You can enable the firewall later and make the necessary changes to keep Asterisk working.
- Click Next to accept default Additional Language Support
- Select a time zone and click Next
- Enter a root password and click Next
- For Package Group Selection, select ONLY the following and de-select the other options:

* X Window System
* GNOME Desktop
* Editors
* Graphical Internet
* Text-based Internet
* Development Tools

- Click Next to accept Package Group Selection
- Click Next to begin installation
- Click Continue
- Insert Disc 2 when prompted and click OK
- When CD installation is complete, click Reboot
- After rebooting, the post-installation process will begin
- Click Next to continue
- Accept the License Agreement and click Next
- Set the date and time and click Next
- Click Next to accept the default Display settings
- Create a User Account with a different username and password than the "root" user created earlier and click Next
- If asked, confirm your sound card and click Next
- Click Next to skip the Additional CDs section
- Click Next to Finish setup

Installing Asterisk

- Login to your server as the user you created during install
- Right-click on the background and select Open Terminal
- Type "su -" on the command line, then enter the "root" user password when prompted
- Run the following commands to download Asterisk:

cd /usr/src
export CVSROOT=:pserver:anoncvs@cvs.digium.com:/usr/cvsroot
cvs login <--- This command will prompt for a password, use anoncvs
cvs checkout asterisk

- This will download the latest version of Asterisk to your server. WARNING: This will download the very latest DEVELOPMENT version of Asterisk. It is NOT suitable for production use, just for testing!
- Run the following commands to compile Asterisk:

cd /usr/src/asterisk
make clean
make
make install
make samples



* Note: You may need to "make install" several times before it really works.



Configuring Asterisk

- Login to your server as user "root"
- Right-click on the background and select Open Terminal


- Run the following commands to backup your current/sample configurations:

cd /etc/asterisk
mv iax.conf iax.backup
mv extensions.conf extensions.backup

- Run the following commands to download VoicePulse sample configurations:

cd /etc/asterisk
wget http://connect.voicepulse.com/samples/iax.sample
wget http://connect.voicepulse.com/samples/extensions.sample

- Run the following commands to rename the sample configurations:

cd /etc/asterisk
mv iax.sample iax.conf
mv extensions.sample extensions.conf

- Run the following commands to read and edit the VoicePulse Asterisk configurations:

cd /etc/asterisk
gedit iax.conf &
gedit extensions.conf &

- In iax.conf, make the changes outlined in the QUICKSTART section of the sample file, save the file and close it.
- In extensions.conf make the changes outlined in the QUICKSTART section of the sample file, save the file and close it.

Test incoming & outgoing calls

- Start Asterisk on your test server by running:


/usr/sbin/asterisk -vvvgc

- Run the following command to get the IP address of your Asterisk server:

ifconfig

- Look for the value after "inet addr:" to determine the IP address
- Download "Dante's DIAX Software Phone" to your Windows PC
- Start DIAX
- Click on Config > Registration
- Enter the following information (this "user" is already created in the sample iax.conf you downloaded from VoicePulse):

Alias: VoicePulse
Server: the IP address of your server that you determined above
Username: diax
Password: diaxpassword
Password: diaxpassword
Register: checked

- Click Save
- Click OK
- Dial a non-VoicePulse phone number to test outgoing calls like 1-888-225-5322
- You should see something similar to the following scroll across your Asterisk terminal window:

— Accepting AUTHENTICATED call from 192.168.1.100, requested format = 2, actual format = 2
— Executing Dial("IAX2/diax@diax/3", "IAX2/MY_DEVICE_LOGIN:MY_DEVICE_PASSWORD@gwiaxt01.voicepulse.com/18882255322") in new stack
— Call accepted by 66.234.228.160 (format GSM)

- Add a phone number to your VoicePulse Connect! account from the Phone Numbers menu in your Account Center.
- Dial the incoming VoicePulse Connect! phone number on your account from a non-VoicePulse phone.
- You should see something similar to the following scroll across your Asterisk terminal window:

— Accepting AUTHENTICATED call from 66.234.228.170, requested format = 4, actual format = 4
— Executing Playback("IAX2/voicepulse-in-01@66.234.228.170:4569/4", "beep") in new stack

- Dialing into your Asterisk server should read back your phone number to you and then read back any digits you dial.
- If incoming and outgoing calls work, your Asterisk setup is complete! See www.asterisk.org or www.voip-info.org for more details on customizing your Asterisk setup.

Tuesday, March 11, 2008

Format the hard disk In Linux
Step #1 : Partition the new disk using fdisk command

Following command will list all detected hard disks:
# fdisk -l | grep '^Disk'
Output:

Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes

A device name refers to the entire hard disk. For more information see Linux partition naming convention and IDE drive mappings.
To partition the disk - /dev/sdb, enter:
# fdisk /dev/sdb
The basic fdisk commands you need are:

  • m - print help
  • p - print the partition table
  • n - create a new partition
  • d - delete a partition
  • q - quit without saving changes
  • w - write the new partition table and exit

Step#2 : Format the new disk using mkfs.ext3 command

To format Linux partitions using ext2fs on the new disk:
# mkfs.ext3 /dev/sdb1

Step#3 : Mount the new disk using mount command

First create a mount point /disk1 and use mount command to mount /dev/sdb1, enter:
# mkdir /disk1
# mount /dev/sdb1 /disk1
# df -H

Step#4 : Update /etc/fstab file

Open /etc/fstab file, enter:
# vi /etc/fstab
Append as follows:

/dev/sdb1               /disk1           ext3    defaults        1 2

Save and close the file.

Task: Label the partition

You can label the partition using e2label. For example, if you want to label the new partition /backup, enter
# e2label /dev/sdb1 /backup
You can use label name insted of partition name to mount disk using /etc/fstab:
LABEL=/backup /disk1 ext3 defaults 1 2

Wednesday, February 20, 2008

/dev directory explained

The /dev directory

The /dev directory contains the special device files for all the devices. The device files are created during installation, and later with the /dev/MAKEDEV script. The /dev/MAKEDEV.local is a script written by the system administrator that creates local-only device files or links (i.e. those that are not part of the standard MAKEDEV, such as device files for some non-standard device driver).

This list which follows is by no means exhaustive or as detailed as it could be. Many of these device files will need support compiled into your kernel for the hardware. Read the kernel documentation to find details of any particular device.

If you think there are other devices which should be included here but aren't then let me know. I will try to include them in the next revision.

/dev/dsp

Digital Signal Processor. Basically this forms the interface between software which produces sound and your soundcard. It is a character device on major node 14 and minor 3.

/dev/fd0

The first floppy drive. If you are lucky enough to have several drives then they will be numbered sequentially. It is a character device on major node 2 and minor 0.

/dev/fb0

The first framebuffer device. A framebuffer is an abstraction layer between software and graphics hardware. This means that applications do not need to know about what kind of hardware you have but merely how to communicate with the framebuffer driver's API (Application Programming Interface) which is well defined and standardized. The framebuffer is a character device and is on major node 29 and minor 0.

/dev/hda

/dev/hda is the master IDE drive on the primary IDE controller. /dev/hdb the slave drive on the primary controller. /dev/hdc , and /dev/hdd are the master and slave devices on the secondary controller respectively. Each disk is divided into partitions. Partitions 1-4 are primary partitions and partitions 5 and above are logical partitions inside extended partitions. Therefore the device file which references each partition is made up of several parts. For example /dev/hdc9 references partition 9 (a logical partition inside an extended partition type) on the master IDE drive on the secondary IDE controller. The major and minor node numbers are somewhat complex. For the first IDE controller all partitions are block devices on major node 3. The master drive hda is at minor 0 and the slave drive hdb is at minor 64. For each partition inside the drive add the partition number to the minor minor node number for the drive. For example /dev/hdb5 is major 3, minor 69 (64 + 5 = 69). Drives on the secondary interface are handled the same way, but with major node 22.

/dev/ht0

The first IDE tape drive. Subsequent drives are numbered ht1 etc. They are character devices on major node 37 and start at minor node 0 for ht0 1 for ht1 etc.

/dev/js0

The first analogue joystick. Subsequent joysticks are numbered js1, js2 etc. Digital joysticks are called djs0, djs1 and so on. They are character devices on major node 15. The analogue joysticks start at minor node 0 and go up to 127 (more than enough for even the most fanatic gamer). Digital joysticks start at minor node 128.

/dev/lp0

The first parallel printer device. Subsequent printers are numbered lp1, lp2 etc. They are character devices on major mode 6 and minor nodes starting at 0 and numbered sequentially.

/dev/loop0

The first loopback device. Loopback devices are used for mounting filesystems which are not located on other block devices such as disks. For example if you wish to mount an iso9660 CD ROM image without burning it to CD then you need to use a loopback device to do so. This is usually transparent to the user and is handled by the mount command. Refer to the manual pages for mount and losetup. The loopback devices are block devices on major node 7 and with minor nodes starting at 0 and numbered sequentially.

/dev/md0

First metadisk group. Metadisks are related to RAID (Redundant Array of Independent Disks) devices. Please refer to the most current RAID HOWTO at the LDP for more details. This can be found at http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html. Metadisk devices are block devices on major node 9 with minor nodes starting at 0 and numbered sequentially.

/dev/mixer

This is part of the OSS (Open Sound System) driver. Refer to the OSS documentation at http://www.opensound.com for more details. It is a character device on major node 14, minor node 0.

/dev/null

The bit bucket. A black hole where you can send data for it never to be seen again. Anything sent to /dev/null will disappear. This can be useful if, for example, you wish to run a command but not have any feedback appear on the terminal. It is a character device on major node 1 and minor node 3.

/dev/psaux

The PS/2 mouse port. This is a character device on major node 10, minor node 1.

/dev/pda

Parallel port IDE disks. These are named similarly to disks on the internal IDE controllers (/dev/hd*). They are block devices on major node 45. Minor nodes need slightly more explanation here. The first device is /dev/pda and it is on minor node 0. Partitions on this device are found by adding the partition number to the minor number for the device. Each device is limited to 15 partitions each rather than 63 (the limit for internal IDE disks). /dev/pdb minor nodes start at 16, /dev/pdc at 32 and /dev/pdd at 48. So for example the minor node number for /dev/pdc6 would be 38 (32 + 6 = 38). This scheme limits you to 4 parallel disks of 15 partitions each.

/dev/pcd0

Parallel port CD ROM drives. These are numbered from 0 onwards. All are block devices on major node 46. /dev/pcd0 is on minor node 0 with subsequent drives being on minor nodes 1, 2, 3 etc.

/dev/pt0

Parallel port tape devices. Tapes do not have partitions so these are just numbered sequentially. They are character devices on major node 96. The minor node numbers start from 0 for /dev/pt0, 1 for /dev/pt1, and so on.

/dev/parport0

The raw parallel ports. Most devices which are attached to parallel ports have their own drivers. This is a device to access the port directly. It is a character device on major node 99 with minor node 0. Subsequent devices after the first are numbered sequentially incrementing the minor node.

/dev/random or /dev/urandom

These are kernel random number generators. /dev/random is a non-deterministic generator which means that the value of the next number cannot be guessed from the preceding ones. It uses the entropy of the system hardware to generate numbers. When it has no more entropy to use then it must wait until it has collected more before it will allow any more numbers to be read from it. /dev/urandom works similarly. Initially it also uses the entropy of the system hardware, but when there is no more entropy to use it will continue to return numbers using a pseudo random number generating formula. This is considered to be less secure for vital purposes such as cryptographic key pair generation. If security is your overriding concern then use /dev/random, if speed is more important then /dev/urandom works fine. They are character devices on major node 1 with minor nodes 8 for /dev/random and 9 for /dev/urandom.

/dev/sda

The first SCSI drive on the first SCSI bus. The following drives are named similar to IDE drives. /dev/sdb is the second SCSI drive, /dev/sdc is the third SCSI drive, and so forth.

/dev/ttyS0

The first serial port. Many times this it the port used to connect an external modem to your system.

/dev/zero

This is a simple way of getting many 0s. Every time you read from this device it will return 0. This can be useful sometimes, for example when you want a file of fixed length but don't really care what it contains. It is a character device on major node 1 and minor node 5.

/etc directory -explained

The /etc directory

The /etc maintains a lot of files. Some of them are described below. For others, you should determine which program they belong to and read the manual page for that program. Many networking configuration files are in /etc as well, and are described in the Networking Administrators' Guide.

/etc/rc or /etc/rc.d or /etc/rc?.d

Scripts or directories of scripts to run at startup or when changing the run level. See Section 2.3.1 for further information.

/etc/passwd

The user database, with fields giving the username, real name, home directory, and other information about each user. The format is documented in the passwd manual page.

/etc/shadow

/etc/shadow is an encrypted file the holds user passwords.

/etc/fdprm

Floppy disk parameter table. Describes what different floppy disk formats look like. Used by setfdprm . See the setfdprm manual page for more information.

/etc/fstab

Lists the filesystems mounted automatically at startup by the mount -a command (in /etc/rc or equivalent startup file). Under Linux, also contains information about swap areas used automatically by swapon -a . See Section 5.10.7 and the mount manual page for more information. Also fstab usually has its own manual page in section 5.

/etc/group

Similar to /etc/passwd, but describes groups instead of users. See the group manual page in section 5 for more information.

/etc/inittab

Configuration file for init.

/etc/issue

Output by getty before the login prompt. Usually contains a short description or welcoming message to the system. The contents are up to the system administrator.

/etc/magic

The configuration file for file. Contains the descriptions of various file formats based on which file guesses the type of the file. See the magic and file manual pages for more information.

/etc/motd

The message of the day, automatically output after a successful login. Contents are up to the system administrator. Often used for getting information to every user, such as warnings about planned downtimes.

/etc/mtab

List of currently mounted filesystems. Initially set up by the bootup scripts, and updated automatically by the mount command. Used when a list of mounted filesystems is needed, e.g., by the df command.

/etc/login.defs

Configuration file for the login command. The login.defs file usually has a manual page in section 5.

/etc/printcap

Like /etc/termcap /etc/printcap , but intended for printers. However it uses different syntax. The printcap has a manual page in section 5.

/etc/profile, /etc/bash.rc, /etc/csh.cshrc

Files executed at login or startup time by the Bourne, BASH , or C shells. These allow the system administrator to set global defaults for all users. Users can also create individual copies of these in their home directory to personalize their environment. See the manual pages for the respective shells.

/etc/securetty

Identifies secure terminals, i.e., the terminals from which root is allowed to log in. Typically only the virtual consoles are listed, so that it becomes impossible (or at least harder) to gain superuser privileges by breaking into a system over a modem or a network. Do not allow root logins over a network. Prefer to log in as an unprivileged user and use su or sudo to gain root privileges.

/etc/shells

Lists trusted shells. The chsh command allows users to change their login shell only to shells listed in this file. ftpd, is the server process that provides FTP services for a machine, will check that the user's shell is listed in /etc/shells and will not let people log in unless the shell is listed there.

/etc/termcap

The terminal capability database. Describes by what ``escape sequences'' various terminals can be controlled. Programs are written so that instead of directly outputting an escape sequence that only works on a particular brand of terminal, they look up the correct sequence to do whatever it is they want to do in /etc/termcap. As a result most programs work with most kinds of terminals. See the termcap, curs_termcap, and terminfo manual pages for more

லினுக்ஸ் கேர்ணல்

The Linux kernel consists of several important parts: process management, memory management, hardware device drivers, filesystem drivers, network management, and various other bits and pieces. Figure 2-1 shows some of them.

Figure 2-1. Some of the more important parts of the Linux kernel

Probably the most important parts of the kernel (nothing else works without them) are memory management and process management. Memory management takes care of assigning memory areas and swap space areas to processes, parts of the kernel, and for the buffer cache. Process management creates processes, and implements multitasking by switching the active process on the processor.

At the lowest level, the kernel contains a hardware device driver for each kind of hardware it supports. Since the world is full of different kinds of hardware, the number of hardware device drivers is large. There are often many otherwise similar pieces of hardware that differ in how they are controlled by software. The similarities make it possible to have general classes of drivers that support similar operations; each member of the class has the same interface to the rest of the kernel but differs in what it needs to do to implement them. For example, all disk drivers look alike to the rest of the kernel, i.e., they all have operations like `initialize the drive', `read sector N', and `write sector N'.

Some software services provided by the kernel itself have similar properties, and can therefore be abstracted into classes. For example, the various network protocols have been abstracted into one programming interface, the BSD socket library. Another example is the virtual filesystem (VFS) layer that abstracts the filesystem operations away from their implementation. Each filesystem type provides an implementation of each filesystem operation. When some entity tries to use a filesystem, the request goes via the VFS, which routes the request to the proper filesystem driver