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

router: add option to include custom routes in RA #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidB137
Copy link

Introduces new configuration option ra_addroutes for adding custom route(s) in route advertisement (RA) messages when no default route is advertised.

This is useful when, for example, end devices are given only ULA IPv6 addresses (e.g. from fc00:0:100::/48), but one still needs inter subnet communication to e.g. fc00:0:200::/48. Currently, this wouldn't be possible without static route on each end device as the odhcpd server doesn't present itself as default router and no route information is given except for local ULA subnet (fc00:0:100::/48).

New configuration option ra_addroutes makes it possible to advertise arbitrary routes to the end devices and thus making correct routing possible even when no default route (or public IPv6 prefix) is available.

Option ra_addroutes exists under both odhcpd section and interfaces' sections. Latter sets up interface-specific routes. Routes configured under odhcpd are global and advertised for all interfaces (including those with interface-specific additional routes).

Config example:

config odhcpd 'odhcpd'
	...
	list ra_addroutes 'fc00:10::/32'
	list ra_addroutes 'fc00:20::/32'

config dhcp 'lan'
	...
	list ra_addroutes 'fd50:60:70::/48'

Fixes: #74 and possibly helps with #152

@systemcrash
Copy link
Contributor

I think this is a good option to have.

@DavidB137 please fix the conflicts.

DavidB137 added a commit to DavidB137/odhcpd that referenced this pull request Feb 3, 2025
Resolves merge conflicts in pull request openwrt#224.

Signed-off-by: Dávid Benko <[email protected]>
@DavidB137 DavidB137 force-pushed the master branch 2 times, most recently from d52aee0 to b8f6ff0 Compare February 3, 2025 18:35
@DavidB137 DavidB137 closed this Feb 3, 2025
Introduces new configuration option `ra_addroutes` for adding custom route(s)
in route advertisement (RA) messages when no default route is advertised.

This is useful when, for example, end devices are given only ULA IPv6
addresses (e.g. from fc00:0:100::/48), but one still needs inter subnet
communication to e.g. fc00:0:200::/48. Currently, this wouldn't be possible
without static route on each end device as the odhcpd server doesn't present
itself as default router and no route information is given except for local
ULA subnet (fc00:0:100::/48).

New configuration option `ra_addroutes` makes it possible to advertise
arbitrary routes to the end devices and thus making correct routing possible
even when no default route (or public IPv6 prefix) is available.

Option `ra_addroutes` exists under both `odhcpd` section and interfaces'
sections. Latter sets up interface-specific routes. Routes configured under
`odhcpd` are global and advertised for all interfaces (including those with
interface-specific additional routes).

Config example:

config odhcpd 'odhcpd'
	...
	list ra_addroutes 'fc00:10::/32'
	list ra_addroutes 'fc00:20::/32'

config dhcp 'lan'
	...
	list ra_addroutes 'fd50:60:70::/48'

Fixes: openwrt#74

Signed-off-by: Dávid Benko <[email protected]>
@DavidB137 DavidB137 reopened this Feb 3, 2025
@DavidB137
Copy link
Author

Sorry, I messed up quite a bit when resolving the conflicts. At first, I used spaces instead of tabs for indentation and then tried to fix it (unsuccessfully). So I instead synced my fork with upstream and reapplied the changes which should also make the history cleaner as there's no merge commit. Once again, sorry for the confusion.

@systemcrash Hopefully you can merge now.

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

Successfully merging this pull request may close these issues.

Support adding static router advertisments
2 participants