Howdy, Stranger!

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


question about online ipv6
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.

question about online ipv6

I use Online.net IPv6 Setup Script from LET.
https://www.ts4.net/online-net-ipv6-script/
Then /sbin/ifconfig eth0 inet6 add XXXXXXXXXXXXXXXXXXXXX,
I successfully config ipv6 with my server.

However, after some hours, ipv6 doesn't work.
I can't ping any ipv6 address from my server.

So, I reboot my server and do "/sbin/ifconfig eth0 inet6 add XXXXXXXXXXXXXXXXXXXXX" again.
after that, ipv6 works again.

Does anyone meet this?

Comments

  • It sounds as if your dhclient isn't running continuously to refresh the registration with the online's dhcp6, even though that script should set this up. I recall 'a few hours' being the time it takes for the registration to drop out.

    Although you statically assign the IPv6 addresses you still have to poll via dhcp6 to keep the routing alive, they have an odd way of doing things.

    What distro/version of Linux are you running ? that might help others offer advice.

    Thanked by 1suzizi
  • @cochon
    thanks.
    I use ubuntu 14.04 x64.

    How to check if dhclient works or not?
    or what can I do so that "you still have to poll via dhcp6 to keep the routing alive"

  • OK I'm not an ubuntu user but it's debian based so you should be able to use ps and see if there's a dhclient process running with a -6 parameter, there will probably be 2 dhclient(s), the other for IPv4.

    This pulls a simple configuration file (the -cf parameter) which contains the DUID you get assigned by online.net. If the dhclient is in fact running, double check the DUID is actually the one you've been assigned and typed correctly, and not an example one.

    Online expect to see polls for this DUID from the dhclient in order to keep the routing enabled for the subnet that the DUID relates to. The symptom you see seems to fit that not working.

    [user@host ~]$ ps -ef | grep dhclient
    root      2739     1  0 Sep21 ?        00:00:00 dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.eth0.pid -6 -P eth0
    
    [user@host ~]$ cat /etc/dhcp/dhclient6.conf
    interface "eth0" {
        send dhcp6.client-id 00:12:34:56:78:9a:bc:de:12:34;
        request;
    }
    
    Thanked by 1vimalware
  • suzizisuzizi Member
    edited September 2016

    @cochon thanks.
    It seems ok now, since ipv6 works now.(because I reboot it.)
    I will check a few hours later.

    root@sd-20876:~# ps -ef | grep dhclient

    root 585 1 0 15:57 ? 00:00:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0

    root 798 1 0 15:57 ? 00:00:00 dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.eth0.pid -6 -P eth0

    root 2720 1767 0 17:24 pts/0 00:00:00 grep --color=auto dhclient

    Do you use centos 6 or 7 ?
    Maybe I can try the same one with you.

  • I use debian 7 which should be the same as Ubuntu at this level, but of course Ubuntu may have its own spin on things which is actually causing the problem.

    It certainly looks like the dhclient is running for IPv6, so the problem is more likely that the DUID is mis-typed or the wrong one, there's a different one for each subnet you create. In the config it should be 10 bytes in hex separated by ':' ending in ';' like the example above.

    When I first set this up a long time ago I still had issues with the IPv6 randomly dropping out every week or so, so I put a crude fixit line in the /etc/crontab to check every 5 minutes and list/reload the interface if it couldn't ping6 google.

    */5 * * * * root ping6 -c 1 -q ipv6.google.com > /dev/null || (ifconfig eth0; ifdown eth0; ifup eth0; echo Internet IF reloaded)
    

    Just realised that still exists but hasn't triggered in many months, goes to show their IPv6 network must be stable. If you're desperate it's a crude fix in the short term rather than rebooting the whole box every time.

  • ... oh and rather than manually add the extra addresses on reboot/reload you can add them as up commands in /etc/network/interfaces

    iface eth0 inet6 static
        address 2001:1234:4321:100::1
        netmask 48
        accept_ra 1
        pre-up dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.eth0.pid -6 -P eth0
        pre-down dhclient -x -pf /run/dhclient6.eth0.pid
        up /sbin/ifconfig eth0 inet6 add 2001:1234:4321:100::2/48
        up /sbin/ifconfig eth0 inet6 add 2001:1234:4321:100::3/48
        up /sbin/ifconfig eth0 inet6 add 2001:1234:4321:100::4/48
    
  • @cochon
    I find this command doesn't work in crontab.
    (crontab is successful, but this command doesn't work. I don't see any echo output)

    */5 * * * * root ping6 -c 1 -q ipv6.google.com > /dev/null || (ifconfig eth0; ifdown eth0; ifup eth0; echo Internet IF reloaded)

    Does it need any environment variable?

    And I try this one:

    */5 * * * * root ping6 -c 1 -q ipv6.google.com > /dev/null || (/sbin/reboot)

    However, it reboot every 5 minutes whether ping6 is successful or not.

    Would you tell me why?

  • cochoncochon Member
    edited October 2016

    It's a pretty basic command, nothing after the 'or' || should get executed if the ping6 is successful. I've just tried it on an Ubuntu 16.04 system I have access to and it works without needing any extra environment variables, but in your case it probably can't find the ping6 command, try finding and using the full path instead, /bin/ping6 on Ubuntu 16.04.

    Running a full reboot with this command on a 5 minute interval is probably not wise, you might run into a race condition depending on how complex/long your boot is.

    Assuming you do get output from crontab mailed to you and not the default root mailbox (if not add a MAILTO= in the crontab file), try the following, it just runs the ping6 without throwing the output away and then echos the exit code which should be 0 for success. It should always send an email every 5 minutes as there will always be output. The output from this should give you a better idea.

    [email protected] */5 * * * * root ping6 -c 1 -q ipv6.google.com; echo $?

  • I use dibbler-client on CentOS 6.8 and IPv6 works perfectly without stops.

  • @cochon
    thanks, I understand the meaning of "||" and I use debian 7 now as you.

    1. if I type "ping6 -c 1 -q ipv6.google.com > /dev/null || (ifconfig eth0; ifdown eth0; ifup eth0; echo Internet IF reloaded" in sh file and then ./XXX.sh, this command works.

    But it doesn't work if I crontab -e:

    */5 * * * * root ping6 -c 1 -q ipv6.google.com > /dev/null || (ifconfig eth0; ifdown eth0; ifup eth0; echo Internet IF reloaded)

    I don't know why...

    2.I don't want to reboot my server every 5 minutes.
    But this command "*/5 * * * * root ping6 -c 1 -q ipv6.google.com > /dev/null || (/sbin/reboot)" do that even if my server has ipv6 fine....

    and "*/5 * * * * root /bin/ping6 -c 1 -q ipv6.google.com > /dev/null || (/sbin/reboot)" has the same result.

    I don't know why it reboot when my ipv6 works fine.

  • Ah, 'crontab -e', that's the problem, the syntax for this file is different, it doesn't use the username (root in this example).

    As it's a system procedure I would always put this in /etc/crontab, including the username. Using user specific crontabs for this is a recipe for confusion.

    The problem will certainly be that the user crontab is trying to run 'root /bin/ping6' which will fail, but an entry in /etc/crontab will run 'as user root' 'ping6'. If you want to continue with the crontab -e, try taking the username root out of the examples.

    Sorry I should have been clear, but this is the conventional way of doing things. See:

    man /etc/crontab

  • sinsin Member
    edited October 2016

    Here's how I have IPv6 working on my Online.net boxes with Ubuntu 16.04 and using a /56
    (and replace every instance of eno1 with whatever the name of your network interface is)

    create /etc/dhcp/dhclient6.conf

        interface "eno1" {
            send dhcp6.client-id yourduidgoeshere;
        }
    

    then create

    /etc/systemd/system/ipv6.service

    [Unit]
    Description=IPv6 for Online.net Dedibox Limited via dhclient
    After=network.target
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/sbin/dhclient -cf /etc/dhcp/dhclient6.conf -pf /run/dhclient6.eno1.pid -6 -P eno1
    ExecStart=/sbin/ip addr add youripv6goeshere/56 dev eno1
    ExecStop=/sbin/ip addr del youripv6goeshere/56 dev eno1
    ExecStop=/sbin/dhclient -x -pf /run/dhclient6.eno1.pid
    
    [Install]
    WantedBy=multi-user.target
    

    then:

    systemctl enable ipv6.service

    and reboot.

    Doing it that way on Ubuntu 16.04 with my SC 2016 and my Limited solved any issue I had with the connection dropping. Sometimes on boot the ipv6 can't be assigned but as soon as the machine finishes booting you can just use systemctl restart ipv6 or systemctl start ipv6 and the connection will come up.

    Thanked by 1cochon
  • @cochon I understand. thank you.

    You help me so much. I want to pay you for your time.

    Do you have paypal donate? or I can give you one kimsufi ks3c server for one month.

  • Hello @Sin, do you also have it for centos 7 ?

  • suzizi said: You help me so much. I want to pay you for your time

    Thanks, but it's really not necessary, you're most welcome. At the end of the day we actually got sidetracked on a quick 'workaround' cludge that I passed on from when there were issues with online.net's DHCP.

    My configuration (under Debian 7) is exactly what the script you used at the start of this thread does and for me it works correctly now and hasn't lost the IPv6 routing in a long time.

    The real question still remains as to why your DHCP client is not maintaining the registration, and I'm afraid I cannot help with that as I don't run Ubuntu on any online.net box, just base Debian. You should try @sin's method, as it works, it sets up the IPV6 configuration in a different way from the setup script you ran, but the important dhclient bit is basically the same, which is what is puzzling.

    Thanked by 1sin
  • sinsin Member

    cochon said: as it works, it sets up the IPV6 configuration in a different way from the setup script you ran, but the important dhclient bit is basically the same, which is what is puzzling.

    Hah yeah it is puzzling to me :) When I moved from Ubuntu 14.04 to 16.04 I had all kinds of issues getting ipv6 working correctly with Online.net. I tried all kinds of ways and thought I had gotten it working perfectly until I noticed I would lose ipv6 connection after awhile...so that's when I tried that systemd service file that I posted and for some reason that has worked flawlessly for me with Online.net and IPv6.

Sign In or Register to comment.