User Tools

Site Tools


hints:misc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
hints:misc [2023/07/08 20:53] – created philiphints:misc [2023/08/19 07:20] (current) – [Building a Looking Glass] philip
Line 5: Line 5:
 ===== Building BGPDUMP ===== ===== Building BGPDUMP =====
  
-First off, we clone the git repo locally. Go to the place where you normally do your development work (for example, /usr/local/src), and:+[[https://github.com/RIPE-NCC/bgpdump/wiki|BGPDUMP]] is a tool and set of libraries maintained by the RIPE NCC which reads MRT (Multi-Threaded Routing Toolkit) files and outputs them in human readable format (ie ASCII). 
 + 
 +First off, we clone the git repo locally. Go to the place where you normally do your development work (for example, **/usr/local/src**), and:
  
 <code> <code>
Line 11: Line 13:
 </code> </code>
  
-Next makes sure we have the libraries and packages we need installed:+Next make sure we have the libraries and packages we need installed:
  
 <code> <code>
-sudo apt install libz-dev autoheader+sudo apt install libz-dev libbz2-dev autoheader
 </code> </code>
 +
 +and then go into the **bgpdump** folder and build the **Makefile**:
 +
 +<code>
 +cd bgpdump
 +./bootstrap.sh
 +</code>
 +
 +Once this is done we can then build **bgpdump**:
 +
 +<code>
 +make
 +</code>
 +
 +and then install it:
 +
 +<code>
 +sudo make install
 +</code>
 +
 +which will put **bgpdump** into **/usr/local/bin**.
 +
 +You can now take your MRT files, eg as produce by [[http://routeviews.org|RouteViews]] and convert them into plain text for further analysis.
 +
 +===== Building a Looking Glass =====
 +
 +These instructions cover how to put together the [[https://github.com/Cougar/lg|Cougar Looking Glass]] code. Why choose this one? Well, it's there, it seems to work fine, and installs nicely on Ubuntu 22.04. Even though the code itself hasn't been touched since 2009!
 +
 +First off, grab the few files you need off the repo - you could clone it, but there are only a few files, and they haven't been changed in a while. Put them all in **/usr/local/src/LG**. All the directions below assume that the working directory is here.
 +
 +Assuming a basic install of Ubuntu 22.04, we need to add a few packages, including a compiler.
 +<code>
 +sudo apt install apache2 make gcc libexpat1-dev
 +</code>
 +
 +Next we need to install a few extra perl modules to support the looking glass. Assuming we don't have CPAN already set up, we need to do:
 +<code>
 +cpan App::cpanminus
 +</code>
 +This installs the basic CPAN environment to make adding in modules simpler. Once the CPAN environment is in place, you then need to run:
 +<code>
 +cpan install CPAN::DistnameInfo
 +cpan install XML::Parser
 +cpan install Net::Telnet
 +</code>
 +which will install the XML parser and telnet support for Perl. This should all complete successfully - you'll see these two packages and all the supporting modules being automatically installed.
 +
 +With the Apache2 webserver installed in its default configuration, we now need to create two folders for the Looking Glass components.
 +<code>
 +sudo mkdir -p /var/www/looking-glass/lg
 +</code>
 +And then copy the required components into place.
 +<code>
 +sudo cp -p favicon.ico index.html lg.cgi lg.conf /var/www/looking-glass/lg/
 +</code>
 +
 +Next we need to create the Apache site configuration:
 +<code>
 +cd /etc/apache2/sites-available
 +</code>
 +and create a new config file with the URL of your site, for example, **lg.my.site.conf** with the following contents:
 +<code>
 +<VirtualHost *:80>
 +  ServerName  lg.my.site
 +
 +  DocumentRoot /var/www/looking-glass/lg/
 +
 +  Alias /lg/favicon.ico /var/www/looking-glass/lg/favicon.ico
 +  Alias /libraries /var/www/looking-glass/libraries
 +  ScriptAlias /lg /var/www/looking-glass/lg/lg.cgi
 +
 +  <Directory "/var/www/looking-glass/lg">
 +    AllowOverride None
 +    Options +ExecCGI
 +    AddHandler cgi-script .cgi .pl
 +    Require all granted
 +  </Directory>
 +
 +</VirtualHost>
 +</code>
 +
 +We need to turn on support for CGI:
 +<code>
 +sudo a2enmod cgid
 +</code>
 +
 +Then we need to enable the site:
 +<code>
 +sudo a2ensite lg.my.site
 +</code>
 +and then restart Apache2 for it to go live:
 +<code>
 +sudo systemctl restart apache2
 +</code>
 +
 +
 +
  
 [[start| Back to Home page]] [[start| Back to Home page]]
  
hints/misc.1688813610.txt.gz · Last modified: 2023/07/08 20:53 by philip