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 macvlan/ipvlan network driver #836

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

junnplus
Copy link
Member

Signed-off-by: ye.sijun junnplus@gmail.com

@junnplus
Copy link
Member Author

Testing locally it works.

vm1 # ip route
default via 192.168.205.1 dev enp0s1 proto dhcp src 192.168.205.5 metric 100

vm2 # ip route
default via 192.168.205.1 dev enp0s1 proto dhcp src 192.168.205.6 metric 100

Create macvlan network.

vm1 # nerdctl network create mac0 -d macvlan --subnet=192.168.205.0/24 --ip-range=192.168.205.100/28

vm2 # nerdctl network create mac0 -d macvlan --subnet=192.168.205.0/24 --ip-range=192.168.205.200/28

Create container in macvlan network.

vm1 # nerdctl run -it --rm --net mac0 busybox sh
#  ip route
default via 192.168.205.1 dev eth0
192.168.205.0/24 dev eth0 scope link  src 192.168.205.100

vm2 # nerdctl run -it --rm --net mac0 busybox sh
#  ip route
default via 192.168.205.1 dev eth0
192.168.205.0/24 dev eth0 scope link  src 192.168.205.197

Test connectivity.

vm1: ping 192.168.205.197 -c 1
1 packets transmitted, 1 packets received, 0% packet loss

vm2:  ping 192.168.205.100 -c 1 
1 packets transmitted, 1 packets received, 0% packet loss

@junnplus junnplus marked this pull request as ready for review February 24, 2022 05:55
@AkihiroSuda
Copy link
Member

Thanks, could you update README.md and docs/cni.md ?

Would be nice if we can have CI too

@AkihiroSuda AkihiroSuda added this to the vNext milestone Feb 24, 2022
@junnplus junnplus force-pushed the network-vlan branch 2 times, most recently from f9aeb34 to ceed737 Compare February 24, 2022 09:28
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda added impact/major enhancement New feature or request labels Feb 24, 2022
Signed-off-by: ye.sijun <junnplus@gmail.com>
@AkihiroSuda AkihiroSuda merged commit f3e8aa4 into containerd:master Feb 24, 2022
@AkihiroSuda AkihiroSuda mentioned this pull request Mar 7, 2022
@AkihiroSuda AkihiroSuda linked an issue Mar 7, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request impact/major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MACVLAN support?
2 participants