LG(8)

NAME
lg - Looking Glass for Zebra and Cisco Routers

SYNOPSIS
lg
env QUERY_STRING='options' lg

DESCRIPTION
Lg is a CGI script for viewing the results of simple queries executed on remote Zebra or Cisco routers. The queries and routers can be listed in a configuration file.

Available routers are listed in the %ROUTERS table. The keys are used for display, so actual router names (and possible passwords) need not be exposed. The router names or IP addresses together with optional authentication and port information are stored as values. The syntax for a router entry is

    [[user:]pass@]router[:port]

The fields are

user
    The username for logging in to a router that has been configured with multiple users. A password must also be provided.

pass
    The password for logging in to a router (with or without a username).

router
    The router name or IP address.

port
    The port to connect to. The default is 23 (telnet), for use with Cisco routers. Enter 2605 for Zebra routers (bgpd).

The default router is listed in the $DEFROUTER variable.

Available queries are listed in the %QUERIES table. The keys are used for display and the values are the commands sent to the router. Fields from the query form can be referenced using escapes in the command string. The escapes are

%a  The address text, checked as an IP address of the selected protocol.

%p  The selected protocol, retrieved from %PROTOCOLS.

%q  The query field, checked against keys in %QUERIES.

%r  The address text, checked as an AS regular expression.

The expanded query is displayed on the results page. The default query is listed in the $DEFQUERY variable.

Available protocols are listed in the %PROTOCOLS table. There should normally be no need to alter this table. The default protocol is listed in the $DEFPROTOCOL variable.

FILES
/usr/pkg/etc/httpd/lg.conf

EXAMPLES
#
# Set these appropriately:
#
$ORGNAME = 'Global Wire';
$ORGADDR = 'noc@gw.net';
%ROUTERS = (
    'Lappeenranta' => 'zebra1.gw.net:2605',
    'Manhattan 1'  => 'user:pass@cisco1.gw.net',
    'Manhattan 2'  => 'pass@cisco2.gw.net',
    'Stamford'     => 'pass@zebra2.gw.net:2605',
    'Toledo'       => 'cisco3.gw.net',
);
$DEFROUTER = 'Lappeenranta';
%QUERIES = (
    'bgp'          => 'show %p %q %a',
    'bgp regexp'   => 'show %p %q %r',
    'bgp summary'  => 'show %p %q',
    'who'          => '%q',
);
$DEFQUERY = 'bgp summary';
# Always return true:
1;

SEE ALSO
bgpd(8)

DIAGNOSTICS
If the query parameters do not match the configured options in the script, the query will not be sent to the router, and the script will return messages suggesting redoing the query from the form.

If the query is allowed by the current configuration, it will be displayed on the result page together with the response from the router.

Any problems in connecting to the router will be reported on the result page as well.

AUTHOR
Kimmo Suominen <kim@tac.nyc.ny.us>
Copyright (c) 2001 Global Wire Oy
http://www.gw.com/sw/stripes/

SECURITY CONSIDERATIONS
Be careful with queries like who, which can reveal sensitive information such as usernames.

Any queries that would require connecting to the router in enable mode are probably not suitable for exposing via a Looking Glass.

To avoid storing usernames and/or passwords in files, consider configuring the vty interface with no login together with a very restrictive access-class.