Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, 18 November 2015

Using Wireshark to capture the packets of Remote Machine

Remote capture using wireshark:

First of, Create the pipe

my@desktop:~$ mkfifo /tmp/pipes/cap_fw
“/tmp/pipes/” is where I create my pipes, feel free to use whatever directory you prefer.
“cap_fw” is the name of the pipe I selected.
Start tcpdump remotely with ssh from the desktop where you have wireshark installed:

my@desktop:~$ ssh root@<firewall> "tcpdump -s 0 -U -n -w - -i eth1 not port 22" > /tmp/pipes/cap_fw
Replace <firewall> with the name or ip address of your remote server.

The options I used are:
-s 0 : use the required length to catch whole packets
-U : packet-buffering – write packet to pipe as soon as it is captured (as opposed to waiting for the buffer to fill)
-n : no address-to-name conversion (you can let wireshark do this if you want)
-w - : write output to standard output
-i eth1 : capture from interface eth1 – change to match your setup
not port 22 : leave out any packets from / to port 22. This is needed as we use ssh to connect to out firewall, so that we don’t capture the captured packets again… If you need to examine port 22 on your server, use ssh over an alternative port.
> /tmp/pipes/cap_fw : redirect the output to our pipe.
While tcpdump is capturing packets and sending them to the pipe, open another terminal, start wireshark and use the pipe as the input

my@desktop:~$ wireshark -k -i /tmp/pipes/cap_fw
Here the options mean:
-k : start immediately
-i /tmp/pipes/cap_fw : use our pipe as the “interface”

And you’re up and running!

Sunday, 1 November 2015

Bash Conditional Expressions

Bash Conditional Expressions

