ospfview.cgi - publish the OSPF LSDB graph on a web server
http://127.0.0.1/cgi-bin/ospfview.cgi?ipv6=0&external=2
The cgi script ospfview.cgi allows to publish the link-state database of an OSPF router on a web server running there.
The router must run the OpenBSD ospfd or ospf6d routing daemon. To make this cgi script work, the web server must have access to the /var/run/ospfd.sock and /var/run/ospf6d.sock UNIX domain sockets. This can be achieved by file permissions or doas permissions for ospfctl and ospf6ctl. The web server must not run chrooted.
The following parameters control the format and content of the generated graph. The content parameters have numerical values, 0 disables the feature and is the default.
0
Specify the file format of the generated image. The value is passed to the dot -T option. Available choices are dot, fig, gif, pdf, png, ps, ps2, svg, svgz. Default is svg.
dot
fig
gif
pdf
png
ps
ps2
svg
svgz
The value 1 turns on IPv6, 0 uses IPv4.
1
The value 1 displays the legend instead of the current OSPF LSDB.
The value 1 adds the network summary-LSAs to the graph. With 2 these LSAs get aggregated. Inter-area-prefix-LSAs have not been implemented for IPv6.
2
The value 1 adds the boundary router summary-LSAs to the graph. With 2 these LSAs get aggregated. Inter-area-router-LSAs have not been implemented for IPv6.
The value 1 adds the AS-external-LSAs to the graph. With 2 these LSAs get aggregated.
The value 1 adds the link-LSAs to the graph. These LSAs exist only for IPv6.
The value 1 adds the network and router intra-area-prefix-LSAs to the graph. These LSAs exist only for IPv6.
The value 1 clusters LSAs containing the same network into a common rectangle. This feature has not been implemented for IPv6.
The value 1 prints the area and all warnings corresponding to the color of the nodes and edges. With 2 only the area or the most severe warning is printed. Note that with the svg format, the messages are always available as tool tip.
The program dies if an error occurs. Check your web server's error log for messages.
OSPF::LSDB::View6, OSPF::LSDB::View, OSPF::LSDB
dot(1)
Alexander Bluhm
It is probably not the best idea to publish one's routing topology on a public web server. This cgi script is intended to debug OSPF in a controlled environment.
The perl taint mode is used to make this cgi script secure.
To install OSPF::LSDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OSPF::LSDB
CPAN shell
perl -MCPAN -e shell install OSPF::LSDB
For more information on module installation, please visit the detailed CPAN module installation guide.