Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Manage cRPD

date_range 10-Dec-24
Application management is the lifecycle process for software applications to ensure efficient performance.

Build Topologies

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

To build a topology:

  1. Download and install openvswitch-switch utility.

    root@ubuntu-vm18:~# apt 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. Change the mode:

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

  5. Create the container crpd01.

    root@ubuntu-vm18:~# docker run --rm --detach --name crpd01 -h crpd01 --net=none --privileged -v crpd01-config:/config -v crpd01-varlog:/var/log -it enterprise-hub.juniper.net/crpd-docker-prod/crpd:19.2R1.8

  6. Create the container crpd02.

    root@ubuntu-vm18:~# docker run --rm --detach --name crpd02 -h crpd02 --net=none --privileged -v crpd02-config:/config -v crpd02-varlog:/var/log -it enterprise-hub.juniper.net/crpd-docker-prod/crpd:19.2R1.8

Network Docker Containers

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

To create the docker network:

  1. Create a bridge my-net.

    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. Connect the two containers using the bridge.

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

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

    This creates eth1 with a 172.18.0.0/16 subnet on crpd01 and crpd02.

Remove a Bridge

  1. Remove a bridge.
    root@ubuntu-vm18:~# docker network rm my-net
  2. Disconnect the bridge from the containers.
    root@ubuntu-vm18:~# docker network disconnect my-net crpd01
    root@ubuntu-vm18:~# docker network disconnect my-net crpd02

Create an OVS Bridge

