How to set up BGP and looking glass server in Cent OS6

This tutorial will explain how to createa BGP Looking Glass server on CentOS. For those not used to the concept of BGP looking Glass, let’s commence with introduction.

 Border Gateway Protocol (BGP)?

BGP is the routing backbone of the Internet. Inevitably the Internet is made up of numerous interconnected networks. The telecom industry, refers the networks  as Autonomous Systems (ASs). Each AS is managed with a single administrative domain (e.g., one organization or even perhaps ISP), with its unique AS number and IP prefixes.  The AS number is always private (i.e., not visible publicly), and thus is most likely the IP pools.  when one office interconnects its multiple branches they are able to work with a private AS number and IP prefix per branch office. Networks that wish to use a publicAS number and publicly routable IP addresses have to get them from a Regional Internet Registry (RIR) like ARIN, APNIC, RIPE. The RIR assigns an original  AS number and IP prefix(es) for the network.

BGP implementation is the internet industry standard inter-domain routing protocol for the interconnection of different ASs. All IP prefixes recognized to one AS are shared with neighboring ASs, thus populating the BGP routing tables with their border routers. The Web is an interconnection between millions of public ASs through BGP making it fundamentally the routing backbone of the Internet.

 Looking Glass?

Looking Glass (LG)is a web based tool which enables network operators analyze how traffic is routed both to and from a specific AS. The BGP routing is determined by how many other AS are connected.  IP prefixes learnt from neighboring ASs will populate and determine BGP routing table, to generate its routing decisions. for troubleshooting routing or network latency related issues, we would like to run ping or traceroute tools coming from a remote AS. Naturally, these tests provide useful test results during network troubleshooting from other AS’s networks. During troubleshooting, it is impossible for remote users to directly access servers by logging in, therefore admins can use Looking Glass to enable them perform traceroutes or ping probes without logging in.

installing BGP

First, we ensure the neccessary dependancies are installed

[root@keadmin ~]# yum install wget perl-Net-Telnet perl-Net-Telnet-Cisco perl-XML-Parser httpd

neccessary directory where the LG site will be extracted and downloaded should be created.

[root@keadmin ~]# cd /root
 [root@keadmin ~]# wget http://www.version6.net/lg/lg-1.9.tar.gz
 [root@keadmin ~]# tar zxvf lg-1.9.tar.gz
 [root@keadmin ~]# mkdir /var/www/html/lg

all files having been extracted, neccessary permissions needs to be set

[root@lg ~]# cd /var/www/html/lg
 [root@lg lg]# cp /root/lg-1.9/lg.cgi .
 [root@lg lg]# cp /root/lg-1.9/favicon.ico .
 [root@lg lg]# cp /root/lg-1.9/lg.conf .
[root@lg lg]# chmod 644 *

Tuning the webserver by creating the index.html and editing it with the neccesary parameters

[root@lg ~]# vim /var/www/html/index.html

In case DNS is set up for the Looking Glass server:

<html>
<head>
<meta http-equiv="refresh" content="0;url=http://lg.example.tst/lg/lg.cgi">
</head>
</html>
   
without DNS
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://IP/lg.cgi">
</head>
</html>
[root@lg ~]# vim /etc/httpd/conf/httpd.conf
## The favicon path and the cgi script paths are defined ##
Alias /lg/favicon.ico "/var/www/html/lg/favicon.ico"
ScriptAlias /lg "/var/www/html/lg/lg.cgi"

The httpd service is started and added to startup list.

[root@lg ~]# service httpd start
 
[root@lg ~]# chkconfig httpd on

adding specific routers to the LG.conf file


[root@lg ~]# vim /var/www/html/lg/lg.conf

<!-- Router Section  -->

<Separator>Sample Routers</Separator>

<Router Name="Router-A">

<Title>Router-A</Title>

<URL>telnet://login:routerPassword@routerIP</URL>

<!--EXAMPLE   <URL>telnet://login:123456@10.10.10.1</URL> -->

</Router>

<Router Name="Router-B">

<Title>Router-B</Title>

<URL>telnet://login:routerPassword@routerIP</URL>

</Router>


 
Advertisements