.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "IFQUERY" 8 "2014-02-05" "0.1" "" .SH NAME ifquery \- query network interface configuration .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 \fBifquery [\-v] [\-\-allow CLASS] [\-\-with\-depends] \-a|IFACE...\fP .sp \fBifquery [\-v] [\-r|\-\-running] [\-\-allow CLASS] [\-\-with\-depends] \-a|IFACE...\fP .sp \fBifquery [\-v] [\-c|\-\-check] [\-\-allow CLASS] [\-\-with\-depends] \-a|IFACE...\fP .sp \fBifquery [\-v] [\-p|\-\-print\-dependency {list,dot}] [\-\-allow CLASS] [\-\-with\-depends] \-a|IFACE...\fP .sp \fBifquery [\-v] \-s|\-\-syntax\-help\fP .UNINDENT .UNINDENT .SH DESCRIPTION .INDENT 0.0 .INDENT 3.5 \fBifquery\fP can be used to parse interface configuration file, query running state or check running state of the interface with configuration in \fB/etc/network/interfaces\fP file. .sp \fBifquery\fP always works on the current \fBinterfaces(5)\fP file \fB/etc/network/interfaces\fP unless an alternate interfaces file is defined in ifupdown2.conf or provided with the \fB\-i\fP option. Note: the \-i option is enabled by default in ifupdown2.conf. .UNINDENT .UNINDENT .SH OPTIONS .INDENT 0.0 .INDENT 3.5 positional arguments: .sp \fBIFACE\fP interface list separated by spaces. \fBIFACE\fP list and \fB\(aq\-a\(aq\fP argument are mutually exclusive. .sp optional arguments: .INDENT 0.0 .TP .B \-h\fP,\fB \-\-help show this help message and exit .TP .B \-a\fP,\fB \-\-all process all interfaces marked "auto" .TP .B \-v\fP,\fB \-\-verbose verbose .TP .B \-d\fP,\fB \-\-debug output debug info .TP .BI \-\-allow \ CLASS ignore non\-"allow\-CLASS" interfaces .TP .B \-w\fP,\fB \-\-with\-depends run with all dependent interfaces. This option is redundant when \-a is specified. When \(aq\-a\(aq is specified, interfaces are always executed in dependency order. .TP .BI \-X \ EXCLUDEPATS\fR,\fB \ \-\-exclude \ EXCLUDEPATS Exclude interfaces from the list of interfaces to operate on. Can be specified multiple times If the excluded interface has dependent interfaces, (e.g. a bridge or a bond with multiple enslaved interfaces) then each dependent interface must be specified in order to be excluded. .TP .BI \-i \ INTERFACESFILE\fR,\fB \ \-\-interfaces \ INTERFACESFILE Use interfaces file instead of default defined in ifupdown2.conf (default /etc/network/interfaces) .UNINDENT .INDENT 0.0 .TP .B \-t {native,json}, \-\-interfaces\-format {native,json} interfaces file format .UNINDENT .INDENT 0.0 .TP .B \-r\fP,\fB \-\-running print raw interfaces file entries .TP .B \-c\fP,\fB \-\-check check interface file contents against running state of an interface. Returns exit code 0 on success and 1 on error .TP .B \-x\fP,\fB \-\-raw print raw config file entries .UNINDENT .INDENT 0.0 .TP .B \-o {native,json}, \-\-format {native,json} interface display format .TP .B \-p, \-\-print\-dependency {list,dot} print iface dependency in list or dot format .UNINDENT .INDENT 0.0 .TP .B \-s\fP,\fB \-\-syntax\-help print supported interface config syntax. Scans all addon modules and dumps supported syntax from them if provided by the module. .UNINDENT .UNINDENT .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 # dump all or some interfaces config file entries # (pretty prints user provided entries) .INDENT 0.0 .INDENT 3.5 \fBifquery \-a\fP .sp \fBifquery br0\fP .UNINDENT .UNINDENT .sp # Same as above but dump with dependencies .INDENT 0.0 .INDENT 3.5 \fBifquery br0 \-\-with\-depends\fP .UNINDENT .UNINDENT .sp # Check running state with the config in /etc/network/interfaces .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-check br0\fP .sp \fBifquery \-\-check \-\-with\-depends br0\fP .sp \fBifquery \-\-check \-a\fP .UNINDENT .UNINDENT .sp # dump running state of all interfaces in /etc/network/interfaces format .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-running br0\fP .sp \fBifquery \-\-running \-\-with\-depends br0\fP .sp \fBifquery \-\-running \-a\fP .UNINDENT .UNINDENT .sp # print dependency info in list format .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-print\-dependency=list \-a\fP .sp \fBifquery \-\-print\-dependency=list br2000\fP .UNINDENT .UNINDENT .sp # print dependency info in dot format .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-print\-dependency=dot \-a\fP .sp \fBifquery \-\-print\-dependency=dot br2000\fP .UNINDENT .UNINDENT .sp # Create an image (png) from the dot format .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-print\-dependency=dot \-a > interfaces.dot\fP .sp \fBdot \-Tpng interfaces.dot > interfaces.png\fP .sp (The above command only works on a system with dot installed) .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH KNOWN_ISSUES .INDENT 0.0 .INDENT 3.5 \fBifquery \-\-check\fP is currently experimental .sp \fBifquery \-\-check\fP cannot validate usercommands given under pre\-up, post\-up etc There is currently no support to check/validate ethtool iface attributes .UNINDENT .UNINDENT .SH SEE ALSO .INDENT 0.0 .INDENT 3.5 ifup(8), ifdown(8), ifreload(8), interfaces(5), ifupdown\-addons\-interfaces(5) .UNINDENT .UNINDENT .SH AUTHOR Roopa Prabhu .SH COPYRIGHT Copyright 2014 Cumulus Networks, Inc. All rights reserved. .\" Generated by docutils manpage writer. .