Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Managing cRPD

Networking Docker Containers

Docker containers are connected using user defined bridges. For detailed documentation on docker bridge, see Use Bridge Networks

To create a bridge:

  1. Run the following command to create a bridge:

    root@ubuntu-vm18:~# docker network create --internal my-net

    The --internal argument prevents the bridge being connected to the host network which is desirable in some cases. Once a bridge is created, it can be attached or detached to the containers.

  2. Run the following command to attach the bridge to the containers:

    root@ubuntu-vm18:~# docker network connect my-net crpd01

To remove a bridge:

  1. Run the following command to remove a bridge:

    root@ubuntu-vm18:~# docker network rm my-net

  2. Run the following command to disconnect the bridge from the containers:

    root@ubuntu-vm18:~# docker network disconnect my-net crpd01

Building Topologies

You can use open-vswitch to setup topologies and to connect to docker containers. This controls the creation of the bridges, interface naming, and Ip addressing.

To build a topology:

  1. Run the following command to install openvswitch-switch utility:

    root@ubuntu-vm18:~# sudo apt-get install openvswitch-switch

  2. Navigate to the following path:

    root@ubuntu-vm18:~# cd /usr/bin

  3. Download ovs-docker with wget:

    root@ubuntu-vm18:~# wget "https://raw.githubusercontent.com/openvswitch/ovs/master/utilities/ovs-docker"

  4. Run the following command to change the mode:

    root@ubuntu-vm18:~# chmod a+rwx ovs-docker

Creating an OVS Bridge

To create an OVS bridge and connect the docker to two containers R1 and R2:

  1. Run the following command to create a bridge connecting R1 and R1:

    root@ubuntu-vm18:~# sudo ovs-vsctl add-br R1R2_1

  2. Run the following command to add interfaces to R1 and R2:

    root@ubuntu-vm18:~# sudo ovs-docker add-port R1R2_1 eth1 R1

    root@ubuntu-vm18:~# sudo ovs-docker add-port R1R2_1 eth2 R2

  3. Run the following command to configure IP addresses on R1 and R2

    root@ubuntu-vm18:~# sudo docker exec -d R1 ifconfig eth1 192.168.1.1/24 mtu 1400

    root@ubuntu-vm18:~# sudo docker exec -d R2 ifconfig eth2 192.168.1.2/24 mtu 1400

Removing Interfaces and Bridges

To remove interfaces and bridges:

  1. Run the following command to remove the interfaces:

    root@ubuntu-vm18:~# sudo ovs-docker del-port R1R2_1 eth1 R1

  2. Run the following command to remove the bridges:

    root@ubuntu-vm18:~# sudo ovs-vsctl del-br R1R2_1

Viewing Container Processes in a Running cRPD

To view container processes:

Run the docker exec command to view the details about the processes (applications, services, and status) running on a container.

root@ubuntu-vm18:~# docker exec crpd01 ps aux

Accessing cRPD CLI and Bash Shell

To access the cRPD using CLI and bash shell:

  1. Run the docker exec -it crpd1 cli to launch the Junos CLI.

    root@ubuntu-vm18:~# docker exec -it crpd01 cli

  2. Run the docker exec -it crpd1 bash to launch the Junos shell.

    root@ubuntu-vm18:~# docker exec -it crpd01 bash

Pausing and Resuming Processes within a cRPD Container

You can pause or resume all processes within one or more containers.

To pause and restart a cRPD:

  1. Run the docker pause command to suspend all the processes in a cRPD container.

    root@ubuntu-vm18:~# docker pause crpd-container-name

  2. Run the docker unpause command to resume all the processes in the cRPD container.

    root@ubuntu-vm18:~# docker unpause crpd-container-name

Removing a cRPD Instance

To remove a cRPD instance or image:

Note:

You must first stop and remove a cRPD instance before you remove a cRPD image.

  1. Run the docker stop command to stop the cRPD.

    root@ubuntu-vm18:~# docker stop crpd-container-name

  2. Run the docker rm command to remove the cRPD.

    root@ubuntu-vm18:~# docker rm crpd-container-name

    Note:

    Include --force to force the removal of the running cRPD.

  3. Run the docker rmi command to remove one or more cRPD images from the Docker Engine.
    Note:

    Include --force to force the removal a cRPD image.

    root@ubuntu-vm18:~# docker rmi crd-Image-name

Viewing Docker Statistics and Logs

To view the statistics and logs:

  1. Run the docker stats command to monitor the resource utilization.
  2. Run the docker logs crpd-container-name command for extracting the container logs.

Viewing Active Containers

To view the current active containers and their status:

Run the docker ps or the docker container ls command to list the active containers.

root@ubuntu-vm18:~# docker container ls

root@ubuntu-vm18:~# docker ps

Stopping the Container

To stop the container:

You can stop the container using the following command:

root@ubuntu-vm18:~# docker stop crpd-container-name