Wednesday, June 5, 2013

BGP Looking Glass - Zebra || CentOS 6

Using Zebra Routers with Looking Glass

The syntax for the Zebra Router is provided with the configuration file. Adding devices is very simple-

vim /var/www/html/lg/lg.conf

<!-- Zebra Router Section  -->
<Router Name="Zebra-1 " OSType = "Zebra">
                       <URL>telnet://pass@IP:port </URL>
<!--EXAMPLE   <URL>telnet://login:123456@,2605</URL> -->

Issues with Trace and Ping 

I was not able to use Trace or Ping using Zebra router as the commands are not built in with Zebra. However, the BGP commands should work without any problems.

Ping Using Zebra

Trace Using Zebra
 Hope this helps :)

Tuesday, June 4, 2013

Setting Up BGP Looking Glass - CentOS 6

Setting Up Looking Glass 


A looking glass is a server that allows someone from outside the network to get information about the how traffic is routed through the network backbone of an organization. For example, suppose Alpha Corp. has one router in the US and another in Australia. An outside user wants to know how traffic towards Japan is routed from both of these Routers. As the user does not have credentials to the Routers, he cannot run traceroutes. The solution: a Looking Glass. If Alpha Corp. has a looking glass, the user can query about ping, trace, BGP and other information through the web-based looking glass without needing to authenticate to the actual router.

Setting Up 

Before we start please make sure SELinux is disabled. Also, iptables should allow the required ports, from the top of my head – 23, 2601, 2605, 80. 

Phase 1: Working YUM Server 

Make sure that your server has access to a good yum server, preferably repoforge. Information about how to add the repository of repoforge can be found at

Phase 2: Downloading Necessary Prerequisites 

Fortunately, the LG looking glass does not have many prerequisites. The following should suffice-

yum install wget  perl-Net-Telnet perl-Net-Telnet-Cisco perl-XML-Parser httpd

Phase 3: Installing Looking Glass 

Looking glass is freely available and can be downloaded and extracted using the following commands-

cd /root
tar zxvf lg-1.9.tar.gz
mkdir /var/www/html/lg

Necessary files have to copied to /var/www/html/lg and permissions need to be corrected as well

cd /var/www/html/lg
cp /root/lg-1.9/lg.cgi . 
cp /root/lg-1.9/favicon.ico .
cp /root/lg-1.9/lg.conf  .
chmod 644 *
chmod 755 lg.cgi

Phase 4: Tuning the Web Server

vim /etc/httpd/conf/httpd.conf

    Alias /lg/favicon.ico "/var/www/html/lg/favicon.ico"
    ScriptAlias /lg "/var/www/html/lg/lg.cgi"

service httpd restart
chkconfig httpd on

Part 5: Adding Routers 

All routers are added in the file /var/www/html/lg/lg.conf. Luckily, the file is self explanatory-
vim /var/www/html/lg/lg.conf

<!-- Test CISCO Router Section  -->

                <Separator>Sample Routers </Separator>

                <Router Name="Router-1">
        <!--EXAMPLE   <URL>telnet://login:123456@</URL> -->

                <Router Name="Router-2">

                <Router Name="Router-3">

Now, we should be able to access the Looking Glass via the URL: IP/lg e.g.

Phase 6: Tuning (Optional)

 Log File 

touch /var/log/lg.log
chown apache:apache /var/log/lg.log

vim /var/www/html/lg/lg.conf


Copy the logo file to /var/www/html/images

mkdir /var/www/html/images

vim /var/www/html/lg/lg.conf
    <LogoImage Align="center" Link="">/images/logo.png</LogoImage>


vim /var/www/html/lg/lg.conf
<HTMLTitle>ASXXXX-Looking Glass</HTMLTitle>

vim /var/www/html/lg/lg.cgi
#### In the closing section of the HTML tag i.e. </HTML>, the following line can be added-####
  Please email questions or comments to
 <A HREF="mailto:$email">$email</A>.
Powered By: <a href="">Looking Glass 1.9</a></P>


TATA: AS6453

NovoCom: AS132267
  Hope this helps :)