1. Create docker macvlan network

Create a macvlan named macvlan-net, modify the subnet, gateway and parent values to the values in your environment

$ docker network create -d macvlan \
   --subnet=192.168.95.0/24 \
   --gateway=192.168.95.1 \
   -o parent=ens33 \
   macvlan-net

2. Start an nginx container as a test

$ docker run -itd --network=macvlan-net --ip=192.168.95.237 --name=nginx-test nginx

3. Configure host and container communication

Likes(0)

Comment list count 0 Comments

No Comments

WeChat Self-Service

WeChat Consult

TaoBao

support@elephdev.com

发表
评论
Go
Top