docker在一块网卡上创建多个macvlan子网

2023-09-05  本文已影响0人  EvineDeng

本文同步发表在我的个人博客https://devome.github.io/blog

docker在一块网卡上创建多个macvlan子网,不可以进行多次创建,需要在一次创建中把多个子网同时创建好。说明及创建命令如下:

docker network create \
    --driver macvlan \
    --subnet=10.0.0.0/24 --gateway "10.0.0.2" \
    --subnet=10.0.1.0/24 --gateway "10.0.1.1" \
    --subnet=10.0.2.0/24 --gateway "10.0.2.254" \    
    --subnet=fe80::/64 --ipv6 \
    --opt parent=eth0 \
    --opt macvlan_mode=bridge \
    --opt com.docker.network.bridge.name=mymacvlan \
    mymacvlan
上一篇 下一篇

猜你喜欢

热点阅读