Option for maximum prefix size assigned?

By default, odhcpd will only hand out a /62 or smaller prefix to each downstream device. I have a /56 on the main router lan and would like each downstream router to have a /60. I remember some fairly recent discussion about this being a new and undocumented option in DHCP configuration but don't remember what the option was named.

Just to be clear, you want something like this? This is a subnet router, with upstream being my edge router that gets a /56 from the ISP, then hands out whatever the subnet routers request. (All examples below on 24.10.2.)

$ ubus call network.interface dump | jsonfilter -e '$.interface[@.interface = "wan6"]' | bin/json_pp
{
    "interface": "wan6",
    ...
    "ipv6-address": [
        {
            "address": "26xx:xxxx:xx01:b600:7e2b:e1ff:fe13:73a7",
            "mask": 64,
            "preferred": 76757,
            "valid": 76757
        },
        {
            "address": "fd0a:bad:dad:0:7e2b:e1ff:fe13:73a7",
            "mask": 64,
            "preferred": 604790
        }
    ],
    "ipv6-prefix": [
        {
            "address": "26xx:xxxx:xx01:b620::",
            "mask": 60,
            "preferred": 21589,
            "valid": 21589,
            "class": "wan6",
            "assigned": {
                "lan": {
                    "address": "26xx:xxxx:xx01:b620::",
                    "mask": 60
                }
            }
        },
        {
            "address": "fd0a:bad:dad:20::",
            "mask": 60,
            "preferred": 21589,
            "valid": 21589,
            "class": "wan6",
            "assigned": {
                "lan": {
                    "address": "fd0a:bad:dad:20::",
                    "mask": 60
                }
            }
        }
    ],

I don't do anything special here.

Upstream config:

config interface 'wan6'
        option device 'eth0'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix '56'         <<< get 56 on the edge router

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '10.1.1.1'
        option ip6assign '56'         <<< it hands out whatever it can

On that subnet router, we have:

config interface 'wan6'
        option device     'eth0'
        option proto      'dhcpv6'
        option reqaddress 'try'
        option reqprefix  '60'    <<< only ask for a /60

Yes I remember it being discussed
It should be in the wiki.
I have it somewhere but travelling today

Mike in case you did not find it yet see:

also see:

If I recall it is only in 24.10 and later not sure

Thanks. I was away from this for a bit due to a power cut at the remote site that I'm setting up. The main router is running 24.10.1 and it was issuing /60 without any special configuration as you also found.

dhcpv6_pd_min_len	integer	-			Minimum prefix length to delegate with IA_PD
							(value is adjusted if needed to be greater
							than the interface prefix length).  Range [1,62]

Interesting this says it can't be set to 64 which is what a lot of (lousy) ISPs do expecting the customer to have exactly one LAN. I will do some testing to find out what the limits are.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.