@@ -69,7 +69,8 @@ stop_network()
6969 for _iface in $_ifaces ; do
7070 if [ " ${_iface} " != ' lo' ] ; then
7171 /sbin/ifdown " ${_iface} "
72- /sbin/ip addr flush dev " ${_iface} "
72+ /sbin/ip link set dev " ${_iface} " down || true
73+ /sbin/ip addr flush dev " ${_iface} " || true
7374 fi
7475 done
7576 ;;
@@ -181,6 +182,8 @@ gen_dhcp_conf()
181182 ;;
182183 esac
183184 fi
185+
186+ echo " "
184187}
185188
186189gen_alias_conf ()
250253 esac
251254 fi
252255
256+ echo " "
257+
253258 if [ -n " ${ip6_ula} " ]; then
254259 cat << EOT
255-
256260iface ${dev} inet6 static
257261 address ${ip6_ula}
258262 netmask 64
@@ -279,8 +283,15 @@ gen_dhcp6_conf()
279283 echo " pre-up echo 0 > /proc/sys/net/ipv6/conf/${dev} /use_tempaddr"
280284 ;;
281285 debian|ubuntu|devuan)
282- echo " privext 0" # this might not be effective in "dhcp" mode
286+ # Privext might not be effective in "dhcp" mode, so we better
287+ # directly configure also sysctl parameters. Also, there might
288+ # be a race condition between activating IPv4 and IPv6 part of
289+ # interface if IPv4 is dhcp. As a aresult, IPv6 SLAAC privacy
290+ # address might appear. So, for safety we better drop any global
291+ # IPv6 addresses as part of pre-up.
292+ echo " privext 0"
283293 echo " pre-up echo 0 > /proc/sys/net/ipv6/conf/${dev} /use_tempaddr"
294+ echo " pre-up ip -6 addr flush dev ${dev} scope global || /bin/true"
284295
285296 if [ -n " ${mtu} " ]; then
286297 # Ignores "mtu x", IPv6-only interfaces would not be configured
@@ -292,6 +303,8 @@ gen_dhcp6_conf()
292303 exit 1
293304 ;;
294305 esac
306+
307+ echo " "
295308}
296309
297310gen_alias6_conf ()
313326 ;;
314327 esac
315328
329+ echo " "
330+
316331 if [ -n " ${ip6_ula} " ]; then
317332 cat << EOT
318333
0 commit comments