You need to change 10.176.22.0/24 to your own network.
docker network create -d macvlan \
--subnet=10.176.22.0/24 \
--gateway=10.176.22.1 \
-o parent=em1 \
-o macvlan_mode=bridge macnet
docker run --name rui -it -d --network macnet --restart unless-stopped --privileged --ip 10.176.22.33 ruiray/docker_gateway:20230225 /bin/sh
docker exec -it rui /bin/sh
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Then you can change your gateway to 10.176.22.33.
More information can be found at https://blog.hifool.cn/posts/centos-gateway/
Content type
Image
Digest
sha256:18bedd8ed…
Size
9.7 MB
Last updated
over 3 years ago
docker pull ruiray/docker_gateway