How to configure a static IPv6 address

This might not only be related to OpenWrt but to just a lack of understanding of IPv6 on my side :slight_smile:
I have my ISP --> Cable modem --> R7800 with openwrt
And WAN on openwrt is configured as follows (using luci)

(Screenshot is from Netgear R7800 owrt 18.06)

On WAN6 I have set DHCPv6 Client


  1. On tab WAN6, the field names for ipaddress, gatway are the same as on WAN and begin with IPv4 - the screen is exactly the same as on WAN
    Is this correct? I thought that I need to maintain an IPv6 address in the fields.
  2. If the labels are just wrong and an IPv6 address is required, should I calculate the IPv4 to the corresponding IPv6?

Is the question about static IPv6 or the DHCPV6 client? When entering a static IPv6 address you need to change IPv6 assignment to disabled.

It is about: How to set a static IPv6 address?
Current situation: The field names show IPv4 labels, even on the WAN6 Tab. What exactly am I supposed to enter there? Should I calculate to the equivalent IPv6 dress and ignore the IPv4 labels?
If so, what about the net mask? It is a dropdown, showing options for IPv4 addresses.
I have simply no clue how to configure a static IPv6 address using Luci.

  • Can you provide a screenshot of what you mean?
  • Does your Internet Service Provider deliver you IPv6 service?

You would use the IP addresses the ISP issued to you.

The point is: The WAN6 config screen looks exactly the same as the WAN (IPv4) screen, so it is the same as you can see above.
If I set the protocol to DHCPv6 Client I get a IPv6 address assigned.
But the question is how I configure a static IPv6 address - equivalent as I do it for IPv4.

If you wont provide a picture, I must take your word - file a bug report.

You file a bug report to get your IPv6 screen fixed.

That settings isn't currently exposed in LuCI, it seems it got lost a while back, will look into it later.
For now you can specify a static IPv6 address like this via SSH:

uci set network.wan.ip6addr=fdca:1:2:3:4::1234/64
uci set network.wan.ip6gw=fdca:1:2:3:4::1
uci commit network
ifup wan
1 Like

ok, Luci is not supported for IPv6.

I guess the equivalent to ipv4 would be fe80:0:0:0:0:0:c0a8:b ipv6.
and fe80:0:0:0:0:0:c0a8:1 for the gw.
If there is a proper ipv6 config screen in future, it would make sense that the fields are automatically populated (and can be changed) in case of the static ipv4 setting is already in place.

I will give it a try.

No, fe80:* are unroutable link-local addresses, the closest IPv4 thing that comes to mind are APIPA addresses.

The address range intended for private IPv6 network configuration is the so called ULA (unique local address) range fc00::/7 which allows you to freely pick IPs between fc00:0:0:0:0:0:0:0 and fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

Except there are recommendations about ULA which should be followed. Openwrt already chooses a ULA prefix randomly, so use that.

1 Like

If you get an ipv6 address from your ISP you should use that. It's rare that ISPs give you a static prefix unless you have a commercial account perhaps.

machines tend to have MANY ipv6 addresses. So your ULA prefix results in one set of addresses and the ISP's prefix results in another set. If you have a second ISP connection you'll get another one there. you can set up a tunnel and get yet another one... the concept "my machine's address" is not a correct concept with ipv6. In fact it's not right with ipv4 either, but the scarcity made it so that few machines had more than one ipv4. With ipv6 each of your machines can easily have a million addresses without any scarcity issues.

1 Like

all of my internal machines, as well as the openwrt router have an IPv6 address beginning with

    inet6 2a02:8071:ba8:31f1::142  prefixlen 128  scopeid 0x0<global>
    inet6 2a02:8071:ba8:31f1:d695:400e:51ab:9648  prefixlen 64  scopeid 0x0<global>

To be honest, I dont know where the IPv6 address for the router "comes" from (who is assigning it) since the setup is
ISP --> Cable Modem --> OpenWrt Router and the cable modem DHCP = OFF
But the devices on the local network get a proper active DHCPv6 Lease from the OpenWrt Router.

The Cable Modem also gets an IPv6 address starting with 2a02:8071:ba8 (now you know the provider).

