2

How to add extra 5 ipv6 addresses to my xubuntu and register them with dyndns?

My xubuntu 14.10 have automatically configured ipv4 and ipv6 addresses:

sam@minisrv1:~$ ip -6 addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:470:**:***:94ef:b2f6:70bb:1674/64 scope global temporary dynamic
       valid_lft 600084sec preferred_lft 81084sec
    inet6 2001:470:**:***:222:4dff:fea1:389f/64 scope global mngtmpaddr dynamic
       valid_lft 4294096507sec preferred_lft 4294096507sec
    inet6 fe80::222:4dff:fea1:389f/64 scope link
   valid_lft forever preferred_lft forever

Perfect!!!

Now I want to add extra 5 ipv6 addresses and make them registered wiht dyndns. What is RIGHT way to do it?

I checked /etc/network/interfaces and /etc/NetworkManager/NetworkManager.conf config files, but them say nothing about eth0:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

and

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown] managed=false

The folder /etc/NetworkManager/system-connections/ is empty too.

Also I tryied GUI tools "Network Connections" and "Editing Wired Connection 1". But i don't know what to write to Prefix, Gateway and other fields. They all comes from router.

And finally, I have no idea where to put my dyndns update scripts

curl "http://dyn.dns.he.net/nic/update?hostname=***&password=***&myip=???" > /dev/null

Update:

I found temporrary solution, thanks to this

I created /etc/NetworkManager/dispatcher.d/74-sam-ipv6.sh file, with following content:

#!/bin/bash

IF=$1 STATUS=$2

if [ "$IF" == "eth0" ] then case "$2" in up) logger -s "74-sam-ipv6.sh eth0 up" ip -6 addr add 2001:470::::0/64 dev eth0 ip -6 addr add 2001:470::::1/64 dev eth0 ip -6 addr add 2001:470::::2/64 dev eth0 ip -6 addr add 2001:470::::3/64 dev eth0 ip -6 addr add 2001:470::::*4/64 dev eth0

    curl &quot;http://dyn.dns.he.net/nic/update?hostname=a.***my-domain***.ru&amp;password=***&amp;myip=2001:470:**:***::*0&quot; &gt; /dev/null
    curl &quot;http://dyn.dns.he.net/nic/update?hostname=b.***my-domain***.ru&amp;password=***&amp;myip=2001:470:**:***::*1&quot; &gt; /dev/null
    curl &quot;http://dyn.dns.he.net/nic/update?hostname=c.***my-domain***.ru&amp;password=***&amp;myip=2001:470:**:***::*3&quot; &gt; /dev/null
    curl &quot;http://dyn.dns.he.net/nic/update?hostname=d.***my-domain***.ru&amp;password=***&amp;myip=2001:470:**:***::*2&quot; &gt; /dev/null
    curl &quot;http://dyn.dns.he.net/nic/update?hostname=e.***my-domain***.ru&amp;password=***&amp;myip=2001:470:**:***::*4&quot; &gt; /dev/null
    echo ok

    ;;
    down)
    logger -s &quot;74-sam-ipv6.sh eth0 down&quot;
    ip -6 addr del 2001:470:**:***::*0/64 dev eth0
    ip -6 addr del 2001:470:**:***::*1/64 dev eth0
    ip -6 addr del 2001:470:**:***::*2/64 dev eth0
    ip -6 addr del 2001:470:**:***::*3/64 dev eth0
    ip -6 addr del 2001:470:**:***::*4/64 dev eth0
    echo ok

    ;;
    pre-up)
    logger -s &quot;74-sam-ipv6.sh&quot;
    ;;
    post-down)
    logger -s &quot;74-sam-ipv6.sh&quot;
    ;;
    *)
    logger -s &quot;74-sam-ipv6.sh ------unknown-commmand-------------------------------------&gt; $2&quot;
    ;;
esac

fi

1 Answers1

0

I would set up my adresses in /etc/network/interfaces as an auto IPv6 device and then just add some up and down settings. THat is because they are kind of static and the machine isn't likely to change IPv6 addresses.

I would add this to /e/n/interfaces:

auto eth0
iface eth0 inet6 auto
    up ip -6 addr add 2001:470:**:**::*0/64 dev eth0
    up ip -6 addr add 2001:470:**:**::*1/64 dev eth0
    up ip -6 addr add 2001:470:**:**::*2/64 dev eth0
    up ip -6 addr add 2001:470:**:**::*3/64 dev eth0
    up ip -6 addr add 2001:470:**:**::*4/64 dev eth0
    post-up curl "http://dyn.dns.he.net/nic/update?hostname=a.***my-domain***.ru&password=***&myip=2001:470:**:***::*0" || true
    post-up curl "http://dyn.dns.he.net/nic/update?hostname=b.***my-domain***.ru&password=***&myip=2001:470:**:***::*1" || true
    post-up curl "http://dyn.dns.he.net/nic/update?hostname=c.***my-domain***.ru&password=***&myip=2001:470:**:***::*3" || true
    post-up curl "http://dyn.dns.he.net/nic/update?hostname=d.***my-domain***.ru&password=***&myip=2001:470:**:***::*2" || true
    post-up curl "http://dyn.dns.he.net/nic/update?hostname=e.***my-domain***.ru&password=***&myip=2001:470:**:***::*4" || true
    down ip -6 addr del 2001:470:**:**::*4/64 dev eth0
    down ip -6 addr del 2001:470:**:**::*3/64 dev eth0
    down ip -6 addr del 2001:470:**:**::*2/64 dev eth0
    down ip -6 addr del 2001:470:**:**::*1/64 dev eth0
    down ip -6 addr del 2001:470:**:**::*0/64 dev eth0
# eof

See manual page for man 5 interfaces for more information.

I would also replace the IPv4 address 127.0.1.1 to my real IPv4 address on eth0. And I would copy that line and replace 127.0.1.1 address with my static IPv6 address. I might also add names for the other IPv6 addresses, which would be useful in configuration files.

Anders
  • 1,615