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

Set downstream route to delegated prefix in 6lbr example #21115

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

Conversation

OlegHahm
Copy link
Member

@OlegHahm OlegHahm commented Jan 2, 2025

Contribution description

The gnrc_border_router example uses by default the start_networking script when used via make term. This script in turn uses the KEA DHCPv6 server which does not automatically configures a downstream route toward the delegated prefix. Hence, it is the responsibility of the caller to setup the route themselves. This can be done with RIOT when STATIC_ROUTES is set to 1. (This will add a static link-local address to the border router's upstream interface (fe80::2) and a route via this address to the delegated prefix will be configured by the start_networking script.)

Testing procedure

  1. Setup a border router (for instance on the nrf52840dongle) with dhcpv6 for the prefix configuration, for instance, via BOARD=nrf52840dongle make -C examples/gnrc_border_router clean all flash ULINK=cdc-ecm PREFIX_CONF=dhcpv6.
  2. Check if the upstream interface (usually interface #6) has the address fe80::2 configured.
  3. Setup a second 6lowpan capable device with, for instance, gnrc_networking.
  4. Check if pinging a global IPv6 address (e.g., 2a01:4f9:1a:9508::1`) from the second device works.

The gnrc_border_router example uses by default the start_networking
script when used via `make term`. This script in turn uses the KEA
DHCPv6 server which does not automatically configures a downstream route
toward the delegated prefix. Hence, it is the responsibility of the
caller to setup the route themselves. This can be done with RIOT when
`STATIC_ROUTES` is set to `1`. (This will add a static link-local
address to the border router's upstream interface (`fe80::2`) and a
route via this address to the delegated prefix will be configured by the
start_networking script.)
@github-actions github-actions bot added the Area: examples Area: Example Applications label Jan 2, 2025
@OlegHahm OlegHahm added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer labels Jan 2, 2025
@benpicco
Copy link
Contributor

benpicco commented Jan 2, 2025

Won't this break deployment in 'real' networks?
When the device is connected to a proper router instead of a Linux PC for development, that router will likely not have fe80::1 as it's address so that default route is of no use.
Instead it will get it's default route via router advertisements.

@OlegHahm
Copy link
Member Author

OlegHahm commented Jan 2, 2025

Good point. Maybe I just hook in the script for KEA DHCP instead. That would be the cleaner solution, I guess.

@benpicco
Copy link
Contributor

benpicco commented Jan 2, 2025

The start_network.sh script also has an option to start radvd, but currently it's there as an alternative for DHCPv6 (for the simple subnetting module), you could also modify the script to allow both at the same time (but with different prefixes).

@OlegHahm
Copy link
Member Author

OlegHahm commented Jan 2, 2025

Isn't radvd required anyway to set the default route?

@benpicco
Copy link
Contributor

benpicco commented Jan 3, 2025

If you configure static routes (and addresses) you need no radvd

@OlegHahm
Copy link
Member Author

OlegHahm commented Jan 3, 2025

That's clear, but I still need radvd to configure the router when using DHCPv6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: examples Area: Example Applications Area: network Area: Networking Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants