File: ifup.8

package info (click to toggle)
ifupdown 0.8.35
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 980 kB
  • sloc: ansic: 2,789; sh: 708; perl: 513; makefile: 87
file content (293 lines) | stat: -rw-r--r-- 8,472 bytes parent folder | download
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
.TH ifup 8 "11 Jan 2017" IFUPDOWN ""
.SH NAME
ifup \- bring a network interface up
.PP
ifdown \- take a network interface down
.PP
ifquery \- parse interface configuration
.SH SYNOPSIS
.B ifup 
[\fB\-nv\fR]
[\fB\-\-no\-act\fR]
[\fB\-\-verbose\fR]
[\fB\-i\fR \fIFILE\fR|\fB\-\-interfaces=\fR\fIFILE\fR]
[\fB\-\-state-dir=\fR\fIDIR\fR]
[\fB\-\-allow\fR \fICLASS\fR]
\fB\-a\fR|\fIIFACE\fR...
.br
.B ifup 
\fB\-h\fR|\fB\-\-help\fR
.br
.B ifup 
\fB\-V\fR|\fB\-\-version\fR
.PP
.B ifdown
[\fB\-nv\fR]
[\fB\-\-no\-act\fR]
[\fB\-\-verbose\fR]
[\fB\-i\fR \fIFILE\fR|\fB\-\-interfaces=\fR\fIFILE\fR]
[\fB\-\-state-dir=\fR\fIDIR\fR]
[\fB\-\-allow\fR \fICLASS\fR]
\fB\-a\fR|\fIIFACE\fR...
.PP
.B ifquery
[\fB\-nv\fR]
[\fB\-\-verbose\fR]
[\fB\-i\fR \fIFILE\fR|\fB\-\-interfaces=\fR\fIFILE\fR]
[\fB\-\-state-dir=\fR\fIDIR\fR]
[\fB\-\-allow\fR \fICLASS\fR]
\fIIFACE\fR...
.PP
.B ifquery
\fB\-l\fR|\fB\-\-list\fR
[\fB\-nv\fR]
[\fB\-\-verbose\fR]
[\fB\-i\fR \fIFILE\fR|\fB\-\-interfaces=\fR\fIFILE\fR]
[\fB\-\-state-dir=\fR\fIDIR\fR]
[\fB\-\-allow\fR \fICLASS\fR]
[\fB\-a\fR|\fIIFACE\fR...]
.PP
.B ifquery
\fB\-\-state\fR
[\fB\-\-state-dir=\fR\fIDIR\fR]
[\fB\-\-allow\fR \fICLASS\fR]
[\fB\-a\fR|\fIIFACE\fR...]
.SH DESCRIPTION
The
.BR ifup " and " ifdown
commands may be used to configure (or, respectively, deconfigure) network
interfaces based on interface definitions in the file
.IR /etc/network/interfaces ". "
.BR ifquery " command may be used to parse interfaces configuration."
.SH OPTIONS
A summary of options is included below.
.TP
.BR \-a ", " \-\-all
If given to \fBifup\fP, affect all interfaces marked \fBauto\fP.
Interfaces are brought up in the order in which they are defined
in
.IR /etc/network/interfaces .
Combined with \fB-\-allow\fP, acts on all interfaces of a specified class
instead.
If given to \fBifdown\fP, affect all defined interfaces.
Interfaces are brought down in the order in which they are
currently listed in the state file. Only interfaces defined
in
.I /etc/network/interfaces
will be brought down.
.TP
.B \-\-force
Force configuration or deconfiguration of the interface.
.TP
.B \-\-ignore-errors
If any of the commands of scripts fails, continue.
.TP
.BR \-h ", " \-\-help
Show summary of options.
.TP
\fB\-\-allow=\fR\fICLASS\fR
Only allow interfaces listed in an
.I allow\-CLASS
line in 
.IR /etc/network/interfaces " to be acted upon."
.TP
\fB\-i\fR \fIFILE\fR, \fB\-\-interfaces=\fR\fIFILE\fR
Read interface definitions from 
.I FILE
instead of from
.IR /etc/network/interfaces "."
.TP
\fB\-\-state\-dir=\fR\fIDIR\fR
Keep interface state in
.I DIR
instead of in
.IR /run/network "."
.TP
.BI \-X " PATTERN\fR, " "\-\-exclude=" PATTERN
Exclude interfaces from the list of interfaces to operate on by the \fIPATTERN\fR.
\fIPATTERN\fR uses a usual shell glob syntax. If shell wildcards are not used, it
must match the exact interface name. This option may be specified multiple times
resulting in more than one pattern being excluded.
.TP
.BI \-o " OPTION" "\fB=" VALUE
Set \fIOPTION\fR to \fIVALUE\fR as though it were in
.IR /etc/network/interfaces .
.TP
.BR \-n ", " \-\-no\-act
Don't configure any interfaces or run any "up" or "down" commands.
.TP
.B \-\-no\-mappings
Don't run any mappings.  See
.BR interfaces (5)
for more information about the mapping feature.
.TP
.B \-\-no\-scripts
Don't run any scripts under /etc/network/if-*.d/
.TP
.B \-\-no\-loopback
Disable special handling of the loopback interface. By default, the loopback interface
(\fIlo\fR on Linux) is predefined internally as an auto interface, so it's brought up
on \fBifup -a\fR automatically. In the case the loopback device is redefined by user,
the interface is configured just once anyway. If, however, another interface is also
defined as loopback, it's configured as usual. Specifying this option disables this
behaviour, so the loopback interface won't be configured automatically.
.TP
.BR \-V ", " \-\-version
Show copyright and version information.
.TP
.BR \-v ", " \-\-verbose
Show commands as they are executed.
.TP
.BR \-l ", " \-\-list
For \fBifquery\fR, list all the interfaces which match the specified class.
If no class specified, prints all the interfaces listed as \fBauto\fR.
.TP
.BR \-\-state
For \fBifquery\fR, dump the state of the interfaces. When no interfaces specified,
lists all interfaces brought up together with logical interfaces assigned to them and
exits with a status code indicating success. If one or more interfaces specified,
display state of these interfaces only; successful code is returned if all of interfaces
given as arguments are up. Otherwise, 0 is returned.
.SH EXAMPLES
.TP
.B ifup -a
Bring up all the interfaces defined with
.I auto
in 
.I /etc/network/interfaces
.TP
.B ifup eth0
Bring up interface
.B eth0
.TP
.B ifup eth0=home
Bring up interface
.B eth0
as logical interface
.B home
.TP
.B ifdown -a
Bring down all interfaces that are currently up.
.TP
.B ifquery -l
Print names of all interfaces specified with the \fBauto\fR keyword.
.TP
.B ifquery -l --allow=hotplug
Print names of all interfaces specified with the \fBallow-hotplug\fR keyword.
.TP
.B ifquery eth0
Display the interface options as specified in the \fBifupdown\fR
configuration. Each key-value pair is printed out on individual
line using "\fB: \fR" as separator.
.SH NOTES
.BR ifup ,
.BR ifdown ,
and
.BR ifquery
are actually the same program called by different names.
.P
The program does not configure network interfaces directly;
it runs low level utilities such as
.BR ip
to do its dirty work.
.P
When invoked,
.B ifdown
checks if
.B ifup
is still running. In that case,
.B SIGTERM
is sent to ifup.
.P
During interface deconfiguration,
.BR ifdown
ignores errors the same way as if
.B \-\-ignore\-errors
was specified.
.SH FILES
.TP
.I /etc/network/interfaces
definitions of network interfaces
See
.BR interfaces (5)
for more information.
.TP
.I /run/network/ifstate
current state of network interfaces
.SH CONCURRENCY
Ifupdown uses per-interface locking to ensure that concurrent ifup and ifdown calls to the same interface are run in serial.
However, calls to different interfaces will be able to run in parallel.
.SH EXIT STATUS
For
.B ifup
and
.B ifdown\fR,
the exit status will be 0 if the given interface(s) have all been (de)configured successfully, 1 if there was any error.
The result of these commands is idempotent; running
.B ifup
on an interface that is already up will result in an exit status of 0, and similarly running
.B ifdown
on an interface that is not up will also result in an exit status of 0.
.P
.B ifquery
will normally return with exit status 0 if an interface with a matching iface stanza, 1 if there is no matching stanza.
.B ifquery --state
will also return with exit status 1 if the given interface was known but was not up.
.SH KNOWN BUGS/LIMITATIONS
The program keeps records of whether network interfaces are up or down.
Under exceptional circumstances these records can become
inconsistent with the real states of the interfaces.
For example, an interface that was brought up using
.B ifup
and later deconfigured using
.B ifconfig
will still be recorded as up.
To fix this you can use the
.B \-\-force
option to force
.B ifup
or
.B ifdown
to run configuration or deconfiguration commands despite what
it considers the current state of the interface to be.
.P
The file
.I /run/network/ifstate
must be writable for
.B ifup
or
.B ifdown
to work properly.
If that location is not writable
(for example, because the root filesystem is mounted read-only
for system recovery)
then
.I /run/network/ifstate
should be made a symbolic link to a writable location.
If that is not possible then you can use the
.B \-\-force
option to run configuration or deconfiguration commands
without updating the file.
.P
Note that the program does not run automatically:
.B ifup
alone does not bring up interfaces
that appear as a result of hardware being installed and 
.B ifdown
alone does not bring down interfaces
that disappear as a result of hardware being removed.
To automate the configuration of network interfaces you need to
install other packages such as
.BR udev (7)
or
.BR ifplugd (8).
.SH AUTHORS
The ifupdown suite was created by Anthony Towns <aj@azure.humbug.org.au>,
and is currently maintained by Guus Sliepen <guus@debian.org>.
.P
Many others have helped develop ifupdown over time, see
/usr/share/doc/ifupdown/changelog.Debian.gz for a full history.
.SH SEE ALSO
.BR interfaces (5),
.BR ip (8),
.BR ifconfig (8).