docker modify ip

First,stop the containers running:

docker stop t1node

then, remove the subnet connected with the containers,ie:

docker network disconnect mynet t1node

docker network rm macnet

Create the new subnet and new gateway:

docker network create -d macvlan –subnet=192.168.2.0/24 –gateway=192.168.2.aaa -o parent=ens18 -o macvlan_mode=bridge mynet

Then,you can use new gateway and ip with container:

docker network connect –ip 192.168.2.xxx mynet t1node

docker start t1node

開始討論

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *