Debian Wheezy IPv6 isn't configured with ifup post-up hook
Posted
by
aef
on Server Fault
See other posts from Server Fault
or by aef
Published on 2012-11-03T12:19:59Z
Indexed on
2012/11/04
11:05 UTC
Read the original article
Hit count: 244
We recently set up a server on Debian Wheezy Beta 3 (x86_64) which has a native IPv6 connection.
We configured the eth0 interface to get the IPv6 configuration through some post-up hook commands in /etc/network/interfaces
. The result is, that after the booting the system up, there is only IPv4 and an auto-configured link-local IPv6 address configured on the interface, as if the command has never been executed.
When we additionally place the commands after the call to ifup -a
inside the /etc/init.d/networking
init script, everything works as expected and we have a fully configured interface after booting up.
This is quite an ugly way to configure the interface. What are we doing wrong with the ifup post-up hooks? Or is this a bug?
The section from /etc/network/interfaces
looks like this (IP-addresses changed):
allow-hotplug eth0
iface eth0 inet static
address 1.2.3.1
netmask 255.255.255.192
network 1.2.3.0
broadcast 1.2.3.63
gateway 1.2.3.62
dns-nameservers 8.8.8.8
dns-search mydomain.tld
post-up ip -6 addr add 2001:db8:100:3022::2 dev eth0
post-up ip -6 route add fe80::1 dev eth0
post-up ip -6 route add default via fe80::1 dev eth0
I also tried it in this alternative way:
auto eth0
iface eth0 inet static
address 1.2.3.1
netmask 255.255.255.192
network 1.2.3.0
broadcast 1.2.3.63
gateway 1.2.3.62
dns-nameservers 8.8.8.8
dns-search mydomain.tld
iface eth0 inet6 static
address 2001:db8:100:3022::2
netmask 64
gateway fe80::1
What we added to /etc/init.d/networking
:
…
case "$1" in
start)
process_options
check_ifstate
if [ "$CONFIGURE_INTERFACES" = no ]
then
log_action_msg "Not configuring network interfaces, see /etc/default/networking"
exit 0
fi
set -f
exclusions=$(process_exclusions)
log_action_begin_msg "Configuring network interfaces"
if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
# Our additions
ip -6 addr add 2001:db8:100:3022::2 dev eth0
ip -6 route add fe80::1 dev eth0
ip -6 route add default via fe80::1 dev eth0
then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
…
© Server Fault or respective owner