UCRM - Customizing Docker Subnet

 Overview


This guide will guide the user on how to set up custom docker subnets. By default Docker uses  172.17.0.0/16  subnet for container networking. This guide will demonstrate how to change this subnet.

Table of Contents


- Customizing the docker0 Bridge

- Customizing UCRM Container Subnets

- Clean Installation

- Existing Installation (updating)

- Related Articles


Customizing the docker0 Bridge


Back to Top

After Docker is installed, default bridge interface is created with the  172.17.0.0/16  subnet. To change this subnet, create a  /etc/docker/daemon.json  file with following content:

{
  "bip": "192.168.80.1/24"
}

Where  192.168.80.1/24  is the new subnet you want to use in CIDR format. After the file is created, restart docker service with  sudo service docker restart . See this external docker documentation for more information.


Customizing UCRM Container Subnets


Back to Top

UCRM containers are using 2 custom networks,  public  and  internal. To change subnets of these networks, do the following:

Clean Installation

When performing a clean installation you can modify the subnets used with  --subnet  and  --subnet-internal  arguments for install script. See the modified commands below.

info_i_25x25.png Please note, that the subnets must NOT create conflicts (i.e. you cannot use the same subnet for both public and internal networks).

Ubuntu 16.04 (LTS)

curl -fsSL https://raw.githubusercontent.com/U-CRM/billing/master/install.sh > /tmp/ucrm_install.sh
sudo bash /tmp/ucrm_install.sh --subnet 192.168.81.1/24 --subnet-internal 192.168.82.1/24

Debian 8.4

su root
apt-get update
apt-get install curl -y
curl -fsSL https://raw.githubusercontent.com/U-CRM/billing/master/install.sh > /tmp/ucrm_install.sh
bash /tmp/ucrm_install.sh --subnet 192.168.81.1/24 --subnet-internal 192.168.82.1/24

Existing Installation (updating)

When performing updates you can modify the subnets used with  --subnet  and  --subnet-internal  arguments for the update script. See the modified commands below.

info_i_25x25.png Please note, that the subnets must NOT create conflicts (i.e. you cannot use the same subnet for both public and internal networks).

 

info_i_25x25.png Please note, that the subnet configuration is only possible once using the update script. If you already configured the subnets and want to change them, you’ll have to modify the docker-compose.yml file manually.

Ubuntu 16.04 (LTS)

cd /home/ucrm
curl -fsSL https://raw.githubusercontent.com/U-CRM/billing/master/update.sh | sudo bash -s -- --subnet 192.168.81.1/24 --subnet-internal 192.168.82.1/24 | sudo tee update.log

Debian 8.4

su root
cd /home/ucrm
curl -fsSL https://raw.githubusercontent.com/U-CRM/billing/master/update.sh | bash -s -- --subnet 192.168.81.1/24 --subnet-internal 192.168.82.1/24 | tee migrate.log

 

Manual Change (if already configured)

If the subnets were already configured with update script, you need to modify the  docker-compose.yml  file manually.

 

After the file is modified, restart the docker containers with:

cd /home/ucrm
sudo docker-compose stop
sudo docker-compose rm -f
sudo docker-compose up -d

Related Articles


Back to Top

UCRM - Beta Update Guide

UCRM - Installation Guide