Howdy, Stranger!

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


IPv6 dhclient auto-configuration script (Online.net)
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.

IPv6 dhclient auto-configuration script (Online.net)

NyrNyr Community Contributor, Veteran
edited January 2015 in Providers

A friend created this and I think it's pretty handy and clean for those of us with multiple servers at Online:


ipv6-dhclient-script

Simple IPv6 configuration script for Debian (Ubuntu...) and RedHat (CentOS, Fedora...) based distros, mainly for Online.net servers but valid for any network that provides IPv6 access through prefix delegation i.e. the static address is configured by the client and an identifier (DUID) is sent to the DHCP server in order to get functional routes.

Servers provided by Online.net won't come with IPv6 enabled by default so this makes things a bit easier specially when owning multiple servers and IPv6 needs to be enabled by hand in each one.

The script has been successfully tested under:

  • Ubuntu Server 14.04
  • Debian 7.0
  • CentOS 7.0

Just run the script and follow the instructions:

$ bash ipv6-dhclient-script.sh

You can also pass parameters straight away:

$ bash ipv6-dhclient-script.sh <interface> <address block> <subnet> <duid>


https://github.com/outime/ipv6-dhclient-script

«1

Comments

  • I love you.

  • @0xdragon said:
    I love you.

    Thanked by 1gestiondbi
  • Can anyone test with RHEL 6?

  • Does this work with the 2EUR "Dedibox kidéchire" ?

    I can't figure out how to get an address block.

  • ShadeShade Member
    edited January 2015

    @nunim said:
    Does this work with the 2EUR "Dedibox kidéchire" ?

    I can't figure out how to get an address block.

    Yes

  • NyrNyr Community Contributor, Veteran

    @nunim said:
    I can't figure out how to get an address block.

    You can request it from the console.

  • Do you actually get the whole /48 or just one IP address?

  • black said: Do you actually get the whole /48 or just one IP address?

    The entire /48 can be used if you wish. It can be broken into /56 and /64 allocations too though for use across multiple servers.

  • blackblack Member
    edited January 2015

    @kcaj said:
    The entire /48 can be used if you wish. It can be broken into /56 and /64 allocations too though for use across multiple servers.

    If you try to add more IPs one by one, by doing something like

     /sbin/ifconfig eth0 inet6 add IPV6IPHERE

    They'll turn off your server after the ~6000th request for packet flood.

  • black said: They'll turn off your server after the ~6000th request for packet flood.

    I see, but there is no restriction on what can be used in the /48 etc.

  • @black said:
    They'll turn off your server after the ~6000th request for packet flood.

    What if you rate limit it?

  • 0xdragon said: What if you rate limit it?

    When I tested it I waited for 0.4s per request.

  • Script author here, couldn't share by myself since LET sign up was broken (not anymore) so thanks to Nyr.

    Recently one guy reported that it kind of worked with Proxmox and OVZ, check this issue out for instructions: https://github.com/outime/ipv6-dhclient-script/issues/1

    Thanked by 1souvarine
  • bash ipv6-dhclient-script.sh <interface> <address block> <subnet> <duid>                                    
    

    duid ?!

    what is the that? will you give us example plz

  • 0xdragon said: I love you.

    Thanked by 2ehab muratai
  • @soda said:

    duid ?!

    what is the that? will you give us example plz

    After requesting your IPv6 block under Server->Network configuration, you should find your block and the associated DUID in there. It's recommended that you subnet the main /48 into different /56 for each server. Note that every /56 will have a different DUID.

    Thanked by 1soda
  • nunimnunim Member

    Thanks for the script, worked great for me. I'd suggest having the script assign at least a single IPv6 address by default.

    I wrote a short blog post on the script with an example for people who aren't sure what information to enter:

    https://www.sonicboxes.com/online-net-ipv6-script/

    Thanked by 2shivoham outime
  • DeanDean Member

    Your DUID is your password for assigning IPv6 to your server; i'd black it out if I were you :)

  • @nunim besides what the guy above me says, you have this in your instructions:

    wget www.sonicboxes.com/scripts/ipv6_dhclient_online_net.sh chmod 755 deluge_webui.sh ./ipv6_dhclient_online_net.sh <interface> <address block> <subnet> <duid>

    I recommend the following:

    Thanks for the post!

  • I caused a dhcp flood the last time I tried configuring ipv6 with dhclient on my dedibox. is this script likely to cause dhcp flood? shall I filter out egress in any way? I'm wary of annoying online.net staff again.

  • @souvarine said:
    I caused a dhcp flood the last time I tried configuring ipv6 with dhclient on my dedibox. is this script likely to cause dhcp flood? shall I filter out egress in any way? I'm wary of annoying online.net staff again.

    I missed this post, sorry. IIRC it'd only cause flooding if for example your DUID is incorrect since it'll keep trying.

    Thanked by 1souvarine
  • rm_rm_ IPv6 Advocate, Veteran
    edited August 2015

    souvarine said: shall I filter out egress in any way?

    Not sure about dhclient, but the WIDE DHCPv6 client sometimes goes crazy on its own: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765453
    So yes in any case filtering would not hurt. With WIDE I now use:

    ip6tables -A OUTPUT -p udp --dport 547 -m limit --limit 10/min  --limit-burst 5 -j ACCEPT
    ip6tables -A OUTPUT -p udp --dport 547 -j DROP
    Thanked by 2howardsl2 souvarine
  • Someone complained about the default interface being incorrect when using CentOS. Since the interface name was hardcoded, it's true that it might not fit in some setups. I've updated the script to offer a more suitable default interface if none is specified in the arguments.

    Just posting this in case someone else had this issue.

  • ipv6-dhclient-script.sh: line 4: syntax error near unexpected token newline' ipv6-dhclient-script.sh: line 4:<!DOCTYPE html>'

  • Hello, if someone can help.

    I have kidechire and I'm trying to configure ipv6. I'm running Ubuntu 15.10 x64

    I tried with their support page
    https://documentation.online.net/en/serveur-dedie/reseau/ipv6-prefix

    I get
    Client Critical Fatal error during CfgMgr initialization.

    I tried with
    https://version6.ru/en/online.net-wide-dhcpv6

    When starting it exists with error 1.

    I tried with
    https://github.com/outime/ipv6-dhclient-script

    I got error eth0 is not found.

    Tried even this
    https://tech.tiq.cc/2015/10/how-to-enable-ipv6-on-online-net-servers-using-dhclient-on-ubuntu-14-04/

    same error eth0 not found.

    Can anyone give me advice how to add ipv6 to existing or new interface?

    There are 2 interfaces, enp2s0 and enp3s0, but I don't know what is enp3s0.

    Ifconfig output

    enp2s0 Link encap:Ethernet HWaddr c8:0a:a9:xx:xx:xx
    inet addr:195.154.xx.xx Bcast:195.154.xx.xx Mask:255.255.255.0
    inet6 addr: fe80::ca0a:a9ff:fef1:a6d9/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:550360 errors:0 dropped:0 overruns:0 frame:0
    TX packets:730668 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:118344582 (118.3 MB) TX bytes:1009066158 (1.0 GB)
    Interrupt:30 Memory:feae0000-feb00000

    Anybody have an idea how to fix it?

  • Thanks for the script! I used to use the dibbler client.

    Had to run it twice for it to work, on first run I got failed for some reason (after second time I had duplicates in the config).

    Also I managed to kill connectivity for a sec cause I am dumb \o/

    Thanked by 1outime
  • @nunim said:
    I wrote a short blog post on the script with an example for people who aren't sure what information to enter:

    It may not have been your intention but it's not nice to steal someone else's script. It's available and probably maintained at the location in the first post.

    Thanked by 1outime
  • I'm still having "fun" with IPv6. Dedi is kidechire, distro is Ubuntu 15.10 x64.

    I'm running ipv6-dhclient-script
    https://github.com/outime/ipv6-dhclient-script

    This is my ipv6 network info

    This is output of script.

    WARNING: Network will restart at the end of this script so any existing connections will be dropped!
    Interface where IPv6 will be enabled: enp3s0
    You have the following IPv6 addreses configured for enp3s0:
    
    Continue? [Y/n]: Y
    Your IPv6 block address (e.g. 2001:bb8:3e23:200::): 2001:xxxx:xxx1::
    Subnet for your block (e.g. if it's /56, input 56): 48
    Associated DUID (e.g. 00:03:00:00:34:b0:0c:47:4a:0e): 00:03:00:01:56:7a:xx:xx:xx:xx
    Working...
    net.ipv6.conf.enp3s0.autoconf = 0
    ifdown: interface enp3s0 not configured
    Failed to bring up enp3s0.
    Testing IPv6 connectivity...
    connect: Network is unreachable
    Something went wrong :(
    

    This is what ifconfig enp3s0 returns

    enp3s0    Link encap:Ethernet  HWaddr c8:0a:a9:f1:xx:xx
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:34 Memory:febe0000-fec00000
    

    Any help will be appreciated.

  • heyzzxheyzzx Member
    edited January 2016

    wget www.sonicboxes.com/scripts/ipv6_dhclient_online_net.sh

    chmod 755 ipv6_dhclient_online_net.sh

    bash ipv6_dhclient_online_net.sh interface address block subnet duid

    example:

    bash ipv6-dhclient-script.sh eth0 2001:0bc7:5555:101:: 64 00:04:01:07:c7:b8:2f:13:d5:a8

    test:

    ping6 ipv6.google.com

    centos7.2 of Online.net is running perfect.

    Add to my hw7.net , thanks to the original author

    Thanked by 1outime
  • Can we uninstall this script without reinstalling the entire OS?

    I had to reformat my kide a couple of times due to networking and again, last time I assigned my entire /48 to the kide.

    outime said: Script author here, couldn't share by myself since LET sign up was broken (not anymore) so thanks to Nyr.

    Recently one guy reported that it kind of worked with Proxmox and OVZ, check this issue out for instructions: https://github.com/outime/ipv6-dhclient-script/issues/1

Sign In or Register to comment.