Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Second ipv6 address is not added

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
phate
Posts: 3
Joined: 2018-10-13 16:38

Second ipv6 address is not added

#1 Post by phate »

Hello,

I have the following /etc/network/interfaces on a Debian Stretch installation:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet static
  address aa.bb.cc.dd
  netmask 255.255.255.255
  gateway ee.ff.gg.hh
  pointopoint ee.ff.gg.hh

iface ens3 inet6 static
  address 2a01:4f8:xxxx:yyyy::24:2
  netmask 112
  gateway 2a01:4f8:xxxx:yyyy::24:1

allow-hotplug ens8
iface ens8 inet static
  address aa.bb.cc.dd
  netmask 255.255.255.255
  gateway ee.ff.gg.hh
  pointopoint ee.ff.gg.hh

iface ens8 inet6 static
  address 2a01:4f8:xxxx:yyyy::25:2
  netmask 112
  gateway 2a01:4f8:xxxx:yyyy::25:1
For whatever reason Debian seems to only assign one of those ipv6 addresses to whichever interface comes up first. There is no error that I can find in syslog or dmesg that does give me a hint while this does not work. If I assign the missing ip address later on with ip -6 addr add everything is working fine. But during boot only one interface gets an address.

Is there something wrong with my config that I am overseeing?

BR
Phate

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Second ipv6 address is not added

#2 Post by p.H »

It may not be related, but setting multiple default routes (gateway) makes no sense.

phate
Posts: 3
Joined: 2018-10-13 16:38

Re: Second ipv6 address is not added

#3 Post by phate »

That is right. A second default gateway does not make entirely sense. But how else can I tell the system the next hop in the route on that interface? But by the way the gateway is added on startup. If I add the ip address manually the default route is already there. Just the IP is not assigned to the interface.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Second ipv6 address is not added

#4 Post by p.H »

phate wrote:A second default gateway does not make entirely sense.
A second default gateway (actually default route) does not make any sense at all if both interfaces are active at the same time.
"Default" is like the "default" keyword in a C language "switch () case" construction. There must be only one "default" for all interfaces.
phate wrote:But how else can I tell the system the next hop in the route on that interface?
If there is no default route on that interface, there is no need for a next hop.

In some cases, trying to create a default route when one already exists returns and error, and may prevent ifup finishing configuring the interface properly.

phate
Posts: 3
Joined: 2018-10-13 16:38

Re: Second ipv6 address is not added

#5 Post by phate »

Well, I tested it without adding a gateway to the second interface. The interface still does not get any IPv6 address besides the link local one.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Second ipv6 address is not added

#6 Post by bw123 »

address 2a01:4f8:xxxx:yyyy::24:2
gateway 2a01:4f8:xxxx:yyyy::24:1
I don't use ipv6 but the man page for interfaces shows static addressing like this:

Code: Select all

iface eth1 inet6 static
            address fec0:0:0:1::2/64
            gateway fec0:0:0:1::1
have you tried ifup with --verbose and see if you get a clue?
resigned by AI ChatGPT

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Second ipv6 address is not added

#7 Post by p.H »

bw123 wrote:I don't use ipv6 but the man page for interfaces shows static addressing like this
The /<length> notation in the address option is equivalent to the netmask option.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Second ipv6 address is not added

#8 Post by p.H »

phate wrote:Well, I tested it without adding a gateway to the second interface. The interface still does not get any IPv6 address besides the link local one.
Did you also remove the extra gateway options in inet (IPv4) stanzas ?

Post Reply