Conditional expressions are used by the [[ compound command and the test and [ built-in commands.
Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and numeric comparison operators as well. If the file argument to one of the primaries is of the form /dev/fd/N, then file descriptor N is checked. If the file argument to one of the primaries is one of /dev/stdin/dev/stdout, or /dev/stderr, file descriptor 0, 1, or 2, respectively, is checked.
When used with [[, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. The test command uses ASCII ordering.
Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself.

-a file
True if file exists.
-b file
True if file exists and is a block special file.
-c file
True if file exists and is a character special file.
-d file
True if file exists and is a directory.
-e file
True if file exists.
-f file
True if file exists and is a regular file.
-g file
True if file exists and its set-group-id bit is set.
-h file
True if file exists and is a symbolic link.
-k file
True if file exists and its "sticky" bit is set.
-p file
True if file exists and is a named pipe (FIFO).
-r file
True if file exists and is readable.
-s file
True if file exists and has a size greater than zero.
-t fd
True if file descriptor fd is open and refers to a terminal.
-u file
True if file exists and its set-user-id bit is set.
-w file
True if file exists and is writable.
-x file
True if file exists and is executable.
-G file
True if file exists and is owned by the effective group id.
-L file
True if file exists and is a symbolic link.
-N file
True if file exists and has been modified since it was last read.
-O file
True if file exists and is owned by the effective user id.
-S file
True if file exists and is a socket.
file1 -ef file2
True if file1 and file2 refer to the same device and inode numbers.
file1 -nt file2
True if file1 is newer (according to modification date) than file2, or if file1 exists and file2 does not.
file1 -ot file2
True if file1 is older than file2, or if file2 exists and file1 does not.
-o optname
True if the shell option optname is enabled. The list of options appears in the description of the -o option to the set builtin (see The Set Builtin).
-v varname
True if the shell variable varname is set (has been assigned a value).
-R varname
True if the shell variable varname is set and is a name reference.
-z string
True if the length of string is zero.
-n string
string
True if the length of string is non-zero.
string1 == string2
string1 = string2
True if the strings are equal. When used with the [[ command, this performs pattern matching as described above (see Conditional Constructs).
=’ should be used with the test command for POSIX conformance.
string1 != string2
True if the strings are not equal.
string1 < string2
True if string1 sorts before string2 lexicographically.
string1 > string2
True if string1 sorts after string2 lexicographically.
arg1 OP arg2
OP is one of ‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. These arithmetic binary operators return true if arg1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to arg2, respectively. Arg1 and arg2 may be positive or negative integers.

Monday, 26 October 2015

vim Remove Comments using REGEX | Remove comments of Asterisk Configuration files

You can try this command:
:g/^\(#\|$\)/d
Or (Use ; for the Asterisk PBX configuration files.)
:g/\v^(#|;)/d
  • \| is for alternation
  • \v is very magic (minimal backslash escape)

Wednesday, 1 July 2015

Installing FFmpeg in Ubuntu 14.04 from source

Installing FFmpeg  in Debian Ubuntu 14.04 :


Build and install FFmpeg:
cd /usr/local/src
wget -c http://ffmpeg.org/releases/ffmpeg-1.0.2.tar.gz
tar zxvf ffmpeg-1.0.2.tar.gz
cd ffmpeg
./configure --extra-cflags="-fPIC" --extra-ldflags="-lpthread" --enable-pic \
--enable-memalign-hack --enable-shared --disable-static --disable-network \
--disable-protocols --disable-pthreads --disable-devices --disable-filters \
--disable-bsfs --disable-muxers --disable-demuxers --disable-parsers \
--disable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffserver \
--disable-encoders --disable-decoders --disable-zlib --enable-gpl --disable-debug \
--enable-encoder=h263 --enable-encoder=h263p --enable-decoder=h263 \
--enable-encoder=mpeg4 --enable-decoder=mpeg4 --enable-libx264 \
--enable-encoder=libx264 --enable-decoder=h264
make -j `getconf _NPROCESSORS_ONLN`
make install
ldconfig


Monday, 22 June 2015

Opensips Nat Handling

Call fix_nat_sdp for INVITE,RE-Invite.. That's it, This route will take care of everything..


route[fix_nat_sdp] {

        if(has_body("application/sdp"))
 {
                xlog("fix_nat_sdp called\n");
                setbflag(3);
                rtpproxy_offer();       
                t_on_failure("1");
        }

 t_on_reply("1");

        if(nat_uac_test("1")){
                fix_nated_contact(); 
        }
}

onreply_route[1] {
        xlog("onreply_route called\n");
        if(nat_uac_test("1")){
                fix_nated_contact(); 
        }

        if(has_body("application/sdp")){
                rtpproxy_answer();
        }
}

Wednesday, 10 June 2015

Collection of Opensource Asterisk Applications

(Source : venturevoip )

Hopefully there are a few programs in the list that even the most seasoned Asterisk professionals have not seen before.

Flash Operator Panel

Flash Operator Panel is a switchboard type application for the Asterisk PBX. It runs on a web browser with the flash plugin. It is able to display information about your PBX activity in real time. The layout is configurable (button sizes and colors, icons, etc). You can have more than 100 buttons active per screen. On the Live Demo there are 28 buttons defined. It also supports contexts: you can have one server running and many different client displays (for hosted PBX, different departments, etc). It can integrate with CRM software, by poping up a web page (and passing the CLID) when a specified button is ringing.

PHP AGI

AGI (Asterisk Gateway Interface) is a way of running programs or scripts which are external to Asterisk. PHP AGI is a library for PHP which simplifies writing AGI scripts.

Web Meetme

Web-MeetMe is a suite of PHP pages to allow for scheduling and managing conferences on an Asterisk PBX. 

Oreka

Oreka is a modular and cross-platform system for recording and retrieval of audio streams. The project currently supports VoIP and sound device based capture. Recordings metadata can be stored in any mainstream database. Retrieval of captured sessions is web based.

FreePBX
FreePBX is a full-featured PBX web application. If you've looked into Asterisk, you know that it doesn't come with any "built in" programming. You can't plug a phone into it and make it work without editing configuration files, writing dialplans, and various messing about. 

FreePBX simplifies this by giving you pre-programmed functionality accessible by a user-friendly web interfaces that allows you to have a fully functional PBX pretty much straight away with no programming required.

FreePBX also comes as a distro

Areski CDR Stats

Asterisk-Stat is a visualisation layer for Asterisk CDR statistics which are pulled from a database. It provides graphs as well as allowing you to get more information on individual calls.





sipsak

sipsak is a small command line tool for developers and administrators of Session Initiation Protocol (SIP) applications. It can be used for some simple tests on SIP applications and devices.

Asterisk PhoneBook

A common shared phone book directory based on CMS/LAMP and build for Asterisk PBX, store name and number into MySQL which will be used by each workstation browser, also by telephones with embedded XML-browser feature.

Asterisk Desktop Assistant

Asterisk Desktop Assistant is a desktop call management application for Windows PCs.� Asterisk Desktop Assistant (ADA) is Digium?s first step towards offering a comprehensive Computer Telephony Integration (CTI) suite.� It makes dialing and handling phone calls simpler and faster by adding click-to-call functionality into popular desktop applications.� It also adds call notifications directly to the Windows desktop.

A2Billing

A2Billing combined with Asterisk now gives any Telecom company a very good reason to consider the A2Billing Soft-Switch over the traditional offerings for TDM and VoIP Soft-Switches as well as wholesale and IP PBX billing, particularly when you consider the cost of A2Billing ? FREE!

AstBill

AstBill is not only a free web-based, user friendly billing interface for Asterisk and VOIP. It is also a Asterisk configuration and GUI management tool and a standardized implementation of Asterisk using REALTIME and static configuration as you please.

OSLEC

Oslec is an open source high performance line echo canceller. When used with Asterisk it works well on lines where the built-in Zaptel echo canceller fails. No tweaks like rxgain/txgain or fxotrain are required. Oslec is supplied as GPL licensed C source code and is free as in speech.

Oslec partially complies with the G168 standard and runs in real time on x86 and Blackfin platforms. Patches exist to allow any Zaptel or DAHDI compatible hardware to use Oslec. It has been successfully tested on hardware ranging from single port X100P FXO cards to dual E1 systems.

AppKonference

AppKonference is a high-performance Asterisk voice/video conferencing module. It's basically a drop in replacement for meetme - although does things a little differently and doesn't require a timing source.

OutCall

OutCALL was designed as a commercial appplication allowing Asterisk users integration with Microsoft Outlook with placing and receiving phone calls.

After over 1000 downloads as a free application, Bicom Systems Ltd. has decided to offer OutCALL in open source format in order to further stimulate development of Asterisk and related open source projects.

VMukti

VMukti is leading Asterisk/ Yate enabled p2p Video IP Communications Suite for Web / PSTN. These serverless broadband ready platform enable OS community to save 90% on capital & operating costs over proprietary software for conferencing & Call Center. 

Note from editor: I've personally never managed to get this working - drop me a line if you do get it all set up and going.

Asterisk-CRM

asterCRM is a call center software for asterisk based VoIP system, also it has some CRM functions. It provides useful features such as pop-up, predictive dialer, click to call, extension status .... astercrm could work with all asterisk based system. 

AsterCC

astercc is a realtime billing solution for asterisk, could work with all kinds of asterisk based system and no need do any change to your original system. astercc could be used for hosted callshop solution, pbx billing solution. 

IAXModem

IAXmodem is a software modem written in C that uses an IAX channel (commonly provided by an Asterisk PBX system) instead of a traditional phone line and uses a DSP library instead of DSP hardware chipsets.

Asterisk PBX Integration Zimlet

Asterisk PBX Integration Zimlet is an Extension for Zimbra Collaboration Suite. The Zimlet does Interface with the Asterisk Manager Interface to integrate with Asterisk PBX. The main focus is dial-on-click for Phone numbers inside Contacts and Emails. 

AsterFax - Asterisk Email to Fax Gateway

AsterFax provides an Email to Fax gateway for Asterisk. AsterFax lets you send an email by Fax. Enter the phone no. in the 'To' address, compose your email message and click send. You can also fax a MS-Word document or other attachment. 

Asterisk Monitor

Asterisk Monitor is a HTML interface that acts a operator pannel for asterisk to display user/peer status and calls. This uses a reverse AJAX, PHP and Python to originate, transfer and hangup calls, manage queues and meetme rooms. 

OpenBTS
The OpenBTS Project is an effort to construct an open-source GSM basestation using the USRP and the Asterisk VoIP PBX. Our goal is to enable a new type of hybrid GSM/VoIP cellular network for greenfield deployments in the developing world. 

Asterisk .NET

The Asterisk .NET library consists of a set of C# classes that allow you to easily build applications that interact with an Asterisk PBX Server (1.0/1.2/1.4 version). Both FastAGI and Manager API supported. .NET/Mono compatible. 

AGX's Asterisk Extra AddOns

Maintained version of old asterisk applications ported to 1.4 that for copyright reasons cannot be included into official Digium's releases and that for some reason the author is not keeping up-to-date. The project also require Zaptel instead of DAHDI. 

AstTAPI

AstTapi, an opensource Asterisk Tapi driver for windows. This allows users of TAPI compliant applications such as Outlook and Act to dial contacts directly from the application using an Asterisk PBX Server. 

Asterisk-Java

A java interface for Asterisk - allows you to write software in Java which will work with Asterisk.

IAXClient

A lightweight cross platform IP telephony client using the IAX protocol, designed for use with the Asterisk open source PBX. 

Asterisk Desktop Manager

A desktop application for managing Asterisk including screen pops etc - looks quite nice but haven't tried it.

Asterisk JTAPI

Asterisk-JTAPI is a JTAPI implementation for the Asterisk software PBX system. JTAPI is a provider independent programming interface for Java to build applications for computer telephony or to add support for it. JTAPI covers a wide range of usage scenarios starting from controlling a single telephone to a whole PBX system for example in call-centers.

Asterisk-JTAPI builds on top of two other projects: Asterisk-Java, which provides a Java interface to the Asterisk manager API, and, GJTAPI, which provides a general framework for JTAPI interfaces.

Astmail

Web interface to Asterisk voicemail written in php. Includes some AJAX components such as LDAP-suggest, and user-lookup. Includes screens for forward by email and sms configuration. 

Druid
Druid is an open source unified communications platform, built around technology such as Asterisk, IMAP, XMPP. Druid gives your organization access to the best available IP communications platform that bringing together voicemail, VOIP, mobile phone, faxes and instant messaging.

ViciDial

VICIDIAL is a set of programs that are designed to interact with the Asterisk Open-Source PBX Phone system to act as a complete inbound/outbound call center suite. 

The agent interface is an interactive set of web pages that work through a web browser to give real-time information and functionality with nothing more than an internet browser on the client computer. 

Asterisk Queue/CDR Log Analyzer

The Asterisk Queue (and CDR) Log Analyzer is a set of PHP scripts which allow selecting, listing and graphing of records from the Asterisk Queue and CDR logs via a WEB interface.

For easier access to select specific log records, the Queue and CDR logs need to be in a MySQL database. Asterisk itself records (specified in a conf file) CDR data into a MySQL database table. A Python utility program called loadq.py is provided with this package which can be used to load queue log records (as they are created) into a MySQL database table.

Asterisk WEB/PHP Event Monitor

The Asterisk Event Monitor WEB/PHP Interface was created to view the current state of Asterisk and all Asterisk Events via a WEB interface. It does not poll Asterisk for these events, instead it collects them in a MySql database via an Asterisk Manager API python script. AJAX (Javascript) is used to display the events from the database almost as they occur. All code is released under the GNU GPL license.


Crystal Recording Interface

CRI (Crystal Clear Recording Interface) provides an intelligence web interface to track is recordings and his voice mail

Features :

Access your voicemail recordings.
Setup your voice mail box
View summary of your incoming outgoing calls
Search calls and recordings by day and time.
Call monitor recordings.

Xivo

XiVO is a full PBX solution based on Asterisk with a user-friendly web interface, provisioning tools for many types of phones, CTI daemon and CTI client for Windows, Linux and MacOS. All solutions are released under GPLv3. Currently only released in French, but easy to translate in other languages, XiVO provides administrators with a simple to configure phone system.

You can find a demo on https://demo.xivo.fr with login root and password proformatique so you can try it out for yourself.


Monday, 8 June 2015

How to run Tomcat on port 80 in Ubuntu or Debian

Following works:
First, set AUTHBIND=yes in /etc/default/tomcat7 file
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown tomcat7 /etc/authbind/byport/80

Wednesday, 27 May 2015

RTPEngine Explained. Role of RTP engine in SIP provider CE

RTP Engine :

The Media Relay (also called rtpengine) is a Kernel-based packet relay, which is controlled by the SIP proxy. For each media stream (e.g. a voice and/or video stream), it maintains a pair of ports in the range of port number 30000 to 40000. When the media streams are negotiated, rtpengine opens the ports in user-space and starts relaying the packets to the addresses announced by the endpoints. If packets arrive from different source addresses than announced in the SDP body of the SIP message (e.g. in case of NAT), the source address is implicitly changed to the address the packets are received from. Once the call is established and the rtpengine has received media packets from both endpoints for this call, the media stream is pushed into the kernel and is then handled by a custom Sipwise iptables module to increase the throughput of the system and to reduce the latency of media packets.

The rtpengine internally listens on UDP port 12222 for control messages from the SIP proxy. For each media stream, it opens two pairs of UDP ports on the public interface in the range of 30000 and 40000 per default, one pair on odd port numbers for the media data, and one pair on the next even port numbers for meta data, e.g. RTCP in case of RTP streams. Each endpoint communicates with one dedicated port per media stream (opposed to some implementations which use one pair for both endpoints) to avoid issues in determining where to send a packet to. The rtpengine also sets the QoS/ToS/DSCP field of each IP packet it sends to a configured value, 184 (0xB8, expedited forwarding) by default.

The kernel-internal part of the rtpengine is facilitated through an iptables module having the target name RTPENGINE. If any additional firewall or packet filtering rules are installed, it is imperative that this rule remains untouched and stays in place. Otherwise, if the rule is removed from iptables, the kernel will not be able to forward the media packets and forwarding will fall back to the user-space daemon. The packets will still be forwarded normally, but performance will be much worse under those circumstances, which will be especially noticeable when a lot of media streams are active concurrently. See the section on Firewalling for more information.

Wednesday, 20 May 2015

Heartbeat Cluster Configuration

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

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 node2
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.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 server and 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 packets and 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 least twice 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 unicast 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, controle 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 node1
rp1.linuxnix.com 10.77.225.20 squid

Step4(b) : Just specify below entry in last line of this file on node1
rp1.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/surendr...directs=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 hostnames 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 on node1 and 10.77.225.20
Clipped 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

E-mail Newsletter

Sign up now to receive breaking news and to hear what's new with us.

Recent Articles

© 2014 VOIP4Learn. WP themonic converted by Bloggertheme9. Powered by Blogger.
TOP