Forward ipv6 from one interface to another

Hello my isp gives me a /64 ipv6 with prefix delegation. I would like to use the ipv6 address for 2 interface

For example using one interface with ipv6 master and one interface set to ipv6 relay. Can someone give some hint about this configuration?

https://openwrt.org/docs/guide-user/network/ipv6/start#downstream_configuration_for_lan_interfaces

i don't have a /56 ipv6

uci show network
ifstatus wan6
ifstatus lan
root@Ansuel-Router:~# uci show network
network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd49:5134:465f::/48'
network.lan=interface
network.lan.type='bridge'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ipaddr='192.168.2.1'
network.lan.ip6assign='64'
network.lan.ifname='eth0.1 tap_softether'
network.guest=interface
network.guest.proto='static'
network.guest.netmask='255.255.255.0'
network.guest._orig_ifname='wlan1-1'
network.guest._orig_bridge='false'
network.guest.type='bridge'
network.guest.metric='10'
network.guest.ipaddr='192.168.20.1'
network.guest.ip6gw='fd49:5134:465f::2'
network.guest.ip6ifaceid='random'
network.wan=interface
network.wan.ifname='eth1.2'
network.wan.proto='pppoe'
network.wan.password='testoh'
network.wan.ipv6='auto'
network.wan.metric='0'
network.wan.username='ciaoca'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='0 1 2 3 5t'
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device='switch0'
network.@switch_vlan[1].vlan='2'
network.@switch_vlan[1].ports='4 6t'
network.wan_ipv6=interface
network.wan_ipv6.proto='pppoe'
network.wan_ipv6.ifname='eth1.2'
network.wan_ipv6.ipv6='auto'
network.wan_ipv6.metric='10'
network.wan_ipv6.keepalive='0'
network.wan_ipv6.username='adsl@alice6.it'
network.wan_ipv6.password='adsl@alice6.it'
network.modem=interface
network.modem.ifname='eth1.2'
network.modem.proto='static'
network.modem.netmask='255.255.255.0'
network.modem.ipaddr='192.168.1.7'
root@Ansuel-Router:~# ifstatus wan_ipv6_6
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": true,
        "uptime": 349152,
        "l3_device": "pppoe-wan_ipv6",
        "proto": "dhcpv6",
        "device": "pppoe-wan_ipv6",
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2a01:2000:2000:7840::1",
                        "mask": 64,
                        "preferred": 604795,
                        "valid": 2591995
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2a01:2000:2001:e3c6::",
                        "mask": 64,
                        "preferred": 335,
                        "valid": 335,
                        "class": "wan_ipv6_6",
                        "assigned": {
                                "lan": {
                                        "address": "2a01:2000:2001:e3c6::",
                                        "mask": 64
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "2a01:2000:2000:7840::",
                        "mask": 64,
                        "nexthop": "::",
                        "metric": 256,
                        "valid": 2591995,
                        "source": "::/0"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::90:1a00:1a4:d80f",
                        "metric": 512,
                        "valid": 35,
                        "source": "2a01:2000:2000:7840::1/64"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::90:1a00:1a4:d80f",
                        "metric": 512,
                        "valid": 35,
                        "source": "2a01:2000:2001:e3c6::/64"
                }
        ],
        "dns-server": [
                "2001:4b18:3050:916f::53:c001",
                "2001:4b18:3050:916f::53:c002"
        ],
        "dns-search": [

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

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ]
        },
        "data": {
                "passthru": "0017002020014b183050916f000000000053c00120014b183050916f000000000053c002",
                "zone": "wan"
        }
}

root@Ansuel-Router:~# ifstatus lan
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 1012,
        "l3_device": "br-lan",
        "proto": "static",
        "device": "br-lan",
        "updated": [
                "addresses"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [
                {
                        "address": "192.168.2.1",
                        "mask": 24
                }
        ],
        "ipv6-address": [

        ],
        "ipv6-prefix": [

        ],
        "ipv6-prefix-assignment": [
                {
                        "address": "2a01:2000:2001:e3c6::",
                        "mask": 64,
                        "preferred": 313,
                        "valid": 313,
                        "local-address": {
                                "address": "2a01:2000:2001:e3c6::1",
                                "mask": 64
                        }
                },
                {
                        "address": "fd49:5134:465f::",
                        "mask": 64,
                        "local-address": {
                                "address": "fd49:5134:465f::1",
                                "mask": 64
                        }
                }
        ],
        "route": [

        ],
        "dns-server": [

        ],
        "dns-search": [

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

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ]
        },
        "data": {

        }
}

Your prefix 2a01:2000:2001:e3c6::/64 is assigned to interface lan.
Default route for this prefix is present as well.
In general your configuration looks fine.
What do you want to do with it?

give the guest interface ipv6 access (to the device)

As i can't assing 2 64 block to 2 separate interface, my idea was to relay the ipv6 address from the lan interface to the guest inerface.

That requires splitting /64-prefix, isn't it?
It's likely not a good idea.
Why don't you obtain another prefix from https://tunnelbroker.net/?

1 Like

my idea was to use native ipv6 from my isp

Then you can try to request another/larger prefix from your ISP.
Otherwise how do you plan to perform routing without splitting the prefix?

1 Like

Often you can get a bigger prefix by calling your ISP, or get multiple /64. Unfortunately I don't think OpenWrt can do the multiple requests for prefixes thing to let you get several /64

Any ISP that gives out only one /64 needs to be pilloried.

1 Like

mhhh i think my isp doesn't even know that it does support ipv6... it's still in """"beta""""" after 4 year more or less... so request another block or even buy is not an option for them...

My idea was to just relay the request from guest interface device to the ipv6 master server so that i didn't have to split ipv6

Isn't the macvlan module available in the standard builds? In that case you could set up two ipv6 wan interfaces with one prefix on each or would both prefixes need to be requested by the same dhcpv6 client?

Comparing to the dirty tricks required to implement what you want, requesting a prefix from a tunnel broker doesn't look like a bad idea.

1 Like

another solution would be to create another pppoe but i never manage to make it work...

(i can have 10 concurrent pppoe session)

Really!
If you know how, this should work!
On the second interface, only setup IPv6.

i tried but i can't manage to link one pppoe session to the lan interface and the other pppoe session to the guest interface

It should be something like that:

uci set network.guest.ip6class="wan_ipv6_2"
uci commit network
service network reload

Otherwise you need to use hotplug to trigger the script, then ifstatus and jsonfilter to fetch ipv6prefix and finally use uci define option ip6assign for your guest network.