Note
The container networks configuration option is only available with NetCloud OS 7.2.50 and later.
By default, Docker Compose distributes IP addresses starting from “172.17.0.2” in the Docker LAN subnet. To change the default subnet, you can either set the IP statically or dynamically using DHCP (if your container supports it) so the Docker host effectively acts as a DHCP server for each container LAN.
In the following example, we create a dedicated IP Subnet named "Container Net" on subnet 10.99.99.0/24 and assign a DHCP IP address to a container interface from the Container Net subnet.
Use the following procedure to add a new local IP subnet and enable a DHCP range for container interfaces.
Log into NetCloud Manager.
Select in the left-side navigation panel.
Select a router from the Routers page. Alternatively, to make configuration changes to a group, navigate to the Groups page and select a group.
Select and then .
Navigate to NETWORKING > Local Networks > Local IP Networks.
Select .
Enter the name of the new Local IP Network. For example, "Container Net".
Under IPv4 Settings, enter the IP Address and Netmask of the IP network.
(Optional) Configure the DHCP scope with the IP address using the Range Start and Range End fields. For example, 10.99.99.2 thru 10.99.99.9 for containers.
Select .
Navigate to > > .
Select if the project is already created or select to create a new project. See Configuring a Container for more information.
The network must be assigned to the Project before it can be added to the service level. In the Network section, select and choose from the list of available networks.
Select .
Under Services, select .
The Services Configuration dialog box opens.
If using Static IP for containers, enter the static address and select .
Note
It is recommended to reserve the Static IP via the Reservations panel in the DHCP Configuration page to avoid IP conflicts.
Under the Network tab, specify the container network from the drop-down menu.
Select .
From the Devices page in NetCloud Manager, select the device name and then navigate to . Select the name of the container to view the IP details. Verify a container interface is getting an IP address from the 10.99.99/24 address range.