add cmdline param pub:mac to configure public mac #2090
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So this is solving an interesting problem. We are trying to run a zos node at a provider. The node gets a public IP but the problem is this public IP is usable only from the mac assigned to the nic of the VM. this of course makes sense.
ZOS on the other hand, does not assign the IP directly to the nic, but to a virtual (macvlan) device (called public) inside a special namespace (public namespace) only, once a
public-config
is assigned to the node! (details on that can be found in docs)But this means traffic initiated from the public ip of the node now does not come from the correct hardware address.
The solution was to swap the mac address of the macvlan device with the mac address of the nic, to correct this.
Instead of doing this blindly, we added a command line argument to control if u wanna keep the current behavior or do the swapping.
The process of the swapping is simple!. first find the physical nic the public macvlan is (eventually) going over, then if the nic mac is already swapped (matches the computed mac) then nothing to do. otherwise, take this mac, set the new mac, and use the nic mac to set up the macvlan device.