]>
Commit | Line | Data |
---|---|---|
e37ad4a6 | 1 | ======= |
2 | ifquery | |
3 | ======= | |
4 | ||
5 | ------------------------------------- | |
6 | query network interface configuration | |
7 | ------------------------------------- | |
8 | ||
9 | :Author: roopa@cumulusnetworks.com | |
10 | :Date: 2014-02-05 | |
11 | :Copyright: Copyright 2014 Cumulus Networks, Inc. All rights reserved. | |
12 | :Version: 0.1 | |
13 | :Manual section: 8 | |
14 | ||
d40e96ee | 15 | NAME |
16 | ==== | |
17 | **ifquery** - query interface configuration | |
18 | ||
e37ad4a6 | 19 | SYNOPSIS |
20 | ======== | |
d40e96ee | 21 | |
22 | **ifquery [-v] [--allow CLASS] [--with-depends] -a|IFACE...** | |
23 | ||
24 | **ifquery [-v] [-r|--running] [--allow CLASS] [--with-depends] -a|IFACE...** | |
25 | ||
26 | **ifquery [-v] [-c|--check] [--allow CLASS] [--with-depends] -a|IFACE...** | |
27 | ||
28 | **ifquery [-v] [-p|--print-dependency {list,dot}] [--allow CLASS] [--with-depends] -a|IFACE...** | |
29 | ||
30 | **ifquery [-v] -s|--syntax-help** | |
e37ad4a6 | 31 | |
32 | DESCRIPTION | |
33 | =========== | |
d40e96ee | 34 | **ifquery** can be used to parse interface configuration file, query |
e37ad4a6 | 35 | running state or check running state of the interface with configuration |
d40e96ee | 36 | in **/etc/network/interfaces** file. |
e37ad4a6 | 37 | |
d40e96ee | 38 | **ifquery** always works on the current **interfaces(5)** file |
39 | **/etc/network/interfaces**. | |
e37ad4a6 | 40 | |
41 | OPTIONS | |
42 | ======= | |
43 | positional arguments: | |
d40e96ee | 44 | |
45 | **IFACE** interface list separated by spaces. **IFACE** list and **'-a'** argument are mutually exclusive. | |
e37ad4a6 | 46 | |
47 | optional arguments: | |
d40e96ee | 48 | |
e37ad4a6 | 49 | -h, --help show this help message and exit |
50 | ||
51 | -a, --all process all interfaces marked "auto" | |
52 | ||
53 | -v, --verbose verbose | |
54 | ||
55 | -d, --debug output debug info | |
56 | ||
d40e96ee | 57 | -l, --allow CLASS ignore non-"allow-CLASS" interfaces |
e37ad4a6 | 58 | |
d40e96ee | 59 | -w, --with-depends run with all dependent interfaces. This option |
e37ad4a6 | 60 | is redundant when -a is specified. When '-a' is |
61 | specified, interfaces are always executed in | |
62 | dependency order. | |
63 | ||
64 | -X EXCLUDEPATS, --exclude EXCLUDEPATS | |
65 | Exclude interfaces from the list of interfaces to | |
66 | operate on. Can be specified multiple times | |
67 | ||
68 | -r, --running print raw interfaces file entries | |
69 | ||
70 | -c, --check check interface file contents against running state | |
71 | of an interface. Returns exit code 0 on success and | |
72 | 1 on error | |
73 | ||
d40e96ee | 74 | -p, --print-dependency {list,dot} print iface dependency in list or dot format |
e37ad4a6 | 75 | |
d40e96ee | 76 | -s, --syntax-help print supported interface config syntax. Scans all |
e37ad4a6 | 77 | addon modules and dumps supported syntax from them |
78 | if provided by the module. | |
79 | ||
80 | EXAMPLES | |
81 | ======== | |
82 | # dump all or some interfaces config file entries | |
83 | # (pretty prints user provided entries) | |
d40e96ee | 84 | |
85 | **ifquery -a** | |
86 | ||
87 | **ifquery br0** | |
e37ad4a6 | 88 | |
89 | # Same as above but dump with dependencies | |
d40e96ee | 90 | |
91 | **ifquery br0 --with-depends** | |
e37ad4a6 | 92 | |
93 | # Check running state with the config in /etc/network/interfaces | |
d40e96ee | 94 | |
95 | **ifquery --check br0** | |
96 | ||
97 | **ifquery --check --with-depends br0** | |
98 | ||
99 | **ifquery --check -a** | |
e37ad4a6 | 100 | |
101 | # dump running state of all interfaces in /etc/network/interfaces format | |
d40e96ee | 102 | |
103 | **ifquery --running br0** | |
104 | ||
105 | **ifquery --running --with-depends br0** | |
106 | ||
107 | **ifquery --running -a** | |
e37ad4a6 | 108 | |
83c1f241 | 109 | # print dependency info in list format |
d40e96ee | 110 | |
111 | **ifquery --print-dependency=list -a** | |
112 | ||
113 | **ifquery --print-dependency=list br2000** | |
83c1f241 | 114 | |
115 | # print dependency info in dot format | |
d40e96ee | 116 | |
117 | **ifquery --print-dependency=dot -a** | |
118 | ||
119 | **ifquery --print-dependency=dot br2000** | |
83c1f241 | 120 | |
121 | # Create an image (png) from the dot format. | |
d40e96ee | 122 | |
123 | **ifquery --print-dependency=dot -a > interfaces.dot** | |
124 | ||
125 | **dot -Tpng interfaces.dot > interfaces.png** | |
83c1f241 | 126 | |
127 | ||
e37ad4a6 | 128 | SEE ALSO |
129 | ======== | |
d40e96ee | 130 | ifup(8), |
131 | ifdown(8), | |
132 | ifreload(8), | |
133 | interfaces(5), | |
134 | ifupdownaddons-interfaces(5) |