-
Notifications
You must be signed in to change notification settings - Fork 24
/
plotnetcfg.8
121 lines (108 loc) · 2.97 KB
/
plotnetcfg.8
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.TH plotnetcfg 8 "9 April 2015"
.SH NAME
plotnetcfg \- plot diagram of network configuration
.SH SYNOPSIS
.B plotnetcfg
.RB [ options ]
.SH DESCRIPTION
.B plotnetcfg
is a tool that scans networking configuration on the machine and outputs
a diagram of the configuration hierarchy.
By default, the output is in the
.B dot
language. The output can be converted by the
.BR dot (1)
tool from
.BR graphviz (7)
package to various formats such as PDF, PostScript or SVG.
.B plotnetcfg
is able to scan different network name spaces and figure out relations that
span name spaces. It supports all kinds of network interfaces and
understands specifics of VLANs, bridges, veth pairs and Open vSwitch.
The tool has to be run under root or with both CAP_SYS_ADMIN and
CAP_NET_ADMIN capabilities. See
.BR capabilities (7)
for details.
.B plotnetcfg
is lightweight with as few library dependencies as possible. Currently, the
only dependencies are
.B libc
and
.BR libjansson .
Optionally, it can be statically linked against the latter which allows the
.B plotnetcfg
binary to be copied to a target machine and run there (provided it has the
same or newer version of
.B glibc
as
.B plotnetcfg
was compiled against).
See EXAMPLES for typical
.B plotnetcfg
usage.
.SH OPTIONS
.TP
\fB-f\fr, \fB--format\fR=\fIFORMAT\fR
Set output format. When not specified,
.B dot
is used. Can be specified multiple times with
.B --output.
Order in which multiple outputs are processed is undefined. All the outputs
contain the same snapshot of network configuration state.
.TP
\fB-o\fr, \fB--output\fR=\fIFILE\fR
Send output to
.I FILE
in the last format preceding this option. Can be specified multiple times. When
no file is given, send output to standard output. Every \fB--output\fR starts
a new output file, for which output specific options apply.
.TP
\fB-C\fr, \fB--config-only\fR
Output specific. Prints just configuration of the network topology, no state
information.
.TP
\fB-F\fr, \fB--list-formats\fR
Print available output formats.
.TP
\fB-D\fr, \fB--ovs-db\fR=\fIPATH\fR
Path to the socket used to communicate with Open vSwitch database server.
Only UNIX sockets are supported. The default is
.BR /var/run/openvswitch/db.sock .
.TP
\fB-h\fR, \fB--help\fR
Print short help and exit.
.TP
\fB--version\fR
Print program version and exit.
.SH EXAMPLES
Display network configuration of the local machine:
.RS
.B plotnetcfg | dot -Tpdf | okular -
.RE
Save network configuration to a file for later analysis:
.RS
.B plotnetcfg >
.I file
.RE
More complex output setting:
.RS
.BI "plotnetcfg -f json -o " "json.js" " -o " "json-config.js" " --config-only -f dot -o " "dot1.gv"
.B -o - | dot -Tpdf >
.I network.pdf
.RE
Create PDF with network configuration of a remote machine:
.RS
.B scp /usr/sbin/plotnetcfg
.BI root@ target :
.br
.B ssh
.BI root@ target
.B ./plotnetcfg | dot -Tpdf >
.I file.pdf
.SH SEE ALSO
.BR dot (1),
.BR graphviz (7),
.BR plotnetcfg-json (5)
.SH AUTHOR
.B plotnetcfg
was written and is maintained by Jiri Benc <[email protected]>.