You are not logged in.
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
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
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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
RA != DHCP PD
Correct, but there's no reason OP has to use DHCPv6 to achieve what they want.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
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).
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
`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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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
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
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
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