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
Post comment 取消回复