]> git.proxmox.com Git - mirror_ifupdown2.git/blame - ifupdown2/man/interfaces.5.rst
config: local addons modules should be loaded first
[mirror_ifupdown2.git] / ifupdown2 / man / interfaces.5.rst
CommitLineData
2c8c4ce7
RP
1==========
2interfaces
3==========
4
5--------------------------------------------
6network interface configuration for ifupdown
7--------------------------------------------
8
9:Author: Roopa Prabhu <roopa@cumulusnetworks.com>
10:Date: 2014-02-05
11:Copyright: Copyright 2014 Cumulus Networks, Inc. All rights reserved.
12:Version: 0.1
d486dd0d 13:Manual section: 5
2c8c4ce7
RP
14
15DESCRIPTION
16===========
1e6d7bd7
ST
17 By default, ifupdown2.conf sets **/etc/network/interfaces** as the
18 network interface configuration file. This file contains information
19 for the **ifup(8)**, **ifdown(8)** and **ifquery(8)** commands.
2c8c4ce7
RP
20
21 This is where you configure how your system is connected to the network.
22
23 Lines starting with # are ignored. Note that end-of-line comments are
24 NOT supported, comments must be on a line of their own.
25
26 A line may be extended across multiple lines by making the last character
27 a backslash.
28
d486dd0d 29 The file consists of zero or more "iface", "auto", "allow-"
2c8c4ce7
RP
30 and "source" stanzas. Here is an example::
31
32 auto lo eth0
33 allow-hotplug eth1
34
35 iface lo inet loopback
36
37 source /etc/network/interfaces.d/bridges
38
39 iface eth0 inet static
40 address 192.168.1.1/24
41 up flush-mail
42
43 iface eth1 inet dhcp
44
45 Lines beginning with the word "auto" are used to identify the physical
46 interfaces to be brought up when ifup is run with the -a option.
47 (This option is used by the system boot scripts.) Physical interface names
d486dd0d
JF
48 should follow the word "auto" on the same line. There can be multiple
49 "auto" stanzas.
2c8c4ce7 50
d486dd0d
JF
51 Lines beginning with "allow-" are used to identify interfaces that
52 should be brought up automatically by various subsystems. This may be
53 done using a command such as "ifup --allow=hotplug eth0 eth1", which
54 will only bring up eth0 or eth1 if it is listed in an "allow-hotplug"
2c8c4ce7
RP
55 line. Note that "allow-auto" and "auto" are synonyms.
56
d486dd0d 57 Lines beginning with "source" are used to include stanzas from other
2c8c4ce7 58 files, so configuration can be split into many files. The word "source"
d486dd0d
JF
59 is followed by the path of the file to be sourced. Shell wildcards can
60 be used. Currently only supports absolute path names.
2c8c4ce7
RP
61
62 iface is normally given a interface name as its first non-option
d486dd0d 63 argument.
2c8c4ce7
RP
64
65 The interface name is followed by the name of the address family that the
66 interface uses. This will be "inet" for TCP/IP networking and inet6 for
67 ipv6. Following that is the name of the method used to configure the
68 interface.
69
70 ifupdown supports iface stanzas without a family or a method. This enables
71 using the same stanza for inet and inet6 family addresses. And the method
72 defaults to "static"
73
74 Additional interface options/attributes can be given on subsequent lines
75 in the iface stanza. These options come from addon modules. see
76 **ifupdown-addons-interfaces(5)** for these options.
77
78 example bridge interface with additional attributes listed in the
79 **ifupdown-addons-interfaces(5)** man page::
80
81 auto br0
82 iface br0
83 address 12.0.0.4/24
84 address 2000:1000:1000:1000:3::5/128
85 bridge-ports swp1 swp2 swp3
86 bridge-stp on
87
88 ifupdown supports python-mako style templates in the interfaces file.
89 See examples section for details.
90
d486dd0d 91 See **/usr/share/doc/ifupdown2/examples/** for **interfaces(5)**
2c8c4ce7
RP
92 file examples and interfaces file generation scripts.
93
94METHODS
95=======
96 Both **inet** and **inet6** address family interfaces can use the following
97 methods (However they are not required):
98
99 The loopback Method
100 This method may be used to define the loopback interface.
101
102 The static Method
103 This method may be used to define ethernet interfaces with
104 statically allocated addresses.
105
106 The dhcp Method
107 This method may be used to obtain an address via DHCP.
108
109BUILTIN INTERFACES
110==================
111 **iface** sections for some interfaces like physical interfaces or vlan
112 interfaces in dot notation (like eth1.100) are understood by ifupdown.
113 These interfaces do not need an entry in the interfaces file if
83e13021 114 they are dependents of other interfaces and don't need any specific
2c8c4ce7
RP
115 configurations like addresses etc.
116
117EXAMPLES
118========
119 Sample /etc/network/interfaces file::
120
121 auto lo
122 iface lo
123 address 192.168.2.0/24
124 address 2001:dee:eeee:1::4/128
125
126 auto eth0
127 iface eth0 inet dhcp
128
129 auto eth1
130 iface eth1 inet manual
131 address 192.168.2.0/24
132 address 2001:dee:eeee:1::4/128
133
134 # source files from a directory /etc/network/interfaces.d
135 source /etc/network/interfaces.d/*
136
137 # Using mako style templates
138 % for v in [11,12]:
139 auto vlan${v}
140 iface vlan${v} inet static
141 address 10.20.${v}.3/24
142 % endfor
143
144 For additional syntax and examples see **ifupdown-addons-interfaces(5)**
145
146FILES
147=====
1e6d7bd7 148 configuration file defined in ifupdown2.conf (default /etc/network/interfaces)
2c8c4ce7
RP
149
150SEE ALSO
151========
152 ifupdown-addons-interfaces(5),
153 ifup(8),
154 ifquery(8),
155 ifreload(8)