]> git.proxmox.com Git - ifupdown-pve.git/blame - inet6.defn
Squashed 'src/' content from commit c732260
[ifupdown-pve.git] / inet6.defn
CommitLineData
6f248ce1
TL
1address_family inet6
2architecture linux
3
4method auto
5 description
6 This method may be used to define interfaces with automatically assigned
7 IPv6 addresses. Using this method on its own doesn't mean that RDNSS options
8 will be applied, too. To make this happen, *rdnssd* daemon must be installed,
9 properly configured and running.
10 If stateless DHCPv6 support is turned on, then additional network
11 configuration parameters such as DNS and NTP servers will be retrieved
12 from a DHCP server. Please note that on ifdown, the lease is not currently
13 released (a known bug).
14
15 options
16 privext int -- Privacy extensions (RFC4941) (0=off, 1=assign, 2=prefer)
17 accept_ra int -- Accept router advertisements (0=off, 1=on, 2=on+forwarding) [2]
18 dhcp int -- Use stateless DHCPv6 (0=off, 1=on)
19 request_prefix int -- Request a prefix through DHCPv6 Prefix Delegation (0=off, 1=on) [0]
20 ll-attempts -- Number of attempts to wait for a link-local address [60]
21 ll-interval -- Link-local address polling interval in seconds [0.1]
22
23 up
24 /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
25 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]]
26 -/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%
27 -/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=1
28 /sbin/ip addr flush dev %iface% mngtmpaddr \
29 if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd))
30 /sbin/ip link set dev %iface% up
31 /lib/ifupdown/wait-for-ll6.sh if (var_true("dhcp", ifd) && execable("/lib/ifupdown/wait-for-ll6.sh"))
32 /sbin/dhclient -6 -v -P -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
33 if (var_true("dhcp", ifd) && execable("/sbin/dhclient") && var_true("request_prefix", ifd))
34 /sbin/dhclient -6 -v -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
35 elsif (var_true("dhcp", ifd) && execable("/sbin/dhclient"))
36 echo 'No DHCPv6 client software found!' >&2; false \
37 elsif (var_true("dhcp", ifd))
38
39 down
40 /sbin/ip -6 addr flush dev %iface% scope global
41 /sbin/ip link set dev %iface% down \
42 if (iface_is_link())
43
44method loopback
45 description
46 This method may be used to define the IPv6 loopback interface.
47 up
48 -/sbin/ip link set dev %iface% up 2>/dev/null if (!iface_is_lo())
49 -/sbin/ip addr add dev %iface% ::1 2>/dev/null if (!iface_is_lo())
50 down
51 -/sbin/ip addr del dev %iface% ::1 2>/dev/null if (!iface_is_lo())
52 -/sbin/ip link set dev %iface% down 2>/dev/null if (!iface_is_lo())
53
54method static
55 description
56 This method may be used to define interfaces with statically assigned
57 IPv6 addresses. By default, stateless autoconfiguration is disabled for
58 this interface.
59
60 options
61 address address -- Address (colon delimited/netmask) *required*
62 netmask mask -- Netmask (number of bits, eg 64) *deprecated*
63 metric metric -- Routing metric for default gateway (integer)
64 gateway address -- Default gateway (colon delimited)
65 media type -- Medium type, driver dependent
66 hwaddress address -- Hardware address or "random"
67 mtu size -- MTU size
68 accept_ra int -- Accept router advertisements (0=off, 1=on, 2=on+forwarding)
69 autoconf int -- Perform stateless autoconfiguration (0=off, 1=on) [0]
70 privext int -- Privacy extensions (RFC3041) (0=off, 1=assign, 2=prefer)
71 scope -- Address validity scope. Possible values: \
72 global, site, link, host
73 preferred-lifetime int -- Time that address remains preferred []
74 dad-attempts -- Number of attempts to settle DAD (0 to disable DAD) [60]
75 dad-interval -- DAD state polling interval in seconds [0.1]
76
77 conversion
78 hwaddress cleanup_hwaddress
79 preferred-lifetime set_preferred_lft
80 address (get_token / 1 "") =netmask?
81 address (get_token / 0 "")
82 gateway (if_set 0) =accept_ra?
83
84 up
85 /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
86 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.use_tempaddr=%privext%]]
87 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]]
88 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]]
89 -[[if [ "$(/bin/cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then /sbin/ip link set dev %iface% mtu %mtu%; else /sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]]
90 /sbin/ip addr flush dev %iface% mngtmpaddr \
91 if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd))
92 /sbin/ip link set dev %iface% [[address %hwaddress%]] up
93 /sbin/ip -6 addr add %address%[[/%netmask%]] [[scope %scope%]] dev %iface% [[preferred_lft %preferred-lifetime%]] \
94 if (!var_set("dad-attempts", ifd) || var_true("dad-attempts", ifd))
95 /sbin/ip -6 addr add %address%[[/%netmask%]] [[scope %scope%]] dev %iface% [[preferred_lft %preferred-lifetime%]] nodad \
96 if (var_set("dad-attempts", ifd) && !var_true("dad-attempts", ifd))
97 [[ /sbin/ip -6 route replace default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
98 /lib/ifupdown/settle-dad.sh if (!no_act_commands && execable("/lib/ifupdown/settle-dad.sh") && (var_true("dad-attempts", ifd)))
99
100 down
101 [[ /sbin/ip -6 route del default via %gateway% [[metric %metric%]] dev %iface% ]]
102 /sbin/ip -6 addr del %address%[[/%netmask%]] [[scope %scope%]] dev %iface%
103 /sbin/ip -6 addr flush dev %iface% \
104 if (iface_is_link())
105 /sbin/ip link set dev %iface% down \
106 if (iface_is_link())
107
108method manual
109 description
110 This method may be used to define interfaces for which no configuration
111 is done by default. Such interfaces can be configured manually by
112 means of *up* and *down* commands or /etc/network/if-*.d scripts.
113
114 options
115 hwaddress address -- Hardware address or "random"
116 mtu size -- MTU size
117
118 conversion
119 hwaddress cleanup_hwaddress
120
121 up
122 -[[if [ "$(/bin/cat /sys/class/net/%iface%/mtu)" -lt %mtu% ]; then /sbin/ip link set dev %iface% mtu %mtu%; else /sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.mtu=%mtu%; fi]]
123 [[/sbin/ip link set dev %iface% address %hwaddress%]]
124 /sbin/ip link set dev %iface% up 2>/dev/null || true
125
126 down
127 /sbin/ip -6 addr flush dev %iface% 2>/dev/null || true \
128 if (iface_is_link())
129 /sbin/ip link set dev %iface% down 2>/dev/null || true \
130 if (iface_is_link() || !do_all)
131
132method dhcp
133 description
134 This method may be used to obtain network interface configuration via
135 stateful DHCPv6 with dhclient. In stateful DHCPv6, the DHCP server is
136 responsible for assigning addresses to clients.
137
138 options
139 hwaddress address -- Hardware address or "random"
140 accept_ra int -- Accept router advertisements (0=off, 1=on, 2=on+forwarding) [1]
141 autoconf int -- Perform stateless autoconfiguration (0=off, 1=on)
142 request_prefix int -- Request a prefix through DHCPv6 Prefix Delegation (0=off, 1=on) [0]
143 ll-attempts -- Number of attempts to wait for a link-local address [60]
144 ll-interval -- Link-local address polling interval in seconds [0.1]
145
146 conversion
147 hwaddress cleanup_hwaddress
148
149 up
150 /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
151 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.accept_ra=%accept_ra%]]
152 -[[/sbin/sysctl -q -e -w net.ipv6.conf.%iface/.//%.autoconf=%autoconf%]]
153 /sbin/ip addr flush dev %iface% mngtmpaddr \
154 if (var_set("accept_ra", ifd) && !var_true("accept_ra", ifd))
155 /sbin/ip link set dev %iface% [[address %hwaddress%]] up
156 /lib/ifupdown/wait-for-ll6.sh if (execable("/lib/ifupdown/wait-for-ll6.sh"))
157 /sbin/dhclient -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -P -N -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
158 if (execable("/sbin/dhclient") && var_true("request_prefix", ifd))
159 /sbin/dhclient -6 -v -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
160 elsif (execable("/sbin/dhclient"))
161 echo 'No DHCPv6 client software found!' >&2; false \
162 elsif (1)
163
164 down
165 /sbin/dhclient -6 -v -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
166 if (execable("/sbin/dhclient"))
167 echo 'No DHCPv6 client software found!' >&2; false \
168 elsif (1)
169
170 /sbin/ip link set dev %iface% down \
171 if (iface_is_link())
172
173method v4tunnel
174 description
175 This method may be used to setup an IPv6-over-IPv4 tunnel. It requires
176 the *ip* command from the *iproute* package.
177
178 options
179 address address -- Address (colon delimited/netmask) *required*
180 netmask mask -- Netmask (number of bits, eg 64) *deprecated*
181 endpoint address -- Address of other tunnel endpoint (IPv4 \
182 dotted quad) *required*
183 local address -- Address of the local endpoint (IPv4 \
184 dotted quad)
185 metric metric -- Routing metric for default gateway (integer)
186 gateway address -- Default gateway (colon delimited)
187 ttl time -- TTL setting
188 mtu size -- MTU size
189 preferred-lifetime int -- Time that address remains preferred []
190
191 conversion
192 preferred-lifetime set_preferred_lft
193
194 up
195 /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
196 /sbin/ip tunnel add %iface% mode sit remote %endpoint% [[local %local%]] \
197 [[ttl %ttl%]]
198 /sbin/ip link set %iface% up [[mtu %mtu%]]
199 [[ /sbin/ip addr add %address%[[/%netmask%]] dev %iface% [[preferred_lft %preferred-lifetime%]] ]]
200 [[ /sbin/ip route add %gateway% dev %iface% ]]
201 [[ /sbin/ip route add ::/0 via %gateway% [[metric %metric%]] dev %iface% onlink ]]
202
203 down
204 /sbin/ip tunnel del %iface%
205
206method 6to4
207 description
208 This method may be used to setup a 6to4 tunnel. It requires
209 the *ip* command from the *iproute* package.
210
211 options
212 local address -- Address of the local endpoint (IPv4 \
213 dotted quad) *required*
214 metric metric -- Routing metric for default gateway (integer)
215 ttl time -- TTL setting
216 mtu size -- MTU size
217 preferred-lifetime int -- Time that address remains preferred []
218
219 conversion
220 local make_hex_address =hexaddress
221 preferred-lifetime set_preferred_lft
222
223 up
224 /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
225 /sbin/ip tunnel add %iface% mode sit remote any local %local% \
226 [[ttl %ttl%]]
227 /sbin/ip link set %iface% up [[mtu %mtu%]]
228 /sbin/ip addr add 2002:%hexaddress%::1/16 dev %iface% [[preferred_lft %preferred-lifetime%]]
229 /sbin/ip route add 2000::/3 via ::192.88.99.1 [[metric %metric%]] dev %iface%
230
231 down
232 /sbin/ip -6 route flush dev %iface%
233 /sbin/ip link set dev %iface% down
234 /sbin/ip tunnel del %iface%
235
236
237architecture kfreebsd
238
239method loopback
240 description
241 This method may be used to define the IPv6 loopback interface.
242 up
243 /sbin/ifconfig %iface% inet6 ::1 \
244 if (!iface_is_lo())
245 down
246 /sbin/ifconfig %iface% down \
247 if (!iface_is_lo())
248
249method static
250 description
251 This method may be used to define interfaces with statically assigned
252 IPv6 addresses.
253
254 options
255 address address -- Address (colon delimited/netmask) *required*
256 netmask mask -- Netmask (number of bits, eg 64) *deprecated*
257 gateway address -- Default gateway (colon delimited)
258 media type -- Medium type, driver dependent
259 hwaddress address -- Hardware address or "random"
260 mtu size -- MTU size
261
262 conversion
263 hwaddress cleanup_hwaddress
264
265 up
266 /sbin/ifconfig %iface% [[media %media%]] [[link %hwaddress%]] [[mtu %mtu%]] up
267 /sbin/ifconfig %iface% inet6 %address%[[/%netmask%]] alias
268 [[ /sbin/route add -inet6 ::/0 %gateway% ]]
269
270 down
271 [[ /sbin/route -n del -inet6 ::/0 2>&1 1>/dev/null || true ]]
272 [[ /sbin/ifconfig %iface% inet6 %address% -alias ]]
273 /sbin/ifconfig %iface% down
274
275method manual
276 description
277 This method may be used to define interfaces for which no configuration
278 is done by default. Such interfaces can be configured manually by
279 means of *up* and *down* commands or /etc/network/if-*.d scripts.
280
281 up
282
283 down
284
285method auto
286 description
287 This method may be used to define interfaces with automatically assigned
288 IPv6 addresses. Using this method on its own doesn't mean that RDNSS options
289 will be applied, too. To make this happen, *rdnssd* daemon must be installed,
290 properly configured and running.
291 If stateless DHCPv6 support is turned on, then additional network
292 configuration parameters such as DNS and NTP servers will be retrieved
293 from a DHCP server. Please note that on ifdown, the lease is not currently
294 released (a known bug).
295
296 options
297 dhcp int -- Use stateless DHCPv6 (0=off, 1=on)
298
299 conversion
300 hwaddress cleanup_hwaddress
301
302 up
303 /sbin/ifconfig %iface% inet6 accept_rtadv up
304 /sbin/dhclient -6 -S -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
305 if (var_true("dhcp", ifd) && execable("/sbin/dhclient"))
306 echo 'No DHCPv6 client software found!' >&2; false \
307 elsif (var_true("dhcp", ifd))
308
309 down
310 /sbin/ifconfig %iface% down
311
312
313
314method dhcp
315 description
316 This method may be used to obtain network interface configuration via
317 stateful DHCPv6 with dhclient. In stateful DHCPv6, the DHCP server is
318 responsible for assigning addresses to clients.
319
320 options
321 hwaddress address -- Hardware address or "random"
322
323 conversion
324 hwaddress cleanup_hwaddress
325
326 up
327 /sbin/ifconfig %iface% [[link %hwaddress%]] up
328 /sbin/dhclient -6 -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
329 if (execable("/sbin/dhclient"))
330 echo 'No DHCPv6 client software found!' >&2; false \
331 elsif (1)
332
333 down
334 /sbin/dhclient -6 -r -pf /run/dhclient6.%iface%.pid -lf /var/lib/dhcp/dhclient6.%iface%.leases -I -df /var/lib/dhcp/dhclient.%iface%.leases %iface% \
335 if (execable("/sbin/dhclient"))
336 echo 'No DHCPv6 client software found!' >&2; false \
337 elsif (1)
338
339 /sbin/ifconfig %iface% down
340
341architecture hurd
342
343method loopback
344 description
345 This method may be used to define the IPv6 loopback interface.
346 up
347 [[FIXME: Add proper commands here for ipv6]]
348 down
349 [[FIXME: Add proper commands here for ipv6]]
350
351method static
352 description
353 This method may be used to define interfaces with statically assigned
354 IPv6 addresses.
355
356 options
357 address address -- Address (colon delimited/netmask) *required*
358 netmask mask -- Netmask (number of bits, eg 64) *deprecated*
359 gateway address -- Default gateway (colon delimited)
360 media type -- Medium type, driver dependent
361 hwaddress address -- Hardware address (Not yet supported)
362 mtu size -- MTU size
363
364 conversion
365 hwaddress cleanup_hwaddress
366
367 up
368 [[FIXME: Add proper commands here for ipv6]]
369 [[Warning: Option media: %media% not yet supported]]
370 [[Warning: Option hwaddress: %hwaddress% not yet supported]]
371
372 down
373 [[FIXME: Add proper commands here for ipv6]]
374
375method manual
376 description
377 This method may be used to define interfaces for which no configuration
378 is done by default. Such interfaces can be configured manually by
379 means of *up* and *down* commands or /etc/network/if-*.d scripts.
380
381 up
382
383 down
384
385method dhcp
386 description
387 This method may be used to obtain network interface configuration via
388 stateful DHCPv6 with dhclient. In stateful DHCPv6, the DHCP server is
389 responsible for assigning addresses to clients.
390
391 options
392 hwaddress address -- Hardware address (Not yet supported)
393
394 conversion
395 hwaddress cleanup_hwaddress
396
397 up
398 [[Warning: Option hwaddress: %hwaddress% not yet supported]]
399 inetutils-ifconfig --interface %iface% --up
400 /sbin/dhclient -6 -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \
401 if (execable("/sbin/dhclient"))
402 echo 'No DHCPv6 client software found!' >&2; false \
403 elsif (1)
404
405 down
406 /sbin/dhclient -6 -r -pf /run/dhclient6.%iface///.%.pid -lf /var/lib/dhcp/dhclient6.%iface///.%.leases -I -df /var/lib/dhcp/dhclient.%iface///.%.leases %iface% \
407 if (execable("/sbin/dhclient"))
408 echo 'No DHCPv6 client software found!' >&2; false \
409 elsif (1)
410
411 inetutils-ifconfig --interface %iface% --down
412