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

Interface vethbe68c466 Mac doesn't match #1057

Open
kwangabc opened this issue Jan 15, 2024 · 4 comments
Open

Interface vethbe68c466 Mac doesn't match #1057

kwangabc opened this issue Jan 15, 2024 · 4 comments

Comments

@kwangabc
Copy link

Dear cni developers, I encountered a problem when using cnitool
cnitool check mynet /var/run/netns/katanet Interface vethbe68c466 Mac doesn't match: a6:52:4d:e7:56:ab not found
But I have successfully added the network device
cnitool add mynet /var/run/netns/katanet { "cniVersion": "1.0.0", "interfaces": [ { "name": "cni0", "mac": "5e:af:9a:a2:d3:46" }, { "name": "vethbe68c466", "mac": "a6:52:4d:e7:56:ab" }, { "name": "eth0", "mac": "ae:38:d8:16:d4:ea", "sandbox": "/var/run/netns/katanet" } ], "ips": [ { "interface": 2, "address": "10.88.0.16/16", "gateway": "10.88.0.1" } ], "routes": [ { "dst": "0.0.0.0/0" } ], "dns": {}
Please tell me how should I solve this problem? Because just changing the mac address kata container network will not work in the end
Thank you very much for your answers!

@kwangabc
Copy link
Author

This problem occurred when I manually changed the MAC address
**cnitool check katanet /var/run/netns/katanet
Interface eth0 Mac 52:59:2d:7e:87:60 doesn't match container Mac: 5e:cd:4b:bf:43:8c
**

@kwangabc
Copy link
Author

When I changed the mac address of the container to be consistent with the address of eth0, I encountered this problem.
**cnitool check katanet /var/run/netns/katanet
Failed to match addr 10.88.0.2/16 on interface eth0
**

@squeed
Copy link
Member

squeed commented Jan 15, 2024

So, a plugin implementing CHECK is supposed to ensure the state of the system matches the CNI result that was returned. If you're manually changing the mac address after CNI ADD, then it is going to fail CHECK.

One option is to use the "tuning" chained plugin to change the mac. That will also change the returned CNI result, so that a future CHECK will succeed.

However, there are some manipulations that will never be CHECK-able. In that case, you can set the disableCheck: true field and it will cause CHECK to always return true.

@kwangabc
Copy link
Author

So, a plugin implementing CHECK is supposed to ensure the state of the system matches the CNI result that was returned. If you're manually changing the mac address after CNI ADD, then it is going to fail CHECK.

One option is to use the "tuning" chained plugin to change the mac. That will also change the returned CNI result, so that a future CHECK will succeed.

However, there are some manipulations that will never be CHECK-able. In that case, you can set the disableCheck: true field and it will cause CHECK to always return true.

Thank you very much for your answer,I found that when I executed this command
cnitool add katanet /var/run/netns/katanet
A bridge device and veth pair are created, one veth is in the host and the other veth is in netns.
Can I manually create the bridge device and veth pair in this step, and then add the container?

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

No branches or pull requests

2 participants