Configure cJunosEvolved on Docker
Read this topic to understand the connections and configurations of the cJunosEvolved instances deployment on KVM
Connect to cJunosEvolved
You can SSH to the cJunosEvolved from the Ubuntu host as shown in this section using the admin credentials:
The Management IP address is what was specified in for “eth0_mgmt” under the networks section for the specific container in the Docker Compose YAML file.
Each cJunosEvolved is configured for SSH access using the admin credentials. The admin password is “admin@123”.
You can set a root authentication plain-text password for cJunosEvolved if you prefer root access. This is done in the same way as for any JunosEvolved router. Also enable the SSH as root user if you prefer to login as root:
set system root-authentication plain-text-password <enter the
password twice>
set system services ssh root-login allow
# ssh admin@<management IP address> (admin@14.1.1.3) Password: Last login: Thu Mar 20 21:06:48 2025 from 14.1.1.1 --- JUNOS cJunosEvolved-25.2R1.1-EVO Linux (none) 5.15.164-10.22.33.18-yocto-standard-juniper-16971-g1c568856e6a0 #1 SMP PREEMPT Thu Feb 6 08:43:02 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux admin@re0>
An alternative to ssh is to use the following command from the Host Server, to
enter the CLI and configure the container. It is best to run this command after
you have run “docker logs -f cevo1
command and seen the
container (called cevo1 in this example) has reached login prompt.
# docker exec -ti cevo1 cli
root@cevo1>
Configure cJunosEvolved
There are multiple ways to configure cJunosEvolved:
Manual Configuration
You can connect to the EVO VM within the cJunosEvolved container through either ssh or the Docker command mentioned in the “Connect to cJunosEvolved” section and proceed to configure the container.
Disk Configuration
Specify a hierarchical Junos Evolved CLI configuration through the “volumes” stanza of the Docker Compose YAML file. In the example below:
There needs to be a valid hierarchical configuration file, called juniper.conf in a directory on your Host Server for the specific container, such as the below directory, for example: /root/cjunosevo/config/cevo1
cJunosEvolved software expects the juniper.conf
file to be
placed in its /home/evo/configdisk
directory in the Linux side
of the container. See below:
services: cJunosEvo1: #[snip] privileged: true volumes: -'/root/cjunosevo/config/cevo1:/home/evo/configdisk'
Automatic Configuration
Another option is to have cJunosEvolved auto configured through the CPTX_AUTO_CONFIG environment variable being set to 1 as previously described in this manual.
The autoconfigure option is a more minimal configuration tool than the Disk configuration. It is mutually exclusive with the Disk Configuration option and takes precedence over it.
Auto configuration does a startup configuration for cJunosEvolved based on extracting the information from the Docker Compose YAML file. Auto configuration can configure the following:
-
- The admin login credentials:
- userid: admin
- password: admin@123
- To enable ssh run the
set system services ssh
command. - The default logging level is set as
follows:
set system syslog file interactive-commands interactive-commands any
set system syslog file messages any notice
set system syslog file messages authorization info
- The management IP of cJunosEvolved based on the value specified for “eth0_managment”
- The data interface “ipv4_address” values for interfaces starting from eth4 as specified in the Compose YAML file are configured in the startup configuration of the RE. The interface notation used in the CLI is automatically configured based on the environment variables indicating whether BX or BT, channelized or unchannelized notation should be used. See the WAN Interface tables in this manual for more details.
- The admin login credentials:
For example, in the case of a BX channelized cJunosEvolved being auto configured, if the Docker Compose YAML file has:
eth4: ipv4_address: 100.1.1.2 # and this in the “networks” section: networks: eth4: name: eth4 driver: bridge ipam: driver: default config: - subnet: 100.1.1.0/24
Then run the set interfaces et-0/0/0:0 unit 0 family inet address
100.1.1.2/24
command. This configuration will be set in the Routing
Engine CLI.
In addition, depending on whether BX or BT, channelized or unchannelized, the corresponding general interface related configuration will be set in the Routing Engine CLI for all the data interfaces. The example below is for the first data interface (eth4) of a channelized BX:
set interfaces et-0/0/0 number-of-sub-ports 4
set interfaces et-0/0/0 speed 100g
If the “CPTX_AUTO_CONFIG: 1” environmental variable is set in the Docker Compose YAML file and no IPv4 address is specified for a data interface in the same file, cJunosEvolved will assign an IP address based on what Docker provides it. For example, if a subnet IP is specified for the corresponding data interface, Docker will assign an IP address from that subnet, and this will be configured in the cJunosEvolved Routing Engine CLI for the corresponding interface. The recommendation is to provide the IP address for each interface in the services section of the YAML file and a matching subnet IP address for that network in the “networks” section of the YAML file when using CPTX_AUTO_CONFIG, so you have control over the IP addresses.
How to Stop, Start, and Restart cJunosEvolved
Stop
The cJunosEvolved containers in a Docker Compose file can be stopped
simultaneously in a graceful manner so its disk is preserved for the next
restart. Run the stop
command from the host server:
# docker compose -f <docker-compose-filename>.yaml stop -t
<secs>
The -t option asks Docker Compose to wait the specified number of seconds, before it sends a SIGTERM to the container. The value of the timeout to specify, depends on various factors including the size of logs and configuration stored in the container and the disk speed of the host server. In testing, a -t value of 240 secs has been sufficient and usually it is less than 60 secs. Please benchmark this value for your use case as follows:
- From the host server, start monitoring the EVO VM logs using the
docker logs -f <container-name>
command. This will print ongoing logs from EVO VM. -
Issue the
stop
command with a larger -t value as follows:# docker compose -f <docker-compose-filename>.yaml stop -t 240
- You will see the container logs as it is getting notified of the
stop
command and proceeds accordingly. For a successful shutdown, a message like below should be seen at the end of the logs:Fri Mar 28 22:40:14 UTC 2025: EVO VM shutdown successfully in [30secs]
Once cJunosEvolved is stopped, “docker container ls” will not show it but its networks are preserved for a future restart and can be seen as shown in the example below:
# docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 171a361a6f86 cjunosevolved:25.2R1.1-EVO "/entrypoint.sh" 3 days ago Up 3 days cevo2 740524cf95b3 cjunosevolved:25.2R1.1-EVO "/entrypoint.sh" 3 days ago Up 3 days cevo1 # docker compose -f dual-bx-bt-chan-autocompose.yaml stop -t 180 [+] Stopping 2/2 ✔ Container cevo1 Stopped 36.9s ✔ Container cevo2 Stopped 36.9s # docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES # docker network ls NETWORK ID NAME DRIVER SCOPE 785df5e996d5 bridge bridge local 6222dbea40c6 eth0_mgmt bridge local fb5a95cd7236 eth1_reserved bridge local cec52e294667 eth2_reserved bridge local 4f6d181ab5ec eth3_reserved bridge local 3a8ccd8d44dc eth4 bridge local 4e701a843d95 eth5 bridge local 6e3035f60692 eth6 bridge local bf4f5b2583aa eth7 bridge local 0f8822dda3ab eth8 bridge local 507f0ad3feaf eth9 bridge local 4af981ed503e eth10 bridge local 7d280f0f348a eth11 bridge local 2304e4ab7184 host host local da25cbdc438c none null local
Verify that both the containers are stopped successfully using the docker
logs
command:
# docker logs cevo1 [snip] Tue Apr 1 00:00:24 UTC 2025: EVO VM shutdown successfully in [30secs] # docker logs cevo2 [snip] Tue Apr 1 00:00:24 UTC 2025: EVO VM shutdown successfully in [30secs]
Start
Stopped containers can be started again using the docker compose
start
command.
For a fresh installation, use the docker compose up -d
command
as previously shown in this document.
The following example illustrates the docker compose start
.
# docker compose -f <docker-compose-file-name> [+] Running 2/2 ✔ Container cevo1 Started 6.2s ✔ Container cevo2 Started 6.2s # docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 171a361a6f86 cjunosevolved:25.2R1.1-EVO "/entrypoint.sh" 3 days ago Up 54 seconds cevo2 740524cf95b3 cjunosevolved:25.2R1.1-EVO "/entrypoint.sh" 3 days ago Up 54 seconds cevo1 You can monitor the console of EVOVM as it boots up via the following command. It should show cJunosEvolved reach login prompt and shows in this case it took 66 seconds to do so. #docker logs -f <container-name> Tue Apr 1 00:47:41 UTC 2025: EVO VM boot Done in [66secs] Tue Apr 1 00:47:41 UTC 2025: entrypoint.sh is done, enter wait loop.. re0 login:
Restart
You can restart running containers, using the docker compose -f
<docker-compose-file-name> restart -t 90
command.
Provide a “-t” you have benchmarked as previously mentioned in the stop section.
A restart
command is a stop
and then a
start
command sequentially, so Docker Compose needs to be
told how long to provide the container to stop gracefully to protect the
container disk as mentioned in the Stop section above.
For example:
# docker compose -f <docker-compose-file-name>dual-bx-bt-chan-autocompose.yaml restart -t 90 [+] Restarting 2/2 ✔ Container cevo1 Started 41.1s ✔ Container cevo2 Started In this case, the container was stopped gracefully in 30 secs as shown in the “docker logs” command. It was restarted as shown above. Tue Apr 1 00:58:18 UTC 2025: EVO VM shutdown successfully in [30secs]