docker,mavlan创建的第二个。但是,容器不绑定ip地址
我面临docker和macvlan的问题 我有一个专用服务器 有3个ip地址块: 第一个街区,2个ipsdocker,mavlan创建的第二个。但是,容器不绑定ip地址,docker,Docker,我面临docker和macvlan的问题 我有一个专用服务器 有3个ip地址块: 第一个街区,2个ips 51.xx.yy.65 51.xx.yy.66 第二个街区,4个ips 167.xxx.yyy.168 167.xxx.yyy.169 167.xxx.yyy.170 167.xxx.yyy.171 At this point, I create my first mavlan. Because I only had these two blocks... docker netw
51.xx.yy.65
51.xx.yy.66
第二个街区,4个ips
167.xxx.yyy.168
167.xxx.yyy.169
167.xxx.yyy.170
167.xxx.yyy.171
At this point, I create my first mavlan. Because I only had these two blocks...
docker network create -d macvlan --subnet=51.xx.yy.65/24 --subnet=167.xxx.yyy.168/24
--gateway=51.xx.yy.254 --gateway=167.xxx.yyy.254 -o parent=eno1 pub_net2
And then, I ran my docker containers...
docker run -dit --restart=always --ip=51.xx.yy.66 --mac-address 02:00:xx:xx:9c:d3
--net=pub_net2 --name=mycontainer myimage
docker run -dit --restart=always --ip=167.xxx.yyy.168 --mac-address 00:xxx:xxx:0a:ad:3f
--net=pub_net2 --name=mycontainer myimage
At this point, everything is perfect and working fine.
My containers can be accessed from outside, pinging ips, perfectly.
And now, the issue begins...
I received the Third ip block, 4 ips
'192.zz.zzz.48'
'192.zz.zzz.49'
'192.zz.zzz.50'
'192.zz.zzz.51'
Then, I create a new macvlan:
docker network create -d macvlan --subnet=192.zz.zzz.48/20 --gateway=192.zz.zzz.254 -o
parent=eno1.20 pubmcvlan4
Although the new network created, the following container cannot be accessed or ping the
ip from outside.
docker run -dit --restart=always --ip=192.zz.zzz.51 --mac-address=02:zz:zz:5a:e5:85 --
net=pubmcvlan4 --name=mycontainer myimage
Am I missing something?
Is it possible to edit a already created macvlan? Because, I cannot delete one with
containers attached to it.
Thank you for any help!
Best regards,
Humberto