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 cmdline param pub:mac to configure public mac #2090

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Conversation

muhamadazmy
Copy link
Member

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.

@muhamadazmy muhamadazmy merged commit 15aad83 into main Oct 24, 2023
2 checks passed
@muhamadazmy muhamadazmy deleted the mac-swap branch October 24, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants