OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Erik Tews - 17.04.2021

FS#3744 - static IPv6 routes to gateways within the ULA address range are not restored on startup

Static IPv6 routes configured in `/etc/config/network` that use a gateway within the ula address range are not properly restored on startup.

I managed to reproduce the issue in 19.07.7 and in the latest snapshot (17-04-2021). To reproduce the issue, do the following:

Setup a new OpenWRT system, for example in a VM. Uplink connectivity is not required, which makes it easy to reproduce the bug in a VM. Then edit `/etc/config/network` and add an IPv6 route using a gateway within the ula range. For example the entries may look like this:

```
config globals ‘globals’

      option ula_prefix 'fd22:e91a:3889::/48'

config route6

      option target "2001:4860:4860::8844"
      option gateway "fd22:e91a:3889::43"
      option interface "lan"

```

Reboot the device and verify that the route is not present with `ip -6 route show`. Then modify the config a bit, for example replace the _43_ in the gateway address with _42_. Then execute `reload_config` and wait a few seconds. Then verify that the route is present with `ip -6 route show`. You may then reboot the device and the route will not be there anymore.

Erik Tews commented on 17.04.2021 14:20

Sorry for having used the wrong syntax. The config may look like this:

config globals 'globals'
        option ula_prefix 'fd22:e91a:3889::/48'

config route6
        option target "2001:4860:4860::8844"
        option gateway "fd22:e91a:3889::43"
        option interface "lan"
Erik Tews commented on 17.04.2021 14:22

And one more note, everything is fine when using the link local address for the gateway.

Erik Tews commented on 19.04.2021 14:38

I think after looking at the source code of netifd, I also know why this happens. First of all, the static IP addresses and routes for the interface are processed:

https://github.com/git-openwrt-org-mirror/netifd/blob/master/config.c#L744

Afterwards, the globals (which contain the ULA prefix) are initialized:

https://github.com/git-openwrt-org-mirror/netifd/blob/master/config.c#L746

The correct order might be to initialize the IP addresses first, then add the ULA prefix addresses from the globals and then add the routes.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing