Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
openwrt-bot opened this issue Apr 17, 2021 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Apr 17, 2021

eriktews:

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.

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Apr 17, 2021

eriktews:

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"

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Apr 17, 2021

eriktews:

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

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Apr 19, 2021

eriktews:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant