24
24
This is where you configure how your system is connected to the network.
26
Lines starting with `#' are ignored.
27
A line may be extended across multiple lines by making the last character a backslash.
29
The file consists of zero or more "iface", "mapping" and "auto" stanzas.
26
Lines starting with `#' are ignored. Note that end-of-line comments are
27
NOT supported, comments must be on a line of their own.
29
A line may be extended across multiple lines by making the last character
32
The file consists of zero or more "iface", "mapping", "auto" and "allow-"
33
stanzas. Here is an example.
34
38
iface lo inet loopback
46
50
iface eth0\-work inet dhcp
48
Stanzas beginning with the word "auto" are used to identify the physical
54
Lines beginning with the word "auto" are used to identify the physical
49
55
interfaces to be brought up when
57
63
brings the named interfaces up in the order listed.
65
Lines beginning with "allow-" are used to identify interfaces that should
66
be brought up automatically by various subsytems. This may be done using
67
a command such as "ifup --allow=hotplug eth0 eth1", which will only bring
68
up eth0 or eth1 if it is listed in an "allow-hotplug" line. Note that
69
"allow-auto" and "auto" are synonyms.
59
71
Stanzas beginning with the word "mapping" are used to determine how a
60
72
logical interface name is chosen for a physical interface that is to be
61
73
brought up. The first line of a mapping stanza consists of the word
78
90
is normally given a physical interface name as its first non\-option argument.
80
also uses this name as the initial logical name for the interface
81
unless it is accompanied by a suffix of the form \fI=LIFACE\fR, in
82
which case ifup chooses LIFACE as the initial logical name for the interface.
92
also uses this name as the initial logical name for the interface unless
93
it is accompanied by a suffix of the form \fI=LOGICAL\fR, in which case
94
ifup chooses \fILOGICAL\fR as the initial logical name for the interface.
83
95
It then maps this name, possibly more than once according to successive
84
mapping specifications, until no further mappings are possible.
85
If the resulting name is the name of some defined logical interface then
96
mapping specifications, until no further mappings are possible. If the
97
resulting name is the name of some defined logical interface then
87
99
attempts to bring up the physical interface
88
100
as that logical interface. Otherwise
119
131
The following "command" options are available for every family and method.
120
132
Each of these options can be given multiple times in a single stanza,
121
133
in which case the commands are executed in the order in which they appear
122
in the stanza. If one of the commands fails, none of the others will be
123
executed but the interface will still be configured.
124
135
(You can ensure a command never fails by suffixing "|| true".)
129
after bringing the interface up.
131
137
.BI pre\-up " command"
134
140
before bringing the interface up.
141
If this command fails then
144
refraining from marking the interface as configured,
145
prints an error message,
146
and exits with status 0.
147
This behavior may change in the future.
151
.BI post\-up " command"
154
after bringing the interface up.
155
If this command fails then
158
refraining from marking the interface as configured
159
(even though it has really been configured),
160
prints an error message,
161
and exits with status 0.
162
This behavior may change in the future.
136
164
.BI down " command"
166
.BI pre\-down " command"
139
169
before taking the interface down.
170
If this command fails then
173
marks the interface as deconfigured
174
(even though it has not really been deconfigured),
175
and exits with status 0.
176
This behavior may change in the future.
141
178
.BI post\-down " command"
144
181
after taking the interface down.
182
If this command fails then
185
marks the interface as deconfigured,
186
and exits with status 0.
187
This behavior may change in the future.
146
189
There exists for each of the above mentioned options a directory
147
190
.IR /etc/network/if\-\fB<option>\fI.d/
152
195
All of these commands have access to the following environment variables.
158
if \fB\-\-verbose\fR option active,
164
198
physical name of the interface being processed
201
logical name of the interface being processed
168
204
address family of the interface
172
207
method of the interface (e.g.,
176
211
.IR start " if run from ifup, " stop " if run from ifdown"
214
as per MODE, but with finer granularity, distinguishing the
215
\fIpre-up\fR, \fIpost-up\fR, \fIpre-down\fR and \fIpost-down\fR phases.
218
indicates whether \fB--verbose\fR was used; set to 1 if so, 0 if not.
180
221
the command search path:
182
/usr/local/sbin:\%/usr/local/bin:\%/usr/sbin:\%/usr/bin:\%/sbin:\%/bin
222
.I /usr/local/sbin:\%/usr/local/bin:\%/usr/sbin:\%/usr/bin:\%/sbin:\%/bin
184
224
Additionally, all options given in an interface definition stanza are
185
225
exported to the environment in upper case with "IF_" prepended and with