To create an OVS bridge and connect the docker to two containers crpd01 and crpd02:

  1. Create a bridge connecting crpd01 and crpd02.

    root@ubuntu-vm18:~# ovs-vsctl add-br crpd01-crpd02_1

  2. Add interfaces to the bridge.

    root@ubuntu-vm18:~# ovs-docker add-port crpd01-crpd02_1 eth1 crpd01

    root@ubuntu-vm18:~# ovs-docker add-port crpd01-crpd02_1 eth1 crpd02

  3. Configure an IP address to the interface.

    root@ubuntu-vm18:~# docker exec -d crpd01 ifconfig eth1 10.1.1.1/24

    root@ubuntu-vm18:~# docker exec -d crpd02 ifconfig eth1 10.1.1.2/24

  4. Configure an IP address to the loopback interface.

    root@ubuntu-vm18:~# docker exec -d crpd01 ifconfig lo 10.255.255.1 netmask 255.255.255.255

    root@ubuntu-vm18:~# docker exec -d crpd02 ifconfig lo 10.255.255.2 netmask 255.255.255.255

  5. Log in to crpd01.

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

    content_copy zoom_out_map
    ===>
               Containerized Routing Protocols Daemon (CRPD)
     Copyright (C) 2018-19, Juniper Networks, Inc. All rights reserved.
                                                                        <===
  6. Verify the interface details.

    root@crpd01:/# ifconfig

    content_copy zoom_out_map
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.17.0.2  netmask 255.255.0.0  broadcast 172.17.255.255
            inet6 fe80::42:acff:fe11:2  prefixlen 64  scopeid 0x20<link>
            ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
            RX packets 28  bytes 2488 (2.4 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 7  bytes 826 (826.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.1.1.1  netmask 255.255.255.0  broadcast 10.1.1.255
            inet6 fe80::1c2b:50ff:fe9f:6559  prefixlen 64  scopeid 0x20<link>
            ether 1e:2b:50:9f:65:59  txqueuelen 1000  (Ethernet)
            RX packets 364  bytes 33600 (33.6 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 362  bytes 33748 (33.7 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 10.255.255.1  netmask 255.255.255.255
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  7. Verify the connection with crpd02 from crpd01.

    root@crpd01:/# ping 10.1.1.2 -c 2

    content_copy zoom_out_map
    PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
    64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.323 ms
    64 bytes from 10.1.1.2: icmp_seq=2 ttl=64 time=0.042 ms
    --- 10.1.1.2 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1018ms
    rtt min/avg/max/mdev = 0.042/0.182/0.323/0.141 ms

Remove Interfaces and Bridges

To remove interfaces and bridges:

  1. Remove the interfaces:

    root@ubuntu-vm18:~# ovs-docker del-port crpd01-crpd02_1 eth1 R1

  2. Remove the bridges:

    root@ubuntu-vm18:~# ovs-vsctl del-br crpd01-crpd02_1

View Container Processes

To view container processes in a running cRPD:

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

content_copy zoom_out_map
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  76996  8060 ?        Ss   Apr26   0:01 /sbin/init
root        19  0.0  0.2 160392 71520 ?        S<s  Apr26   0:38 /lib/systemd/systemd-journald
systemd+    30  0.0  0.0  70616  5236 ?        Ss   Apr26   0:00 /lib/systemd/systemd-resolved
root        32  0.0  0.0 167404 16324 ?        Ssl  Apr26   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
syslog      33  0.0  0.0 263036  4164 ?        Ssl  Apr26   0:05 /usr/sbin/rsyslogd -n
message+    38  0.0  0.0  49928  4072 ?        Ss   Apr26   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root        47  0.0  0.0  13020  1852 pts/0    Ss+  Apr26   0:00 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 xterm
root        52  0.0  0.0  72296  5536 ?        Ss   Apr26   0:00 /usr/sbin/sshd -D
root        80  0.0  0.0 1453936 13584 ?       Ss   Apr26   0:01 /usr/sbin/mgd -N
root        86  0.1  0.2 1053572 95040 ?       Ssl  Apr26   5:58 /usr/sbin/rpd -N
root        87  0.0  0.0 837400  6356 ?        Ss   Apr26   0:01 /usr/sbin/ppmd -N
root        88  0.0  0.0 842112  6460 ?        Ss   Apr26   0:01 /usr/sbin/bfdd -N
root       102  0.0  0.0  13244  1832 tty1     Ss+  Apr26   0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root       108  0.0  0.0  18500  3340 pts/1    Ss   Apr26   0:00 /bin/bash
root       119  0.0  0.0 739724 11936 pts/1    S+   Apr26   0:02 cli
root       120  0.0  0.0 1454680 12636 ?       Ss   Apr26   0:00 /usr/sbin/mgd -N
root      1502  0.0  0.0  34400  2704 ?        Rs   09:22   0:00 ps aux

Access 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

Pause and Resume 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

Remove 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

    content_copy zoom_out_map
    crpd01
  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

View 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.

View 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

content_copy zoom_out_map
CONTAINER ID   IMAGE                  COMMAND                  CREATED       STATUS       PORTS     NAMES
c99e2c74a19b   bad58561c4be           "/storage-provisioner"   12 days ago   Up 12 days             k8s_storage-provisioner_storage-provisioner_kube-system_14f342e7-fa2e-45d1-a970-6b698f521d3e_11
89c7c630fce2   5fb9aaddb236           "/etc/rc.local init"     3 weeks ago   Up 3 weeks             k8s_csrx_csrx_default_c605afd1-d9ff-4fb7-a290-fc8ce3cad1d7_0
3380dafdb0de   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_csrx_default_c605afd1-d9ff-4fb7-a290-fc8ce3cad1d7_0
e779780adc12   bfe3a36ebd25           "/coredns -conf /etc…"   3 weeks ago   Up 3 weeks             k8s_coredns_coredns-f9fd979d6-5nl6b_kube-system_15cfcff1-dbc1-498a-bf37-02427d30e603_3
7b9506570dec   635b36f4d89f           "/usr/local/bin/kube…"   3 weeks ago   Up 3 weeks             k8s_kube-proxy_kube-proxy-mq9nj_kube-system_841a45cf-de39-49a8-ae35-6313286c25bb_3
760f482b7cb3   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-proxy-mq9nj_kube-system_841a45cf-de39-49a8-ae35-6313286c25bb_3
eb8258e88c9b   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_coredns-f9fd979d6-5nl6b_kube-system_15cfcff1-dbc1-498a-bf37-02427d30e603_3
6d1946fcde75   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_storage-provisioner_kube-system_14f342e7-fa2e-45d1-a970-6b698f521d3e_3
8b0842e06094   4830ab618586           "kube-controller-man…"   3 weeks ago   Up 3 weeks             k8s_kube-controller-manager_kube-controller-manager-ix-crpd-01_kube-system_627d9013c9c4b1cbfb72b4c0ef6cd100_4
bce233248dda   b15c6247777d           "kube-apiserver --ad…"   3 weeks ago   Up 3 weeks             k8s_kube-apiserver_kube-apiserver-ix-crpd-01_kube-system_a22d3335af147e2c88f1d34b6067e650_7
5f7652e4adda   k8s.gcr.io/etcd        "etcd --advertise-cl…"   3 weeks ago   Up 3 weeks             k8s_etcd_etcd-ix-crpd-01_kube-system_dde4e023d8613808da88a63ff3c86e64_0
8280ab21d826   14cd22f7abe7           "kube-scheduler --au…"   3 weeks ago   Up 3 weeks             k8s_kube-scheduler_kube-scheduler-ix-crpd-01_kube-system_38744c90661b22e9ae232b0452c54538_3
f451a6be0a98   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_etcd-ix-crpd-01_kube-system_dde4e023d8613808da88a63ff3c86e64_0
5c0edfce83be   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-scheduler-ix-crpd-01_kube-system_38744c90661b22e9ae232b0452c54538_0
2d326fedb67c   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-controller-manager-ix-crpd-01_kube-system_627d9013c9c4b1cbfb72b4c0ef6cd100_0
7e3773affc73   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-apiserver-ix-crpd-01_kube-system_a22d3335af147e2c88f1d34b6067e650_0

root@ubuntu-vm18:~# docker ps

content_copy zoom_out_map
CONTAINER ID   IMAGE                  COMMAND                  CREATED       STATUS       PORTS     NAMES
c99e2c74a19b   bad58561c4be           "/storage-provisioner"   12 days ago   Up 12 days             k8s_storage-provisioner_storage-provisioner_kube-system_14f342e7-fa2e-45d1-a970-6b698f521d3e_11
89c7c630fce2   5fb9aaddb236           "/etc/rc.local init"     3 weeks ago   Up 3 weeks             k8s_csrx_csrx_default_c605afd1-d9ff-4fb7-a290-fc8ce3cad1d7_0
3380dafdb0de   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_csrx_default_c605afd1-d9ff-4fb7-a290-fc8ce3cad1d7_0
e779780adc12   bfe3a36ebd25           "/coredns -conf /etc…"   3 weeks ago   Up 3 weeks             k8s_coredns_coredns-f9fd979d6-5nl6b_kube-system_15cfcff1-dbc1-498a-bf37-02427d30e603_3
7b9506570dec   635b36f4d89f           "/usr/local/bin/kube…"   3 weeks ago   Up 3 weeks             k8s_kube-proxy_kube-proxy-mq9nj_kube-system_841a45cf-de39-49a8-ae35-6313286c25bb_3
760f482b7cb3   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-proxy-mq9nj_kube-system_841a45cf-de39-49a8-ae35-6313286c25bb_3
eb8258e88c9b   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_coredns-f9fd979d6-5nl6b_kube-system_15cfcff1-dbc1-498a-bf37-02427d30e603_3
6d1946fcde75   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_storage-provisioner_kube-system_14f342e7-fa2e-45d1-a970-6b698f521d3e_3
8b0842e06094   4830ab618586           "kube-controller-man…"   3 weeks ago   Up 3 weeks             k8s_kube-controller-manager_kube-controller-manager-ix-crpd-01_kube-system_627d9013c9c4b1cbfb72b4c0ef6cd100_4
bce233248dda   b15c6247777d           "kube-apiserver --ad…"   3 weeks ago   Up 3 weeks             k8s_kube-apiserver_kube-apiserver-ix-crpd-01_kube-system_a22d3335af147e2c88f1d34b6067e650_7
5f7652e4adda   k8s.gcr.io/etcd        "etcd --advertise-cl…"   3 weeks ago   Up 3 weeks             k8s_etcd_etcd-ix-crpd-01_kube-system_dde4e023d8613808da88a63ff3c86e64_0
8280ab21d826   14cd22f7abe7           "kube-scheduler --au…"   3 weeks ago   Up 3 weeks             k8s_kube-scheduler_kube-scheduler-ix-crpd-01_kube-system_38744c90661b22e9ae232b0452c54538_3
f451a6be0a98   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_etcd-ix-crpd-01_kube-system_dde4e023d8613808da88a63ff3c86e64_0
5c0edfce83be   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-scheduler-ix-crpd-01_kube-system_38744c90661b22e9ae232b0452c54538_0
2d326fedb67c   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-controller-manager-ix-crpd-01_kube-system_627d9013c9c4b1cbfb72b4c0ef6cd100_0
7e3773affc73   k8s.gcr.io/pause:3.2   "/pause"                 3 weeks ago   Up 3 weeks             k8s_POD_kube-apiserver-ix-crpd-01_kube-system_a22d3335af147e2c88f1d34b6067e650_0

Stop the Container

To stop the container:

You can stop the container using the following command:

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

footer-navigation