Step 2: Up and Running
Access the CLI
You configure Junos cRPD using Junos CLI commands for routing services. Here's how to access the Junos CLI:
- Log in to the Junos cRPD container.
rootuser@linux-host:~# docker exec -it crpd01 cli
- Check the Junos OS
version.
rootuser@crpd01> show version root@crpd01> show version Hostname: crpd01 Model: cRPD Junos: 21.2R1.10 cRPD package version : 21.2R1.10 built by builder on 2021-06-21 14:13:43 UTC
- Enter configuration
mode.
rootuser@crpd01> configure Entering configuration mode
- Add a password to the root administration user account. Enter a plain text
password.
[edit] rootuser@crpd01# set system root-authentication plain-text-password New password: Retype new password:
- Commit the
configuration.
[edit] rootuser@crpd01# commit commit complete
- Log in to the Junos cRPD instance with the CLI and continue customizing the configuration.
Interconnect cRPD Instances
Now let's learn how to build point-to-point links between two Junos cRPD containers.
In this example, we use two containers, crpd01 and crpd02, and connect them using eth1 interfaces that are connected to an OpenVswitch (OVS) bridge on the host. We're using an OVS bridge for Docker networking because it supports multiple host networking and provides secure communication. Refer to the following illustration:

- Install the OVS switch
utility.
rootuser@linux-host:~# apt-get install openvswitch-switch sudo] password for lab: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib openvswitch-common python python-minimal python-six python2.7 python2.7-minimal
- Navigate to the usr/bin directory path and use the
wget
command to download and to install the OVS docker.rootuser@linux-host:~# cd /usr/bin
rootuser@linux-host:~# wget "https://raw.githubusercontent.com/openvswitch/ovs/master/utilities/ovs-docker" --2021-07-14 07:55:17-- https://raw.githubusercontent.com/openvswitch/ovs/master/utilities/ovs-docker Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 8064 (7.9K) [text/plain] Saving to: âovs-docker.1â ovs-docker.1 100%[=====================================================================================>] 7.88K --.-KB/s in 0s 2021-07-14 07:55:17 (115 MB/s) - âovs-docker.1â saved [8064/8064]
- Change the permissions on the OVS
bridge.
rootuser@linux-host:/usr/bin chmod a+rwx ovs-docker
- Create another Junos cRPD container called crpd02.
rootuser@linux-host:~# docker run --rm --detach --name crpd02 -h crpd02 --net=bridge --privileged -v crpd02-config:/config -v crpd02-varlog:/var/log -it crpd:21.2R1.10 e18aec5bfcb8567ab09b3db3ed5794271edefe553a4c27a3d124975b116aa02
- Create a bridge called my-net. This step creates eth1 interfaces on crpd01 and
crdp02.
rootuser@linux-host:~# docker network create --internal my-net 37ddf7fd93a724100df023d23e98a86a4eb4ba2cbf3eda0cd811744936a84116
- Create an OVS bridge and add crpd01 and crpd02 containers with eth1
interfaces.
rootuser@linux-host:~# ovs-vsctl add-br crpd01-crpd02_1 rootuser@linux-host:~# ovs-docker add-port crpd01-crpd02_1 eth1 crpd01 rootuser@linux-host:~# ovs-docker add-port crpd01-crpd02_1 eth1 crpd02
- Add IP addresses to the eth1 interfaces and to the loopback
interfaces.
rootuser@linux-host:~# docker exec -d crpd01 ifconfig eth1 10.1.1.1/24 rootuser@linux-host:~# docker exec -d crpd02 ifconfig eth1 10.1.1.2/24 rootuser@linux-host:~# docker exec -d crpd01 ifconfig lo 10.255.255.1 netmask 255.255.255.255 rootuser@linux-host:~# docker exec -d crpd02 ifconfig lo 10.255.255.2 netmask 255.255.255.255
- Log in to the crpd01 container and verify the interface
configuration.
rootuser@linux-host:~# docker exec -it crpd01 bash rootuser@crpd01:/# ifconfig ..... 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::42:acff:fe12:2 prefixlen 64 scopeid 0x20<link> ether 02:42:ac:12:00:02 txqueuelen 0 (Ethernet) RX packets 24 bytes 2128 (2.1 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8 bytes 788 (788.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ........
- Send a ping to the crpd02 container to confirm connectivity between the two containers.
Use the IP address of eth1 of crpd02 (10.1.1.2) to ping the
container.
ping 10.1.1.2 -c 2 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
The output confirms that the two containers can communicate with each other.
Configure Open Shortest Path First (OSPF)
Now you have two containers, crpd01 and crpd02, that are connected and communicating. The next step is to establish neighbor adjacencies for the two containers. OSPF-enabled routers must form adjacencies with their neighbor before they can share information with that neighbor.
- Configure OSPF on the crpd01
container.
[edit] rootuser@crpd01# show policy-options policy-statement adv { term 1 { from { route-filter 10.10.10.0/24 exact; } then accept; } } [edit] rootuser@crpd01# show protocols ospf { area 0.0.0.0 { interface eth1; interface lo.0; } export adv; } [edit] rootuser@crpd01# show routing-options router-id 10.255.255.1; static { route 10.10.10.0/24 reject; }
- Commit the
configuration.
[edit] rootuser@crpd01# commit commit complete
- Repeat steps 1 and 2 to configure OSPF on the crpd02
container.
rootuser@crpd02# show policy-options policy-statement adv { term 1 { from { route-filter 10.20.20.0/24 exact; } then accept; } } [edit] rootuser@crpd02# show routing-options router-id 10.255.255.2; static { route 10.20.20.0/24 reject; } [edit] rootuser@crpd02# show protocols ospf area 0.0.0.0 { interface eth1; interface lo.0; } export adv;
- Use show commands to verify OSPF neighbors that have an immediate adjacency.
rootuser@crpd01> show ospf neighbor Address Interface State ID Pri Dead 10.1.1.2 eth1 Full 10.255.255.2 128 38
rootuser@crpd01> show ospf route Topology default Route Table: Prefix Path Route NH Metric NextHop Nexthop Type Type Type Interface Address/LSP 10.255.255.2 Intra AS BR IP 1 eth1 10.1.1.2 10.1.1.0/24 Intra Network IP 1 eth1 10.20.20.0/24 Ext2 Network IP 0 eth1 10.1.1.2 10.255.255.1/32 Intra Network IP 0 lo.0 10.255.255.2/32 Intra Network IP 1 eth1 10.1.1.2
The output shows the container's own loopback address and the loopback addresses of any containers which it is immediately adjacent to. The output confirms that the Junos cRPD has established an OSPF neighbor relationship and has learned their addresses and interfaces
View Junos cRPD Core Files
When a core file is generated, you can find the output in the /var/crash
folder. The generated core files are stored on the system that is hosting the Docker
containers.
- Change to the directory where crash files are stored.
rootuser@linux-host:~# cd /var/crash
- List the crash files.
rootuser@linux-host:/var/crash# ls -l total 32 -rw-r----- 1 root root 29304 Jul 14 15:14 _usr_bin_unattended-upgrade.0.crash
- Identify the location of the core files.
rootuser@linux-host:/var/crash# sysctl kernel.core_pattern kernel.core_pattern = |/bin/bash -c "$@" -- eval /bin/gzip > /var/crash/%h.%e.core.%t-%p-%u.gz