Second ipv6 address is not added

Kernels & Hardware, configuring network, installing services

Second ipv6 address is not added

Postby phate » 2018-10-13 16:44

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
phate
 
Posts: 3
Joined: 2018-10-13 16:38

Re: Second ipv6 address is not added

Postby p.H » 2018-10-13 19:05

It may not be related, but setting multiple default routes (gateway) makes no sense.
p.H
 
Posts: 631
Joined: 2017-09-17 07:12

Re: Second ipv6 address is not added

Postby phate » 2018-10-15 11:14

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.
phate
 
Posts: 3
Joined: 2018-10-13 16:38

Re: Second ipv6 address is not added

Postby p.H » 2018-10-15 12:51

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.
p.H
 
Posts: 631
Joined: 2017-09-17 07:12

Re: Second ipv6 address is not added

Postby phate » 2018-10-16 16:18

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.
phate
 
Posts: 3
Joined: 2018-10-13 16:38

Re: Second ipv6 address is not added

Postby bw123 » 2018-10-16 16:44

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?
User avatar
bw123
 
Posts: 3532
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Second ipv6 address is not added

Postby p.H » 2018-10-20 10:38

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
 
Posts: 631
Joined: 2017-09-17 07:12

Re: Second ipv6 address is not added

Postby p.H » 2018-10-20 10:40

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 ?
p.H
 
Posts: 631
Joined: 2017-09-17 07:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable