Task:
Create a custom network with
default bridge driver named as my-custom-net with subnet 10.100.0.0/16 gateway 10.100.0.1 and IP range 10.100.2.0/24.
Create a container named as net-test with custom
network i.e my-custom-net.
Inspect the container net-test and
check the IP address assigned to it.
1. Create a custom network with custom IP settings.
#docker network create --subnet
10.100.0.0/16 --gateway 10.100.0.1 --ip-range 10.100.2.0/24 --driver bridge
--label host2net my-custom-net
2. Inspect the custom network.
#docker network inspect
my-custom-net
Check the Subnet, Gateway, IP Range and Label assigned to the network.
No comments:
Post a Comment