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

Custom MAC address #695

Merged
merged 8 commits into from
Oct 11, 2024
Merged

Custom MAC address #695

merged 8 commits into from
Oct 11, 2024

Conversation

troglobit
Copy link
Contributor

@troglobit troglobit commented Oct 9, 2024

Description

  • Replace phys-address deviation with new custom-phys-address,
    For details, see Add custom-phys-address for interfaces #680
  • Add syntax migration for existing startup-config and factory-config files
  • Add custom-phys-address examples to documentation

Other information

Update documentation, networking.md:

  • Add missing VLAN brick to networking LEGO overview
  • Add description of brick relationships
  • Add section for general interface settiing

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added/updated?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

@troglobit troglobit changed the title Custom phys address Custom MAC address Oct 9, 2024
@troglobit troglobit added documentation Improvements or additions to documentation feature Feature request labels Oct 9, 2024
@troglobit troglobit added this to the Infix v24.10 milestone Oct 9, 2024
@troglobit troglobit linked an issue Oct 9, 2024 that may be closed by this pull request
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really love how this turned out!

Great job! 🥳

src/confd/yang/infix-interfaces.yang Show resolved Hide resolved
src/confd/yang/infix-interfaces.yang Outdated Show resolved Hide resolved
src/confd/yang/infix-interfaces.yang Outdated Show resolved Hide resolved
src/confd/yang/infix-interfaces.yang Outdated Show resolved Hide resolved
board/common/rootfs/usr/sbin/cfg-migrate Outdated Show resolved Hide resolved
doc/networking.md Outdated Show resolved Hide resolved
doc/networking.md Outdated Show resolved Hide resolved
doc/networking.md Outdated Show resolved Hide resolved
@troglobit troglobit force-pushed the custom-phys-address branch 3 times, most recently from e9fe3e5 to 2d788e7 Compare October 10, 2024 21:05
@troglobit troglobit requested a review from wkz October 10, 2024 21:17
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! 💪 🎉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great way to align the image to the new text!

...I just noticed that the IP address attached to that Ethernet interface, although accepted by the kernel, will never behave as the user expects. Except for the traffic assigned to any of the two VLAN interfaces, all packets will be sent directly to the bridge; go not pass the IP stack; do not collect $400 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing, that could've been a source of much confusion for us and users 🤣

This commit replaces the ietf-interfaces deviation for phys-address,
used to set custom MAC address on interfaces, with a more flexible
approach which can calculate the new MAC address based on the device's
chassi MAC, with or without an added offset.

The regression test has been updated to test all variants.

Resolves: #680

Signed-off-by: Joachim Wiberg <[email protected]>
This patch relocates the 30-cfg-migrate init script to confd, where it
belongs, renaming it migrate and installing into /usr/sbin.

The script has been heavily modified to be more user friendly, as well
as useful for automated restore operations, to be able to refresh old
backups to modern .cfg file syntax.

Example (injected phys-address error):

    admin@example:~$ migrate -c /etc/factory-config.cfg
    /etc/factory-config.cfg: has syntax error, requires migrating.

Since backups are created with the old confd sytanx version in the name,
the backup functionality has been kept in the script.

Signed-off-by: Joachim Wiberg <[email protected]>
For products with a static factory-config, or customers generating with
an older syntax, attempt migration in case of bootstrap failure.

Refactor logging to drop '-s'.  This prevents duplicate log messages
since bootstrap always runs after syslogd has started and all stdout
is always logged.

Signed-off-by: Joachim Wiberg <[email protected]>
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit added the ci:main Build default defconfig, not minimal label Oct 11, 2024
@troglobit troglobit merged commit 3358687 into main Oct 11, 2024
6 checks passed
@troglobit troglobit deleted the custom-phys-address branch October 11, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:main Build default defconfig, not minimal documentation Improvements or additions to documentation feature Feature request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add custom-phys-address for interfaces
2 participants