Since I assign static IPv4 adresses to all devices I would also like to assign static IPv6 addresses, I guess it is also required for the openwrt router. (Some devices are reachable via IPv6 only, but this is a different story).

I don't know how stable your prefix is, it's entirely possible after a power outage or something like that your prefix will be different from 2a02:8071:ba8:31f1 so it's usually not possible in these circumstances to assign static IP6 addresses. What you can do is assign static ULA addresses for your LAN clients, since you control the prefix there. You can also assign static host portions on your individual clients. How you do that depends on your client, for example probably not possible for Android phones, but probably possible for laptops running Linux or Windows or MacOS.

EDIT: I should say that SLAAC addresses based on the MAC are obviously consistent for a given device, and any device that uses DHCP6 can be assigned a consistent address by configuring your dhcpv6 server, and some clients use what's called a stable privacy address where some cryptographic secret is used together with the prefix to generate a suffix that's always the same whenever you're on that prefix.

the right ucis should be

uci set network.wan6.ip6addr=fdca:1:2:3:4::1234/64
uci set network.wan6.ip6gw=fdca:1:2:3:4::1

since it is for WAN6 and not WAN
I have tried to set a different IPv6 prefix 2a02:8071:b88:1313 for the Router - different to what was asigned for ISP --> Cable Modem and it breaks the IPv6 upstream.

For this test, the reason brings me back to the initial question:

If the labels are just wrong and an IPv6 address is required, should I calculate the IPv4 to the corresponding IPv6?

Maybe the router IPv6 is not possible, but I will give the ULA addresses for your LAN clients a try.

AS29562 Kabel BW GmbH - Yes now we know, because the previous IP you provided was invalid. Until you showed that, I thought you issue was that you wern't provisioned IPv6 by your ISP.

I don't believe you can set a static IP...this is why:

Also, please inform us if your IPv6 address are in a /64 subnet, or something different. If it's a /64, you will need to do more to get IPv6 on a LAN client.

the router IPv6 WAN(6) address shows /128 at the end.

So far so good, I can set the clients of the Router to e.g. dhcp config static ip6_address=fdd3:738:23bf::100 since my eyes also recognized that information blow the list of interfaces

But this is OT. I was also using the local link address starting with fe80::e to ssh into the machines on the local network. Using a proper address now might be cleaner but not more efficient.

The initial topic was about how to set a static IPv6 address on the router. And on the interface settings for WAN and WAN6 we have the same fields - labeled with IPv4 and if I scroll down, also for IPv6 which is definitely confusing.

Now, I collect 100 and go back on start.

BTW, my public (cable modem) IPv6 prefix changed 5 times in the last 8 months, so it is not static

Not good. That's a single IPv6 address. Your ISP is configured to provide IPv6 to a single client only.

  • You can only use link local addresses on LAN in this setup
  • If you set a static IPv6 WAN address, it likely won't work, you'll need to request a Static Bloc from your ISP

I just realized...there is no Native Static IPv6 option in LuCI-Interfaces dropdown.

1 Like

It is ISP --> Cable Modem --> Router --> LAN
If my router gets one IP(v6) from the cable modem only, this is a restriction for my static IP project, ok.
But on LAN I can use everything beginning with the ULA prefix, don't I?

Another thing I realized is that my router has two LAN IPv6
IPv6: 2a02:8071:ba8:xxxx::1/60
IPv6: fdd3:738:23bf::1/60
whereas I see the last one as an "equivalent" for IPv4

For LAN, there seem to be no setting for IPv6 as the fields are there for WAN and WAN6. The IPv6 LAN seems to be derived from the ULA Prefix.

Yes, this should be working already.


Correct, it should be.

If your LAN is not getting an address from fdd3:738:23bf, please provide a copy of /etc/config/network and /etc/config/dhcp

Also, the ULA differs from Link Local (fe80::), ensure you've enabled IPv6 on your test LAN client. You should have a ULA and a Link Local IPv6 address.

yes, everything as stated above.
Only one LAN device in the basement is lost most probably due to wrong config. In german we say Kollateralschaden :slight_smile:
Awesome, but:

  • Cannot assign static IPv6 address to WAN6 interface on OpenWrt
  • Config fields on WAN and WAN6 slightly confusing in regard to IPv6
1 Like