IPV6 conf in LAN and Guest, is this correct?

Hi I've been reading lately about ipv6 configurations specially if using not just 1 LAN interface but two or more. I am still confuse as of this moment and I don't know if I made the right configuration for the IPV6. I can actually ping from internet with ipv6 address either from LAN zone or from Guest zone, it's just I want to make sure if I did the right thing? basically I set lan ip6assign: 60 and then guest: 61, my ISP supplies prefix:56. Feel free to correct me if my configuration is wrong. Thank you in advance.

ifstatus wan6:

"up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 50575,
        "l3_device": "wan",
        "proto": "dhcpv6",
        "device": "wan",
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2001:4454:81::3:b26e",
                        "mask": 128,
                        "preferred": 122215,
                        "valid": 208615
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2001:4454:25a:af00::",
                        "mask": 56,
                        "preferred": 122215,
                        "valid": 208615,
                        "class": "wan6",
                        "assigned": {
                                "lan": {
                                        "address": "2001:4454:25a:af00::",
                                        "mask": 60
                                },
                                "guest": {
                                        "address": "2001:4454:25a:af10::",
                                        "mask": 61
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1225:41ff:fe20:1910",
                        "metric": 512,
                        "valid": 1706,
                        "source": "2001:4454:25a:af00::/56"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1225:41ff:fe20:1910",
                        "metric": 512,
                        "valid": 1706,
                        "source": "2001:4454:81::3:b26e/128"
                }
        ],
        "dns-server": [
                "2001:4450:f0:5::c53",
                "2001:4450:f0:f::c53"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "passthru": "001700202001445000f000050000000000000c532001445000f                                   0000f0000000000000c53"
        }

/etc/config/dhcp:

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ra 'server'
        option dhcpv6 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'guest'
        option interface 'guest'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option ra 'server'
        option dhcpv6 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

/etc/config/network:

config interface 'guest'
        option proto 'static'
        option device 'br-lan.10'
        option ipaddr '192.168.200.1'
        option netmask '255.255.255.0'
        option ip6assign '61'


config interface 'lan'
        option device 'br-lan.5'
        option proto 'static'
        option ipaddr '192.168.100.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

Not directly wrong but if you do not plan to have another downstream router then ip6assign should be just a 64.
With ip6hint you can set which network from the /56 is used. (Iirc it gets configured with a hex number.)

3 Likes

64 should be enough for guest, you are not expecting any guest to setup a router and request prefix delegation, right?

2 Likes

None of this moment, but what if in the future, I will be having that setup, what would be needed to change it here?

Edit: I see, so basically I'll revert back to 61 incase I needed another downstream router, right?

okay finally this settles some of my confusions and also with @trendy too. There's still alot of things to learn but for now I can feel at ease since this is just my setup as of this moment. Thank you once again. :slight_smile:

Or even 62, that can provide 4 /64s .

1 Like

Just for completeness:
An interface with a single subnet (/64):

config device
    option  name            'br-vlan24'
    option  type            'bridge'
    list    ports           'eth0.24'
    list    ports           'bat0.24'
    option  macaddr         '02:00:01:01:00:18'

config interface            'vlan24'
    option  device          'br-vlan24'
    option  proto           'static'
    option  ipaddr          '192.168.24.1/24'
    list    ip6ifaceid      '::1'
    option  ip6assign       '64'
    option  ip6hint         '18'
root@cpe:~# ip -6 addr show dev br-vlan24
12: br-vlan24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet6 2003:e4:XXXX:XX18::1/64 scope global dynamic noprefixroute
       valid_lft 52435sec preferred_lft 52435sec
    inet6 fde6:a09a:b373:18::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::1ff:fe01:18/64 scope link
       valid_lft forever preferred_lft forever

And if you plan to have a downstream router on an interface, then use i.e. ip6assign '62', which gives you 4 subnets (like @trendy explained), and adjust the ip6hint accordingly.

2 Likes

this settles everything, I have learned something today. Thank you very much guys.

2 Likes