Debian up in /etc/network/interfaces not working
Not a direct answer to why up
doesn't work, but maybe a solution for your problem:
I usually use the same configuration style for multiple IPv4 and IPv6 addresses for consistency. This is the configuration of one of my servers:
auto eth0
iface eth0 inet static
address 94.142.242.211
netmask 28
gateway 94.142.242.209
iface eth0 inet6 static
address 2a02:898:148::211
netmask 64
gateway 2a02:898:148::1
auto eth0:0
iface eth0:0 inet static
address 94.142.242.212
netmask 28
iface eth0:0 inet6 static
address 2a02:898:148::212
netmask 64
auto eth0:1
iface eth0:1 inet static
address 94.142.242.217
netmask 28
iface eth0:1 inet6 static
address 2a02:898:148::217
netmask 64
The IPv6 addresses show up on eth0
not on eth0:0
and eth0:1
when seen through ifconfig
:
eth0 Link encap:Ethernet HWaddr 00:50:56:80:96:82
inet addr:94.142.242.211 Bcast:94.142.242.223 Mask:255.255.255.240
inet6 addr: 2a02:898:148::217/64 Scope:Global
inet6 addr: 2a02:898:148::212/64 Scope:Global
inet6 addr: 2a02:898:148::211/64 Scope:Global
inet6 addr: fe80::250:56ff:fe80:9682/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:0 Link encap:Ethernet HWaddr 00:50:56:80:96:82
inet addr:94.142.242.212 Bcast:94.142.242.223 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:1 Link encap:Ethernet HWaddr 00:50:56:80:96:82
inet addr:94.142.242.217 Bcast:94.142.242.223 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
I don't know why your configuration doesn't work, but maybe doing it this way will work for you...
Related videos on Youtube
![Louis Matthijssen](https://i.stack.imgur.com/PvaOl.png?s=256&g=1)
Louis Matthijssen
I like almost anything that has something to do with technology. Especially installing, configuring and maintaining PCs & servers. I also like programming and cookies.
Updated on September 18, 2022Comments
-
Louis Matthijssen almost 2 years
I'm trying to add a secondary IPv6 address to
eth0
on Debian Sid.I added the following lines to
/etc/network/interfaces
:iface eth0 inet6 static address [IPv6 address #1] netmask 64 gateway [IPv6 gateway] pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/autoconf up /sbin/ifconfig eth0 inet6 add [IPv6 address #2]/64
After a reboot there is only one IPv6 address assigned to
eth0
. However, if I simply execute the command (/sbin/ifconfig eth0 inet6 add [IPv6 address #2]/64
) manually, I have 2 IPv6 addresses assigned toeth0
, just like I want.It looks like the
up
command is just not executed at all. Has this been changed? I do have a/etc/network/if-up.d
directory, but I read that those scripts may be run more than once.How can I make
up
work or add a second IPv6 address on Debian Sid?-
kasperd almost 10 yearsTry putting a
touch
command in the file instead of theifconfig
command, that way you can verify if the command gets executed at all. Also verify if it makes a difference whether DAD is enabled or disabled. -
Louis Matthijssen almost 10 yearsThanks, I changed it to
up touch /root/ipv6test
but the file doesn't exist after a reboot. -
kasperd almost 10 yearsDoes
up
work if you put in aninet
stanza rather than aninet6
stanza? -
kasperd almost 10 yearsAccording to the documentation I am looking at
up
andpost-up
are synonyms. May still be worth testing if using one or the other makes a difference.
-
-
Louis Matthijssen almost 10 yearsThanks, it seems to work but then I can't ping anything. Example (ping6 google.com):
11 packets transmitted, 0 received, 100% packet loss, time 10080ms
. Removing the lines makes it work again. -
Sander Steffann almost 10 yearsThe Linux kernel usually chooses the last added IPv6 address as its default source address. For IPv4 it will use the address on
eth0
and not those oneth0:*
. So in the config above it would probably use94.142.242.211
and2a02:898:148::217
by default. Maybe your firewall settings need to be adjusted for that. -
Sander Steffann almost 10 yearsPS: The default source address can be overridden manually by executing i.e.
/sbin/ip -6 route add default via 2a02:898:148::1 src 2a02:898:148::211 metric 1
. -
Louis Matthijssen almost 10 yearsIf I add the address manually I can ping using both IP addresses (
ping6 -I [IPv6 address #1] google.com
andping6 -I [IPv6 address #2] google.com
both work). So I guess it's not a firewall issue? I've never had this problem before. -
Sander Steffann almost 10 yearsThat is weird indeed... No idea how that can happen. Can you show the output of
ip -6 addr
andip -6 route
after adding the lines in/etc/network/interfaces
? -
Louis Matthijssen almost 10 yearsOkay I just saw that IPv6 sometimes just stops working. This answer is working for me! I'll contact my ISP about the weird IPv6 availability.
-
Sander Steffann almost 10 yearsFeel free to contact me off-list to tell me which ISP it is, I know many of them so maybe I can help :)