1开启网卡混杂模式
‌使用ifconfig或ip link show命令‌查看网卡
使用

ip link set xxx promisc on开启混杂
ip link set eth0 promisc off关闭混杂

2创建macvlan网络

docker network create -d macvlan --subnet=10.1.0.0/16 --ip-range=10.1.62.0/24 --gateway=10.1.0.1 --ipv6 --subnet=fd00:8062::/96 -o parent=xxx macvlan

-d macvlan 指定网络模式
--subnet 设置子网掩码
--ip-range 设置容器允许的IP范围
--gateway 设置网关
-o parent 设置上一级网卡(或虚拟网卡)名称
macvlan 指定当前macvlan网络名称

分类: 默认分类 标签: 暂无标签

评论

-- 评论已关闭 --