Static leases via IPv6 on LAN but no WAN

I was trying to get my router to do stateful IPv6 unique link-local addresses.

My intention is just to keep a record on the router and be able to set their IPv6 addr.

I've tried a couple hours, but I just can't get them to assign an address in DHCPv6 Leases.

/etc/config/network

config globals 'globals'
        option ula_prefix 'fd00:0000:0000:0000::/120'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.0.0.1'
        option netmask '255.255.255.128'
        option force_link '0'
        option defaultroute '0'
        option delegate '0'
        list ip6class 'local'
        option ip6ifaceid '::1'

/etc/config/dhcp

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option dhcpv4 'server'
        option leasetime '1h'
        option limit '30'
        option force '1'
        option ra 'server'
        option dhcpv6 'server'
        option ra_slaac '0'
        option dns_service '0'
        list ra_flags 'none'

What I expect, that the clients get assigned a local address in the fd00:0000:0000:0000::/120 prefix when they connect and be visible on the status page under active DHCPv6 leases in Static leases or Status and possibly set them a suffix.

The ULA prefix needs to be a /48. It's normally a randomly generated /48 prefix within the fd00::/8 prefix. And don't confuse link local (fe80) addresses with unique local (fd00) addresses. They are not the same. On my network, I don't use ULA because I don't find them useful. Link local addresses are mandatory and self configured by each host.

1 Like

thanks I edited the question, yeah new to ipv6, why I'm trying :slight_smile:

Would
fd00::/48
be valid?

My main PC still gets the same fd8c:7d73:f6da:480d:f10e:3b6:4f63:f703 addr and my iPhone a similar addr (still the same).

They are both not listed in DHCPv6 leases.

Yes, in fact I think openwrt let's you get away with using fd00::/64. I don't know if they can be assigned centrally with dhcpv6, however. Like I said, I don't use them. Maybe someone else knows?

Oh wait, if I remember correctly, I think if you use dhcpv6 to hand out global addresses, the host half of the ula addresses match the host half of the global address handed out by dhcpv6. Is that what you want? In fact, I think even with SLAAC, the ula addresses will have the same host portion as the global addresses.

I just want to give be able to assign them an ipv6 address by mac address, like ipv4 but on ipv6 with dhcpv6.

I don't have global addr from WAN, because they do not support it yet. It should work but it expects some non-standard specific requests that I'm unsure of odhcpc6 can even produce, I've tried for a long time also with -x parameters

The dhcpv6 server on the lan is dnsmasq. odhcpc6 is for client dhcpv6 requests to the upstream isp.

True, but I can't get the global IP with odhcpc6.

This question is just whether I can get some control over the IPv6 addresses assigned to LAN.

I don't know. I suggest you dig into the documentation for dnsmasq, or maybe someone else knows the answer. Btw, I should point out that fd00:0000:0000:0000::/120 isn't properly formatted. It should be fd00::/120. Maybe you can try that and see if it works.