You are not logged in.

#1 2019-02-20 11:56:04

megamind6155
Member
Registered: 2019-01-16
Posts: 37

How to set a static suffix on an ipv6 address connection with DHCP-PD

Hello,
I like to set a static ip for my pc to the router.
It's very easy to accomplish on ipv4, because of NAT. I only need to assign my PC to let's say... 192.168.0.42
I'd like to do the same on IPv6 But It's a way different concept...
I would like to use Dhcp-PD to get a prefix from my ISP. Let's say 2300:a333:b3:234c::/64
the prefix changes when the router reboots (I don't care about the prefix)
What I care about is the interface part of the address E.g. 2300:a333:b3:234c:XXXX:XXXX:XXXX:XXXX
I would like to set the XXXX part of the address manually
However the only way to set a manual IPv6 address I've found is to set the whole address with the prefix.
But if I set it that way, then on reboot(of the router) It won't work anymore
Is there a way to set the part of the address AFTER the prefix manually?
If so, how?

any opinions would be appreciated.

Last edited by megamind6155 (2019-02-22 14:01:43)

Offline

#2 2019-02-20 12:04:13

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

Using dhcpcd(8) to handle the DHCP PD.

https://www.daemon-systems.org/man/dhcpcd.conf.5.html

     ia_pd [iaid [/ prefix / prefix_len] [interface [/ sla_id [/ prefix_len [/ suffix]]]]]

So to set a suffix of ::2 instead of the default of ::1 you would write something like this:

interface wan0
  ia_pd 1 eth0///2

Last edited by rsmarples (2019-02-20 12:04:35)

Offline

#3 2019-02-20 22:26:27

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

You can use ip tokens:

ip token set ::XXX/64 dev eth0

Replace XXX with your preferred host-part.  The kernel will then take any RA's it receives on that interface and configure an address using the prefix from the RA and the hostpart from the token you've set.

Offline

#4 2019-02-21 02:10:31

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

RA != DHCP PD

Kernel cannot handle DHCP of any kind.
The fact it can handle RA is these days an abomination as it can do jack shit with RDNSS and DNSSL options within the RA.

Offline

#5 2019-02-21 02:19:42

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

rsmarples wrote:

RA != DHCP PD

Correct, but there's no reason OP has to use DHCPv6 to achieve what they want.

Offline

#6 2019-02-21 02:58:30

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

Quote the OP

would like to use Dhcp-PD to get a prefix from my ISP.

The OP *wants* DHCP.
If you want to claim a better knowledge than the OP fine - if an address is all he needs then RA is fine.
But if he needs anything else, it's DHCP. But you don't know that.

I'll even go out on a limb - if people ask for DHCP-PD they probably know what they are asking for as they are aware of the limitations of RA (mainly as it's in the kernel which in this day age is useless).

Offline

#7 2019-02-21 22:19:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

Don't take up arms in defence of OP under the assumption that you're correct. You may be, and that's fine; but if my suggestion isn't appropriate for OP then that's up to him/her to decide.  Even if it's not for OP, future Googlers looking for a similar solution might find it useful.  Thus far you've just derailed the thread to soapbox that you're right and I'm wrong; I've made my suggestion, you've made your suggestion, there's no need to hijack this thread further.

If you still have a problem and you really want to argue, then feel free to message me on IRC or send me an email. Leave the OP's thread to stay on track.

Offline

#8 2019-02-22 13:56:23

megamind6155
Member
Registered: 2019-01-16
Posts: 37

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

I tried IP token and it didn't work.
I'm not that good at networking. I just wanted all of my devices to autoconfigure except my workstation. That's why I'm using DHCP-PD
I just want my workstation to have a custom suffix.
(All of my network is managed through networkmanager)

Offline

#9 2019-02-24 22:33:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

megamind6155 wrote:

I tried IP token and it didn't work.

What exactly did you try and what were the results? Post command output and log files etc.  You need to have accept_ra turned on IME for it to work (and of course, your router needs to be sending RA's to the local network).

Offline

#10 2019-02-27 06:30:58

megamind6155
Member
Registered: 2019-01-16
Posts: 37

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

I tried 'ip token set  ::42/64 dev ens33'
No output was shown
I tried ip addr and it still showed my old IP
Then I reconnected my PC but still It showed the same IP
I don't know about accept_ra flag but my router is sending RA's to the local network (I think)

Offline

#11 2019-02-27 23:22:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

`ip token set` won't return anything if it was successful. Run `ip token list` to confirm the token is set.  It won't configure the new address until the next RA is received (which depends how often your router is sending them - usually 30 seconds to 2 minutes IME IIRC).

The token will be lost after reboot; what tool are you using to configure your network? I'm not sure which ones do and don't support tokens sorry.

Offline

#12 2019-02-28 12:45:18

megamind6155
Member
Registered: 2019-01-16
Posts: 37

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

running ip token list shows the token but the ip address doesn't change
Even If I physically reconnect the ethernet cable and reboot the router I still get a random ip not the one set in the token.
the router's autoconfiguration is set to SLAAC and stateless DHCPv6
The router's RA lifetime is set to 10 minute (It wont go lower than that)
The network is managed by NetworkManager
I feel like It's due to Networkmanager that the token is not working out

Offline

#13 2019-02-28 12:56:59

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

NetworkManager seems tohave token support. You may have to use the settings in the networkmanager interface, though.

ipv6.addr-gen-mode = 0 (NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64)
ipv6.token = ::XXXX:YYYY:ZZZZ/64

https://developer.gnome.org/NetworkMana … -ipv6.html

https://bugzilla.redhat.com/show_bug.cgi?id=1560652


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#14 2019-03-01 14:35:34

megamind6155
Member
Registered: 2019-01-16
Posts: 37

Re: How to set a static suffix on an ipv6 address connection with DHCP-PD

Ok, It works!
all you have to do is set ipv6 gen mode to eui64 and set an ip token and it works!
Does anyone know a way to make the token permanent?
even if I put ipv6.token = ::42/64 in the NetworkManager.conf file the ip is still EUI64
also the tui and gui don't show an option for setting a token
That should be added

Last edited by megamind6155 (2019-03-01 15:16:09)

Offline

Board footer

Powered by FluxBB