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

IP address configuration for multiple interfaces #53379

Closed
4 tasks
krish2718 opened this issue Dec 28, 2022 · 3 comments
Closed
4 tasks

IP address configuration for multiple interfaces #53379

krish2718 opened this issue Dec 28, 2022 · 3 comments
Assignees
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features

Comments

@krish2718
Copy link
Collaborator

We have Kconfig options to choose either a static IP (CONFIG_NET_CONFIG_MY_IPV4_ADDR) or DHCP client or both for a single interface, but in case we have multiple interfaces all these will only be applicable to a single interface either default interface or the one passed to net_config_init_app.

We need to define custom Kconfig and call net APIs to configure static IP address, so, I would like to propose below enhancements:

Requirements

  • Extend IP address Kconfig options for all interfaces, possibly using interface indexing (IP_ADDR_0, IP_ADDR_1 etc)
  • Add support to run DHCPv4 client per-interface, DHCPV4_IF_0
  • Add ability to choose the interface order within the same type (a bit difficult, but I am thinking of device name used to register)
  • Add net shell commands for the same to configure either from Kconfig or shell.

e.g.,

  • For netusb + wifi, FIRST_IF = eth_netusb, IP_ADDR_0="10.0.0.1", DHCPV4_IF_1
  • For thread + wifi, FIRST_IF=wlan0, DHCPV4_IF_0, IP_ADDR_1="20.0.02"

Of course the above Kconfig suggestions are just to explain the requirement, feel free to come up with a better scheme.

@rlubos @rado17 @sachinthegreen

@krish2718 krish2718 added the Enhancement Changes/Updates/Additions to existing features label Dec 28, 2022
@jukkar
Copy link
Member

jukkar commented Dec 29, 2022

Something like this have already been discussed in #29750, perhaps we could continue the design ideas in that issue.
Anyway, I think we got into conclusion there that DT could be used for the configuration instead of creating new Kconfig options.

@krish2718
Copy link
Collaborator Author

Thanks, I only did a preliminary search for existing issues, it satisfies my requirements, though using DTS for SW sounds a bit weird, but I do agree with the rationale.

@carlescufi
Copy link
Member

Closing this in favor of #29750, since this is almost identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

4 participants