5 -------------------------------------
6 query network interface configuration
7 -------------------------------------
9 :Author: roopa@cumulusnetworks.com
11 :Copyright: Copyright 2014 Cumulus Networks, Inc. All rights reserved.
17 **ifquery** - query interface configuration
22 **ifquery [-v] [--allow CLASS] [--with-depends] -a|IFACE...**
24 **ifquery [-v] [-r|--running] [--allow CLASS] [--with-depends] -a|IFACE...**
26 **ifquery [-v] [-c|--check] [--allow CLASS] [--with-depends] -a|IFACE...**
28 **ifquery [-v] [-p|--print-dependency {list,dot}] [--allow CLASS] [--with-depends] -a|IFACE...**
30 **ifquery [-v] -s|--syntax-help**
34 **ifquery** can be used to parse interface configuration file, query
35 running state or check running state of the interface with configuration
36 in **/etc/network/interfaces** file.
38 **ifquery** always works on the current **interfaces(5)** file
39 **/etc/network/interfaces**.
45 **IFACE** interface list separated by spaces. **IFACE** list and **'-a'** argument are mutually exclusive.
49 -h, --help show this help message and exit
51 -a, --all process all interfaces marked "auto"
55 -d, --debug output debug info
57 -l, --allow CLASS ignore non-"allow-CLASS" interfaces
59 -w, --with-depends run with all dependent interfaces. This option
60 is redundant when -a is specified. When '-a' is
61 specified, interfaces are always executed in
64 -X EXCLUDEPATS, --exclude EXCLUDEPATS
65 Exclude interfaces from the list of interfaces to
66 operate on. Can be specified multiple times
68 -r, --running print raw interfaces file entries
70 -c, --check check interface file contents against running state
71 of an interface. Returns exit code 0 on success and
74 -p, --print-dependency {list,dot} print iface dependency in list or dot format
76 -s, --syntax-help print supported interface config syntax. Scans all
77 addon modules and dumps supported syntax from them
78 if provided by the module.
82 # dump all or some interfaces config file entries
83 # (pretty prints user provided entries)
89 # Same as above but dump with dependencies
91 **ifquery br0 --with-depends**
93 # Check running state with the config in /etc/network/interfaces
95 **ifquery --check br0**
97 **ifquery --check --with-depends br0**
99 **ifquery --check -a**
101 # dump running state of all interfaces in /etc/network/interfaces format
103 **ifquery --running br0**
105 **ifquery --running --with-depends br0**
107 **ifquery --running -a**
109 # print dependency info in list format
111 **ifquery --print-dependency=list -a**
113 **ifquery --print-dependency=list br2000**
115 # print dependency info in dot format
117 **ifquery --print-dependency=dot -a**
119 **ifquery --print-dependency=dot br2000**
121 # Create an image (png) from the dot format
123 **ifquery --print-dependency=dot -a > interfaces.dot**
125 **dot -Tpng interfaces.dot > interfaces.png**
127 (The above command only works on a system with dot installed)
136 ifupdown-addons-interfaces(5)