1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
<?php
// People to contact
$config['contact']['name'] = 'Example Support';
$config['contact']['mail'] = 'support@example.com';
// Frontpage configuration
// CSS to use
$config['frontpage']['css'] = 'css/style.css';
// Title of the page
$config['frontpage']['title'] = 'Looking Glass';
$config['frontpage']['show_title'] = true;
// Logo to display
$config['frontpage']['image'] = 'logo.png';
// Show visitor IP address
$config['frontpage']['show_visitor_ip'] = true;
// Disclaimer to inform people using the looking glass
$config['frontpage']['disclaimer'] = 'This is a disclaimer!';
// Frontpage order you can use: routers, commands, parameters, buttons
$config['frontpage']['order'] = array('routers', 'commands', 'parameters', 'buttons');
// Logs file when commands will be written
$config['misc']['logs'] = '/var/log/looking-glass.log';
// Allow private ASN
$config['misc']['allow_private_asn'] = false;
// Things to remove from the output (PHP compatible regex)
$config['filters'][] = '/(client1|client2)/';
$config['filters'][] = '/^NotToShow/';
// Documentation for commands (must be HTML)
// Documentation for the 'show route' query
$config['doc']['bgp']['query'] = 'Show the best routes to a given destination.';
$config['doc']['bgp']['parameter'] = 'The parameter must be a valid destination. Destination means an IPv4/IPv6 address or a subnet. Masks are also accepted as part of a valid IPv4/IPv6 address.<br />Please note that some routers always need a mask to be given when looking for an IPv6 address.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>172.16.0.0/12</li><li>2001:db8:1337::42</li><li>2001:db8::/32</li>';
// Documentation for the 'as-path-regex' query
$config['doc']['as-path-regex']['query'] = 'Show the routes matching the given AS path regular expression.';
$config['doc']['as-path-regex']['parameter'] = 'The parameter must be a valid AS path regular expression.<br />Please note that these expression can change depending on the router and its software.<br /><br />Here are some examples:<ul><li><strong>Juniper</strong> - ^AS1 AS2 .*$</li><li><strong>Cisco</strong> - ^AS1_</li><li><strong>BIRD</strong> - AS1 AS2 AS3 … ASZ</li></ul><br />You may find some help with the following link:<br /><ul><li><a href="http://www.juniper.net/techpubs/en_US/junos13.3/topics/reference/command-summary/show-route-aspath-regex.html" title="Juniper Documentation">Juniper Documentation</a></li><li><a href="http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#asregexp" title="Cisco Documentation">Cisco Documentation</a></li><li><a href="http://bird.network.cz/?get_doc&f=bird-5.html" title="BIRD Documentation">BIRD Documentation</a> (search for bgpmask)</li></ul>';
// Documentation for the 'as' query
$config['doc']['as']['query'] = 'Show the routes received from a given AS number.';
$config['doc']['as']['parameter'] = 'The parameter must be a valid 16-bit or 32-bit autonomous system number.<br />Be careful, 32-bit ASN are not handled by old routers or old router softwares.<br />Unless specified, private ASN will be considered as invalid.<br /><br />Example of valid argument:<br /><ul><li>15169</li><li>29467</li></ul>';
// Documentation for the 'ping' query
$config['doc']['ping']['query'] = 'Send 10 pings to the given destination.';
$config['doc']['ping']['parameter'] = 'The parameter must be an IPv4/IPv6 address (without mask) or a fully qualified domain name.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>2001:db8:1337::42</li><li>example.com</li></ul>';
// Documentation for the 'traceroute' query
$config['doc']['traceroute']['query'] = 'Display the path to a given destination.';
$config['doc']['traceroute']['parameter'] = 'The parameter must be an IPv4/IPv6 address (without mask) or a fully qualified domain name.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>2001:db8:1337::42</li><li>example.com</li></ul>';
// Routers definitions
// Authentication based on SSH or Telnet with password
// The hostname or the IP address
$config['routers']['router1']['host'] = 'r1.example.net';
// The user to use to connect to the router
$config['routers']['router1']['user'] = 'readonlyuser';
// The password of the given user
$config['routers']['router1']['pass'] = 'readonlypassword';
// The authentication mecanism to use (can be ssh-password or telnet)
$config['routers']['router1']['auth'] = 'ssh-password';
// The router type (can be cisco, ios, juniper or junos)
$config['routers']['router1']['type'] = 'juniper';
// The router description to be displayed in the router list
$config['routers']['router1']['desc'] = 'Example\'s Router 1';
// Authentication based on SSH with key
// The hostname or the IP address
$config['routers']['router2']['host'] = 'r2.example.net';
// The user to use to connect to the router
$config['routers']['router2']['user'] = 'readonlyuser';
// The public key of the given user
$config['routers']['router2']['private_key'] = '/home/user/.ssh/key';
// The passphrase of the key (optional if the key has no passphrase)
$config['routers']['router2']['pass'] = 'mypassphrase';
// The authentication mecanism to use (ssh-key for SSH based on keys)
$config['routers']['router2']['auth'] = 'ssh-key';
// The router type (can be cisco, ios, juniper or junos)
$config['routers']['router2']['type'] = 'juniper';
// The router description to be displayed in the router list
$config['routers']['router2']['desc'] = 'Example\'s Router 2';
// Router based on BIRD
// The hostname or the IP address
$config['routers']['router3']['host'] = 'r3.example.net';
// The user to use to connect to the router
$config['routers']['router3']['user'] = 'birduser';
// The password of the given user
$config['routers']['router3']['pass'] = 'birduserpassword';
// The authentication mecanism to use (can be ssh-password or ssh-key)
$config['routers']['router3']['auth'] = 'ssh-password';
// The router type (can only be bird)
$config['routers']['router3']['type'] = 'bird';
// The router description to be displayed in the router list
$config['routers']['router3']['desc'] = 'Example\'s Router 3';
// End of config.php
|