> For the complete documentation index, see [llms.txt](https://jncia-workbook.gitbook.io/workbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jncia-workbook.gitbook.io/workbook/intro/setup.md).

# Setup

These labs utilize containerlab. You will need a Linux server that has containerlab installed, and the proper images loaded into your local docker repo. This page walks you through that process.

I found containerlab to be preferential over EVE-NG or GNS3 for many reasons:

* Direct support for containers.
* Topology files and config files can be shared and version-controlled via github.
* Native SSH access is used to access the nodes, instead of console connections. This allows for scripting via SSH, which I use to transfer all startup configs to the nodes.
* Virtual hard drives of the nodes are not saved, so a single lab can take up literally KBs of storage.

Once you spend \~30 minutes setting this up, spinning up and loading labs from this workbook will be a breeze and you will have no friction while studying. This can save hours of manual work involved with creating new topologies, IP address configuration, etc.

## Host Requirements

You can install containerlab on a VM or bare-metal server. I prefer to use Ubuntu as the OS, but any Linux distro should work.

I recommend to have 12+ vCPU, 16GB+ memory, and 50-100GB of storage. The storage is mostly for the node images, so storage requirements are quite low.

If you are using bare-metal, ensure that CPU virtualization is enabled in BIOS on your server.&#x20;

If using a VM, ensure that Hardware virtualization is enabled.

<figure><img src="/files/lif9QIEM2rpdINOTl1we" alt=""><figcaption></figcaption></figure>

You may also choose to run containerlab directly on your PC. See here for details about running containerlab on Windows: <https://containerlab.dev/windows/>

## Installing Containerlab

Once the OS is installed, containerlab installation is as simple as running this single command:

```
curl -sL https://containerlab.dev/setup | sudo -E bash -s "all"
```

* Source: <https://containerlab.dev/quickstart/>

Clone the git repo for this workbook:

```
cd ~
git clone https://github.com/andrewohanian/jncia-junos-labs
```

Install required python packages:

```
sudo apt install python3-pip
cd jncia-junos-labs/
pip install -r requirements.txt
```

The management network is 10.200.255.0/24 for these labs. All you need to do is create a route in your router pointing 10.200.255.0/24 via the IP address of your containerlab server. For example, if your containerlab server has an IP address of 192.168.1.253:

```
ip route 10.200.255.0 255.255.255.0 192.168.1.253
```

If your containerlab server is on the same subnet as your computer, you could instead create a route on your local machine for 10.200.255.0/24 via \<containerlab server IP>:

```
Windows example:
route -p add 10.200.255.0 mask 255.255.255.0 192.168.1.253
```

## Images

Finally, you will need the correct images loaded into your docker container repo in order to run the topologies.

These lab utilize the vJunos-Router and vJunos-Switch. You must use vrnetlab to convert these into containers. The process is very straightforward.

First, clone the vrnetlab project:

```
cd ~
git clone https://github.com/hellt/vrnetlab.git
```

Next, download the two qcow2 images from these links. The images are 100% free, with no account required. Make sure to select version 25.4. If you want to use a different version, you will need to edit the containerlab topology files with the version you are using.

<https://support.juniper.net/support/downloads/?p=vjunos-router>

* Make sure to select **OS: vJunos-Router**

<https://support.juniper.net/support/downloads/?p=vjunos-switch>

When you click the qcow2 download button, you will need to accept a license agreement. Once you agree and proceed, copy the URL you are given. Change to the proper directory in vrnetlab, and download the image.

For the vJunosRouter:

```
cd vrnetlab/juniper/vjunosrouter/

! Download the file. Make sure to include the quotes.
wget -P . "<full download url>"

! Fix the filename, removing all trailing URL characters after .qcow2
mv <full filename> <short filename.qcow2>

! Example:
mv vJunos-router-25.4R1.12.qcow2\?SM_USER\=anon\&__gda__\=1783450214_ed6c7ljdf2532 vJunos-router-25.4R1.12.qcow2

! Build the container
make
```

For the vJunosSwitch:

```
cd vrnetlab/juniper/vjunosswitch/

! Download the file. Make sure to include the quotes.
wget -P . "<full download url>"

! Fix the filename, removing all trailing URL characters after .qcow2
mv <full filename> <short filename.qcow2>

! Example:
mv vJunos-switch-25.4R1.12.qcow2\?SM_USER\=anon\&__gda__\=1783450214_ed6c7ljdf2532 vJunos-switch-25.4R1.12.qcow2

! Build the container
make
```

The process will take a few minutes for each image. You can verify that it worked by using the command **docker image ls**:

```
clab@clab:~$ docker image ls
REPOSITORY                        TAG           IMAGE ID       CREATED         SIZE
vrnetlab/juniper_vjunos-switch    25.4R1.12     3b39604ccd70   21 hours ago    5.46GB
vrnetlab/juniper_vjunos-router    25.4R1.12     acb445c19722   2 weeks ago     4.83GB
```
