• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D22-Jun-201435 85

CHANGELOGH A D22-Jun-20143.2 KiB10982

COPYINGH A D22-Jun-201417.6 KiB340281

READMEH A D22-Jun-20145.9 KiB175106

lg.cgiH A D03-May-202239.4 KiB1,2271,100

lg.confH A D22-Jun-201414.6 KiB413372

makeaslist.plH A D03-May-20224.5 KiB223179

makedb.plH A D03-May-20223.6 KiB178152

README

1
2
3                                   SUMMARY
4
5
6LG is a Looking Glass written in Perl as a CGI script. It can execute almost
7all BGP-related commands and do ping and traceroute in routers or relay these
8queries to other looking glasses. It supports both IPv4 and IPv6 commands,
9and is tested with Cisco, Zebra and Juniper. It can connect to router using
10either SSH, telnet or rsh protocol.
11
12LG is released under GPL licence. Look at COPYING file.
13
14
15
16                                   SECURITY
17
18
19It is suggested to move configuration file lg.conf outside of webserver
20direcory. One suitable place for that could be /usr/local/etc. Just move
21configuration to this directory and add full path to the $configfile
22variable in the beginning of lg.cgi.
23
24The default location of SSH configuration directory .ssh is initialized to
25the same directory where CGI is running: /usr/local/httpd/htdocs/lg.
26It is suggested to change $HOME enironment variable in the beginning
27of lg.cgi script to some other directory accessible by webserver (wwwrun
28for example) which is outside of default webserver root (in opensuse
29/var/lib/wwwrun can be used). It is srongly suggested to change this in
30case you are going to use key based authentication.
31
32
33                                   INSTALL
34
35
36This example assumes that you use Apache webserver and LG will be installed
37to /usr/local/httpd/htdocs/lg directory.
38
39
401. Create directory where you want to keep LG files
41
42> mkdir /usr/local/httpd/htdocs/lg
43
442. Copy lg.cgi, lg.conf and favicon.ico to this directory, make CGI executable
45
46> cp lg.cgi lg.conf favicon.ico /usr/local/httpd/htdocs/lg
47> chmod 644 /usr/local/httpd/htdocs/lg/*
48> chmod 755 /usr/local/httpd/htdocs/lg/lg.cgi
49
503. Add these lines to your webserver config (In SuSE it is located at
51/etc/httpd/httpd.conf or /etc/httpd/suse_include.conf). The order of these
52lines is VERY IMPORTANT
53
54Alias /lg/favicon.ico /usr/local/httpd/htdocs/lg/favicon.ico
55ScriptAlias /lg /usr/local/httpd/htdocs/lg/lg.cgi
56
574. Restart webserver
58
59> killall -1 httpd
60
615. DONE!
62
636. Now you have time to set up AS num and community description files
64
65Download as.txt, as-apnic.txt, as-arin.txt, as-ripe.txt, as-jpnic.txt,
66as-lacnic.txt and communities.txt form http://www.version6.net/lg/db/ .
67Put all files to LG directory (/usr/local/httpd/htdocs/lg).
68
69> wget http://www.version6.net/lg/db/as.txt
70> wget http://www.version6.net/lg/db/as-apnic.txt
71> wget http://www.version6.net/lg/db/as-arin.txt
72> wget http://www.version6.net/lg/db/as-ripe.txt
73> wget http://www.version6.net/lg/db/as-jpnic.txt
74> wget http://www.version6.net/lg/db/as-lacnic.txt
75> wget http://www.version6.net/lg/db/communities.txt
76
777. If you prefer use Berkeley DB (you should! :-) ), then set up a database
78file. PS! you can't use community descriptions without using Berkeley DB.
79
807.1 Create db file yourself by running makedb.pl in LG directory:
81
82> ./makedb.pl
83
84or
85
867.2 Download as.db from http://www.version6.net/lg/db/
87
88> wget http://www.version6.net/lg/db/as.db
89
908. Make sure that all these files are readable for webrserver
91
92> chmod a+r /usr/local/httpd/htdocs/lg/*.txt
93> chmod a+r /usr/local/httpd/htdocs/lg/as.db
94
95
96
97
98                            ADVANCED CONFIURATION
99
100
101You can generate as-*.txt files yourself. Just run Perl script makeaslist.pl
102and it creates these three files in your current directory. It is recommended
103to update these files sometimes to get fresh information about new AS numbers.
104Don't forget to run makedb.pl after that as well.
105
106You can also edit as.txt file. These three autogenerated files are included
107at the beginning of as.txt file. All lines below just overwrites previous
108ones. This means that you can put any better names for AS numbers to this file
109and will see it instead of these autogenerated names (which are quite hard to
110understand some times).
111
112Also you have to edit communities.txt file by hand. Don't forget to run
113makedb.pl after that again.
114
115A little bit about lg.conf file. In this example all logins are replaced with
116"login" and passwords with "password". These lines are also commented out, so
117you can use this configuration file even without any modification.
118
119You can set ASList as as.txt file or as.db database. With my 900 MHz Celeron
120it takes about 4 sec to load as.txt (and all included files) while using DB
121takes only 0.2 sec ;-) Use DB if possible!
122
123As long as the configuration file is quite simple, I don't give here any help
124how to configure LG. Just look at lg.conf, all possible ways how to configure
125it, are shown in this file already ;-)
126
127Default logfile is /var/log/lg.log, be sure that your webserver can write
128it or use any other file (or don't use at all).
129
130
131
132                                    NOTES
133
134
135Don't try to use LG sites with newer DIGEX code as external LG sites. These
136will check Referer and therefore deny all outside links.
137
138There are also some LG sites which support only POST method and are also
139unusable. LG can forward browsers to any other address but can't send POST
140data with it. It is possible to act as proxy for these sites but this is not
141implemented yet and I'm not sure it is necessary at all. At least at the
142current moment ;-)
143
144When using Zebra you can specify one port for bgpd and another for zebra
145itself (ping and traceroute commands). All these syntaxes have the same
146meaning:
147
148- telnet://pass@host		default ports (2601 and 2605)
149- telnet://pass@host:2601,2605	user defined ports
150- telnet://pass@host:2601,	user defined zebra port and default bgpd port
151- telnet://pass@host:,2605	default zebra port and user defined bgpd port
152
153but these don't work as you expect (the same port for bgpd and zebra):
154
155- telnet://pass@host:2601
156- telnet://pass@host:2605
157
158"logical-system" works only with OSType="JunOS" and when using SSH.
159
160
161                                  DOWNLOAD
162
163
164You can get the latest source from http://www.version6.net/
165
166All new releases will be announced in Freshmeat (subscribe!)
167http://freshmeat.net/projects/lg/
168
169
170
171Enjoy!
172
173---
174Cougar <cougar@random.ee>
175