Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Routed IPv6 /64 loads manually, not at boot
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Routed IPv6 /64 loads manually, not at boot

jemaltzjemaltz Member

Hi All,

I'm having a strange problem getting a routed /64 to load on boot. This is a dedicated server running Ubuntu 12.04.

If I manually issue e.g.:

ip -6 addr add xxxx:yyyy:zzzz:aaaa::2/64 dev eth0 ip -6 route add default via xxxx:yyyy:zzzz:aaaa::1 dev eth0

Then everything works, I can ping6 and all. However, if I try to add this into /etc/network/interfaces, for example:

iface eth0 inet6 static address xxxx:yyyy:zzzz:aaaa::2 netmask 64 gateway xxxx:yyyy:zzzz:aaaa::1

Then it seems to silently fail - on reboot, ifconfig shows a private IPv6, and there's nothing helpful in syslog.

I've tried to have the ip commands run when the interface is brought up, through /etc/network/interfaces:

iface eth0 inet6 static address xxxx:yyyy:zzzz:aaaa::2 netmask 64 gateway xxxx:yyyy:zzzz:aaaa::1 post-up /sbin/ip -6 addr add xxxx:yyyy:zzzz:aaaa::2/64 dev eth0 post-up /sbin/ip -6 route add default via xxxx:yyyy:zzzz:aaaa::1 dev eth0 pre-down /sbin/ip -6 route del default via xxxx:yyyy:zzzz:aaaa::1 dev eth0 pre-down /sbin/ip -6 addr del xxxx:yyyy:zzzz:aaaa::2/64 dev eth0

But this doesn't work, either. Running the exact same post-up commands does bring up the network, though! (I've tried up as well, with no change.)

Any ideas?

Thanks!

Comments

  • Is it because ipv6 module is not loaded at the time it attempts to configure the interface?

  • @MarkTurner said:
    Is it because ipv6 module is not loaded at the time it attempts to configure the interface?

    Nope, it's compiled in the kernel (as far as I can tell):

    $lsmod |grep ip $

  • How is your ipv4 address configured? Static or via dhcp?

  • rm_rm_ IPv6 Advocate, Veteran

    Probably some ubuntu b/s with NetworkManager or weird kernel settings/defaults...

    Btw did you not forget "auto eth0" in the interfaces file?

    Also what happens if you try "ifup eth0"?

  • rds100 said: How is your ipv4 address configured? Static or via dhcp?

    Static.

    rm_ said: Btw did you not forget "auto eth0" in the interfaces file?

    "auto eth0" is there.

    rm_ said: Also what happens if you try "ifup eth0"?

    $ sudo ifup eth0 ifup: interface eth0 already configured

    (Not terribly surprising - I'm connected via SSH! But, no, the IPv6 address doesn't get assigned when running ifup.)

  • MaouniqueMaounique Host Rep, Veteran
    edited March 2015

    rm_ said: Also what happens if you try "ifup eth0"?

    Yeah, this weird stuff is happening in debian also, once in a while. Doing ifdown and then ifup at boot (or only ifup if you did not put auto) solves it completely so I did not look into details. It is really rare and my setups almost standard, so I presume it is something related to the underlying virtualization stack/bridging/routing/dhcp/vlan config.

  • Maounique said: Doing ifdown and then ifup at boot solves it

    Interesting...I just added ifdown eth0 && ifup eth0 to rc.local, let's see...

  • rm_rm_ IPv6 Advocate, Veteran
    edited March 2015

    Really no need for && there. If for some reason if even partially fails in bringing it down, it won't bother trying to restore it back up.

    Also this is not the solution anyway, a crappy workaround at best. And no need to add that to rc.local, you can just try the same two commands on one line in ssh.

  • If you sift through dmesg or the system boot logs is there anything in there which shows a failure?

    I don't use Ubuntu but why are you post-up adding the interface and route, this should be done automatically by the IPv6 configuration surely?

  • jemaltzjemaltz Member
    edited March 2015

    @jemaltz said:
    Interesting...I just added ifdown eth0 && ifup eth0 to rc.local, let's see...

    Nevermind, I just remembered that that will likely kill the system (the storage is an iSCSI target).

    Edit: Yup. Any other ideas?

  • rm_rm_ IPv6 Advocate, Veteran
    edited March 2015

    jemaltz said: the storage is an iSCSI target

    Yeah such unimportant detail to skip... Your eth0 is configured long before /etc/network/interfaces, I suppose by initrd.

    Couldn't you just add these to rc.local?

    ip -6 addr add xxxx:yyyy:zzzz:aaaa::2/64 dev eth0
    ip -6 route add default via xxxx:yyyy:zzzz:aaaa::1 dev eth0
  • MarkTurnerMarkTurner Member
    edited March 2015

    @jemaltz - Delimiter Atom?

    What about just adding:

    ip -6 addr add xxxx:yyyy:zzzz:aaaa::2/64 dev eth0

    ip -6 route add default via xxxx:yyyy:zzzz:aaaa::1 dev eth0

    to /etc/rc.local :)

  • MaouniqueMaounique Host Rep, Veteran

    Hum, you are using the storage and network through the same interface? You may wish to add IPv6 to an alias only.

  • rm_rm_ IPv6 Advocate, Veteran
    edited March 2015

    Maounique said: to an alias only.

    to WHAT?... Aliases were deprecated back in kernel 2.4, there is really no reason to use them whatsoever.

    Thanked by 1Maounique
  • rm_ said: Yeah such unimportant detail to skip

    Oops. I'm not well-versed in the iSCSI world.

    rm_ said: Couldn't you just add these to rc.local?

    At first, I wanted to avoid that, because it doesn't account for the interface going down/up...but since the server runs off an iSCSI target, I guess we don't need to worry about that (since the system will hang if the interface goes down)

    MarkTurner said: @jemaltz - Delimiter Atom?

    Yup, and both rescue images are unavailable:
    Error downloading: /isolinux/rescue32 (same for the 64-bit image)

    Do you mind pinging the Delimiter folks? If not, I'll open a ticket, but response times have not been wonderful...

    Maounique said: Hum, you are using the storage and network through the same interface? You may wish to add IPv6 to an alias only.

    Interesting, will look into this. Is there any advantage to adding it to an alias instead of running the ip commands at startup?

  • @jemaltz - Open a ticket with them then PM me the ticket #.

  • MaouniqueMaounique Host Rep, Veteran
    edited March 2015

    @rm_ is right, it does not work with ipv6, I was thinking to a way to be able to down the ipv6 only "interface" without killing the storage. Brainfart, past my bedtime.

    jemaltz said: nteresting, will look into this. Is there any advantage to adding it to an alias instead of running the ip commands at startup?

  • Ha! I was able to overwrite rc.local (to remove the system-crashing ifdown) via ssh on my second attempt!

    Now, back to messing with IPv6...

  • ..And to close the loop on this topic, putting the ip commands into rc.local does the trick - the IPv6 address is now assigned on boot. It's not ideal (these things should probably be tied to device statuses), but it works.

  • jemaltz said: these things should probably be tied to device statuses

    In principle yes, but as the server only has one interface, it doesn't really matter; and there are no IGP running so no false availability will be passed. Secondly as the box is ISCSI based, the assumption if you have got that far, then the interface is up :)

Sign In or Register to comment.