OpenWrt Forum Archive

Topic: Native IPv6 - how to delegate subnets

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

Ive got native IPv6 uplink with prefix xxxx:xxx:xxx:xxxx::/62, so theoretically, 4 subnets should be avaible for use.

How can I assign desired subnets to LAN, VPN interfaces etc., when I want to diferentiate them like:
1)xxxx:xxx:xxx:xxxx::
2)xxxx:xxx:xxx:xxx(x+2)::
3)xxxx:xxx:xxx:xxx(x+3)::
4)xxxx:xxx:xxx:xxx(x+3)::

when I use just

config interface 'lan'
...
option ip6assign '62'

or

config interface 'lan'
...
option ip6assign '64'

Ive got 4th option. It works for one interface, but when I trying to do magic through ip6hint/ip6assign also for the other interfaces (vpn, wifi), I cant make it work, Ipv6 breaking each other etc. ipv6hint seems to do nothing in my case sad

Glad for any help!

(Last edited by Robutek on 18 Mar 2017, 20:57)

Have you tried this way ?

config interface 'lan'
    option ip6assign '64'
    option ip6hint '0'

config interface 'vpn'
    option ip6assign '64'
    option ip6hint '1'

If it doesn't work, maybe the prefix cannot be sliced below the nibble level. So at least a /60 would be needed uplink for this config scheme to work.

Thanks for reply. Just tried that.. When I stop vpn, and start lan with 0, it has still given xxx(x+3). When I start vpn later, it doesnt get IPv6 at all sad

P.S.: WAN interface get the (xxxx), lan get (xxxx+3)

I tried also

config interface 'vpn0'
    option ip6hint '2'

and config interface 'lan'
    option ip6hint '3'

with same result. Should I need use

option ip6addr 

, or some RA method other than ip6assign?  Using odhcp as dhcpv6 on my router.

(Last edited by Robutek on 19 Mar 2017, 19:41)

Aditional question: when I have got IPv6 native from ISP, do I need configure any changes on dhcp config?

Like:

    option dhcpv6 'server'
    option ra 'server'

for the interfaces like wan6, LAN, Wifi .. ?

If the ISP does prefix delegation, this should suffice:

config dhcp 'lan'
        option interface 'lan'
        option ra 'server'
        option dhcpv6 'server'

Thank you. So there is need to dhcp daemon (odhcpd) also for IPv6 (for assignment IP to downstream interfaces).

I wasnt sure, if odhcp6c client isnt enough, for all interfaces, when native IPv6 stack is present..

thank you.

The discussion might have continued from here.