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

net: option to force the MAC address #195

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Conversation

matttbe
Copy link
Collaborator

@matttbe matttbe commented Nov 27, 2024

By default, QEMU sets the first NIC's MAC address to 52:54:00:12:34:56, and increments the last octet for the next ones. When different VMs need to discuss between each others via the same bridge, that can cause conflicts.

A new option has been added to set a different MAC address, e.g.

--net-mac-address 52:54:00:12:34:56

Which will assign 52:54:00:12:34:56 to the fist NIC, and increment the last octet for the next one, etc.

@matttbe
Copy link
Collaborator Author

matttbe commented Nov 27, 2024

We could also not take a prefix, and increment the last octet. It's easier to handle the prefix, but maybe easier for the use with a "full" MAC address?

@matttbe
Copy link
Collaborator Author

matttbe commented Nov 27, 2024

We could also not take a prefix, and increment the last octet. It's easier to handle the prefix, but maybe easier for the use with a "full" MAC address?

I just implemented the second option, it looks easier to use.

@matttbe matttbe changed the title net: option to force MAC address prefix net: option to force the MAC address Nov 27, 2024
Copy link
Owner

@arighi arighi left a comment

Choose a reason for hiding this comment

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

Left a small comment, but overall LGTM!

virtme_ng/run.py Outdated Show resolved Hide resolved
By default, QEMU sets the first NIC's MAC address to 52:54:00:12:34:56,
and increments the last octet for the next ones. When different VMs need
to discuss between each others via the same bridge, that can cause
conflicts.

A new option has been added to set a different MAC address, e.g.

  --net-mac-address 52:54:00:12:34:56

Which will assign 52:54:00:12:34:56 to the fist NIC, and increment the
last octet for the next one, etc.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
matttbe added a commit to multipath-tcp/mptcp-upstream-virtme-docker that referenced this pull request Nov 29, 2024
Needed to avoid conflicts with multiple VMs running in parallel.

It requires a WIP version of virtme-ng [1].

Link: arighi/virtme-ng#195 [1]
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
@arighi arighi merged commit 9a4d428 into arighi:main Nov 30, 2024
4 checks passed
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