5 -------------------------------------
6 query network interface configuration
7 -------------------------------------
9 :Author: Roopa Prabhu <roopa@cumulusnetworks.com>
11 :Copyright: Copyright 2014 Cumulus Networks, Inc. All rights reserved.
18 **ifquery [-v] [--allow CLASS] [--with-depends] -a|IFACE...**
20 **ifquery [-v] [-r|--running] [--allow CLASS] [--with-depends] -a|IFACE...**
22 **ifquery [-v] [-c|--check] [--allow CLASS] [--with-depends] -a|IFACE...**
24 **ifquery [-v] [-p|--print-dependency {list,dot}] [--allow CLASS] [--with-depends] -a|IFACE...**
26 **ifquery [-v] -s|--syntax-help**
30 **ifquery** can be used to parse interface configuration file, query
31 running state or check running state of the interface with configuration
32 in **/etc/network/interfaces** file.
34 **ifquery** always works on the current **interfaces(5)** file
35 **/etc/network/interfaces** unless an alternate interfaces file is
36 provided with the **-i** option.
42 **IFACE** interface list separated by spaces. **IFACE** list and **'-a'** argument are mutually exclusive.
46 -h, --help show this help message and exit
48 -a, --all process all interfaces marked "auto"
52 -d, --debug output debug info
54 -l, --allow CLASS ignore non-"allow-CLASS" interfaces
56 -w, --with-depends run with all dependent interfaces. This option
57 is redundant when -a is specified. When '-a' is
58 specified, interfaces are always executed in
61 -X EXCLUDEPATS, --exclude EXCLUDEPATS
62 Exclude interfaces from the list of interfaces to
63 operate on. Can be specified multiple times
65 -i INTERFACESFILE, --interfaces INTERFACESFILE
66 Use interfaces file instead of default
67 /etc/network/interfaces
69 -r, --running print raw interfaces file entries
71 -c, --check check interface file contents against running state
72 of an interface. Returns exit code 0 on success and
75 -x, --raw print raw config file entries
78 -o {native,json}, --format {native,json}
79 interface display format
81 -p, --print-dependency {list,dot}
82 print iface dependency in list or dot format
84 -s, --syntax-help print supported interface config syntax. Scans all
85 addon modules and dumps supported syntax from them
86 if provided by the module.
90 # dump all or some interfaces config file entries
91 # (pretty prints user provided entries)
97 # Same as above but dump with dependencies
99 **ifquery br0 --with-depends**
101 # Check running state with the config in /etc/network/interfaces
103 **ifquery --check br0**
105 **ifquery --check --with-depends br0**
107 **ifquery --check -a**
109 # dump running state of all interfaces in /etc/network/interfaces format
111 **ifquery --running br0**
113 **ifquery --running --with-depends br0**
115 **ifquery --running -a**
117 # print dependency info in list format
119 **ifquery --print-dependency=list -a**
121 **ifquery --print-dependency=list br2000**
123 # print dependency info in dot format
125 **ifquery --print-dependency=dot -a**
127 **ifquery --print-dependency=dot br2000**
129 # Create an image (png) from the dot format
131 **ifquery --print-dependency=dot -a > interfaces.dot**
133 **dot -Tpng interfaces.dot > interfaces.png**
135 (The above command only works on a system with dot installed)
139 **ifquery --check** is currently experimental
141 **ifquery --check** cannot validate usercommands given under pre-up, post-up etc
142 There is currently no support to check/validate ethtool iface attributes
150 ifupdown-addons-interfaces(5)