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

Add custom-phys-address for interfaces #680

Closed
troglobit opened this issue Oct 2, 2024 · 0 comments · Fixed by #695
Closed

Add custom-phys-address for interfaces #680

troglobit opened this issue Oct 2, 2024 · 0 comments · Fixed by #695
Assignees
Labels
feature Feature request triage Pending investigation & classification (CCB)
Milestone

Comments

@troglobit
Copy link
Contributor

troglobit commented Oct 2, 2024

Description

In some use-cases it would be useful to be able to infer using the base MAC (chassis MAC) address on an interface, e.g., VETH pairs or layer-2 tunnel interfaces.

This issue details a proposal to extend the ietf-interfaces.yang model with options to tweak and override the defaults.

Furthermore, in an effort (very small) to reduce the deviations, we propose reverting the config true; change for ietf-interfaces:phys-address and fold that support as well into this new syntax.

YANG Model

augment "/if:interfaces/if:interface" {
  description "Custom phys-address management, static or derived from chassis MAC.";

  container custom-phys-address {
    description "Container for custom physical address options";

    choice address-type {
      description "Choose between static MAC address or chassis-derived MAC";

      case static {
        leaf static {
          type yang:phys-address;
          description "Statically configured interface address on protocol sub-layer, e.g., MAC.";
        }
      }

      case chassis {
        container chassis {
          presence "Enable chassis-derived address options";
          description "Container for options when using chassis-derived address.";

          leaf offset {
            type yang:phys-address;
            description "Address offset to add to the chassis-derived MAC.";
          }
        }
      }
    }
  }
}

Note: node and container names are of course just suggestions at this point.

Example

Base MAC address of the device, sometimes referred to Chassis MAC, is read from VPD and parsed by probe at boot into /run/system.json. In this example the Base MAC is 00:53:00:c0:ff:ee.

1) Fixed custom

admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address static 00:ab:00:11:22:33

=> 00:ab:00:11:22:33

2) Use Chassis MAC

admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis

=> 00:53:00:c0:ff:ee

3) Use Chassis MAC, with local bit

admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis offset 02:00:00:00:00:00

=> 02:53:00:c0:ff:ee

4) Use Chassis MAC, with offset

admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis offset 00:00:00:00:00:02

=> 00:53:00:c0:ff:f0

5) Use Chassis MAC, with offset and local bit

admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis offset 02:00:00:00:00:02

=> 02:53:00:c0:ff:f0

Additional Information

A previous proposal used format specifiers, which exist today in an extension to ietf-system.yang, for hostname. That proposal was scrapped in favor of this current one, which is a more YANG friendly alternative.

General Information

Anyone can help out by sponsoring development of new features or contributing pull requests.
Please use this issue for discussions related to the feature.

@troglobit troglobit added feature Feature request triage Pending investigation & classification (CCB) labels Oct 2, 2024
@troglobit troglobit changed the title Add phys-address format specifiers for base mac Add custom-phys-address for interfaces Oct 2, 2024
@troglobit troglobit self-assigned this Oct 8, 2024
@troglobit troglobit moved this to In progress in Infix & C:o Oct 8, 2024
@troglobit troglobit added this to the Infix v24.10 milestone Oct 8, 2024
troglobit added a commit that referenced this issue Oct 9, 2024
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]>
troglobit added a commit that referenced this issue Oct 9, 2024
troglobit added a commit that referenced this issue Oct 9, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit mentioned this issue Oct 9, 2024
13 tasks
@troglobit troglobit linked a pull request Oct 9, 2024 that will close this issue
13 tasks
troglobit added a commit that referenced this issue Oct 10, 2024
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]>
troglobit added a commit that referenced this issue Oct 10, 2024
troglobit added a commit that referenced this issue Oct 10, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Oct 10, 2024
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]>
troglobit added a commit that referenced this issue Oct 10, 2024
troglobit added a commit that referenced this issue Oct 10, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Oct 10, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Oct 11, 2024
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]>
troglobit added a commit that referenced this issue Oct 11, 2024
troglobit added a commit that referenced this issue Oct 11, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Oct 11, 2024
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]>
troglobit added a commit that referenced this issue Oct 11, 2024
troglobit added a commit that referenced this issue Oct 11, 2024
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <[email protected]>
@github-project-automation github-project-automation bot moved this from In progress to Done in Infix & C:o Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request triage Pending investigation & classification (CCB)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant