Skip to content

Looking Glass

dhellstern edited this page Apr 17, 2022 · 6 revisions

Introduction

Although Hyperglass has a pretty interface, I was never able to get it working, it wouldn't even send requests to the server to run commands. A simpler to set up alternative is the looking-glass project, which is based on PHP and is simpler to configure while still supporting the necessary VyOS platform.

Installation

looking-glass is fairly simple to install. First, install the apache2, php7.4, php7.4-xml, and optionally php7.4-sqlite3 packages. Then, git clone or download the files from the repository and move them to /var/www/html/. Navigate to this directory and make a copy of config.php.example without the example extension. Edit this configuration as necessary following the documentation at https://looking-glass.readthedocs.io/en/latest/configuration/.

Configuration

There are a number of options which should be changed in the configuration file. The below sets the title and a front-cover image, which should be stored in /etc/lg/ and readable by the group www-data.

$config['frontpage']['title'] = 'AS4242421878 Looking Glass';
$config['frontpage']['image'] = '/etc/lg/champlain.png';
$config['frontpage']['disclaimer'] = null;

The routers stanzas are the most important, since these specify connection settings for the looking glass. The below configuration sets up passwordless SSH to the router using a key which must be readable by the www-data user or group in /etc/lg/. The type setting tells looking-glass which commands to run to discover the necessary information, and source-interface-id is used as the source IP for ping or traceroute commands.

$config['routers']['fw-1']['host'] = '172.23.119.65';
$config['routers']['fw-1']['user'] = 'lg';
$config['routers']['fw-1']['private_key'] = '/etc/lg/id_ed25519';
$config['routers']['fw-1']['auth'] = 'ssh-key';
$config['routers']['fw-1']['type'] = 'frr'; // see the VyOS section below for more
$config['routers']['fw-1']['source-interface-id'] = '172.23.119.65';
$config['routers']['fw-1']['desc'] = 'DN42 Router';

Lastly, the following options must be added to support the private ASNs and RFC1918/ULA addresses used by DN42.

$config['misc']['allow_private_asn'] = true;
$config['misc']['allow_private_ip'] = true;

The optional antispam feature requires a SQLite database, and can be disabled with $config['antispam']['enabled'] = false;. Make sure the apache2 service is started and enabled and the looking glass should be available immediately.

VyOS

The latest version of looking-glass equates VyOS to Vyatta and therefore runs Quagga commands on the router. However, since VyOS 1.2, the project has used Free Range Routing, which is itself a fork of Quagga with slightly different syntax. For this reason, on VyOS it's better to use frr as the router type instead of vyos, which remains fully compatible.

Clone this wiki locally