Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vJunos-Router kind based on existing vJunos-switch implementation #2063

Merged
merged 7 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ var interfaceFormat = map[string]string{

var supportedKinds = []string{
"srl", "ceos", "linux", "bridge", "sonic-vs", "crpd", "vr-sros", "vr-vmx", "vr-vsrx",
"vr-vqfx", "vr-vjunosswitch", "vr-xrv9k", "vr-veos", "xrd", "rare", "openbsd", "cisco_ftdv",
"freebsd",
"vr-vqfx", "juniper_vjunosevolved", "juniper_vjunosrouter", "juniper_vjunosswitch", "vr-xrv9k", "vr-veos",
"xrd", "rare", "openbsd", "cisco_ftdv", "freebsd",
}

const (
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ In addition to native containerized NOSes, containerlab can launch traditional v
* [Juniper vMX](manual/kinds/vr-vmx.md)
* [Juniper vQFX](manual/kinds/vr-vqfx.md)
* [Juniper vSRX](manual/kinds/vr-vsrx.md)
* [Juniper vJunos Switch](manual/kinds/vr-vjunosswitch.md)
* [Juniper vJunos-router](manual/kinds/vr-vjunosrouter.md)
* [Juniper vJunos-switch](manual/kinds/vr-vjunosswitch.md)
* [Juniper vJunos Evolved](manual/kinds/vr-vjunosevolved.md)
* [Cisco IOS XRv9k](manual/kinds/vr-xrv9k.md)
* [Cisco Nexus 9000v](manual/kinds/vr-n9kv.md)
Expand Down
1 change: 1 addition & 0 deletions docs/manual/kinds/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Within each predefined kind, we store the necessary information that is used to
| **Juniper vMX** | [`vr-vmx/vr-juniper_vmx`](vr-vmx.md) | supported | VM |
| **Juniper vQFX** | [`vr-vqfx/vr-juniper_vqfx`](vr-vqfx.md) | supported | VM |
| **Juniper vSRX** | [`vr-vsrx/vr-juniper_vsrx`](vr-vsrx.md) | supported | VM |
| **Juniper vJunos-router** | [`vr-vjunosrouter/juniper_vjunosrouter`](vr-vjunosrouter.md) | supported | VM |
| **Juniper vJunos-switch** | [`vr-vjunosswitch/juniper_vjunosswitch`](vr-vjunosswitch.md) | supported | VM |
| **Juniper vJunosEvolved** | [`vr-vjunosevolved/juniper_vjunosevolved`](vr-vjunosevolved.md) | supported | VM |
| **Cisco XRd** | [`xrd/cisco_xrd'](xrd.md) | supported | container |
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/kinds/vr-vjunosevolved.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ search:
---
# Juniper vJunosEvolved

[Juniper vJunosEvolved](https://support.juniper.net/support/downloads/?p=vjunos-evolved) is a virtualized PTX10001 router identified with `juniper_vjunosevolved` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.
[Juniper vJunosEvolved](https://www.juniper.net/documentation/product/us/en/vjunosevolved/) is a virtualized PTX10001 router identified with `juniper_vjunosevolved` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.

Juniper vJunosEvolved nodes launched with containerlab come up pre-provisioned with SSH, SNMP, NETCONF and gNMI services enabled.

## How to obtain the image

The qcow2 image can be downloaded from [Juniper website](https://support.juniper.net/support/downloads/?p=vjunos-evolved) and built with [vrnetlab](../vrnetlab.md).
The qcow2 image can be freely downloaded from the [Juniper support portal](https://support.juniper.net/support/downloads/?p=vjunos-evolved) without a Juniper account and built with [vrnetlab](../vrnetlab.md).

## Managing Juniper vJunosEvolved nodes

Expand Down
79 changes: 79 additions & 0 deletions docs/manual/kinds/vr-vjunosrouter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
search:
boost: 4
---
# Juniper vJunos-router

[Juniper vJunos-router](https://www.juniper.net/documentation/product/us/en/vjunos-router/) is a virtualized MX router, a single-VM version of the vMX that requires no feature licenses and is meant for lab/testing use. It is identified with `juniper_vjunosrouter` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.

Juniper vJunos-router nodes launched with containerlab come up pre-provisioned with SSH, SNMP, NETCONF and gNMI services enabled.

## How to obtain the image

The qcow2 image can be freely downloaded from the [Juniper support portal](https://support.juniper.net/support/downloads/?p=vjunos-router) without a Juniper account and built with [vrnetlab](../vrnetlab.md).

## Managing Juniper vJunos-router nodes

!!!note
Containers with vJunos-router inside can take up to ~5-10min to fully boot.
You can monitor the progress with `docker logs -f <container-name>`.

Juniper vJunos-router node launched with containerlab can be managed via the following interfaces:

=== "bash"
to connect to a `bash` shell of a running Juniper vJunos-router container:
```bash
docker exec -it <container-name/id> bash
```
=== "CLI via SSH"
to connect to the vJunos-router CLI
```bash
ssh admin@<container-name/id>
```
=== "NETCONF"
NETCONF server is running over port 830
```bash
ssh admin@<container-name> -p 830 -s netconf
```

!!!info
Default user credentials: `admin:admin@123`

## Interfaces mapping

Juniper vJunos-router container can have up to 11 interfaces and uses the following mapping rules:

* `eth0` - management interface connected to the containerlab management network
* `eth1` - first data interface, mapped to a first data port of vJunos-router VM
* `eth2+` - second and subsequent data interface

When containerlab launches Juniper vJunos-router node, it will assign IPv4/6 address to the `eth0` interface. These addresses can be used to reach the management plane of the router.

Data interfaces `eth1+` need to be configured with IP addressing manually using CLI/management protocols or via a startup-config text file.

## Features and options

### Node configuration

Juniper vJunos-router nodes come up with a basic configuration supplied by a mountable configuration disk to the main VM image. Users, management interfaces, and protocols such as SSH and NETCONF are configured.

#### Startup configuration

It is possible to make vJunos-router nodes boot up with a user-defined startup-config instead of a built-in one. With a [`startup-config`](../nodes.md#startup-config) property of the node/kind user sets the path to the config file that will be mounted to a container and used as a startup-config:

```yaml
topology:
nodes:
node:
kind: juniper_vjunosrouter
startup-config: myconfig.txt
```

With this knob containerlab is instructed to take a file `myconfig.txt` from the directory that hosts the topology file, and copy it to the lab directory for that specific node under the `/config/startup-config.cfg` name. Then the directory that hosts the startup-config dir is mounted to the container. This will result in this config being applied at startup by the node.

Configuration is applied after the node is started, thus it can contain partial configuration snippets that you desire to add on top of the default config that a node boots up with.

## Known issues and limitations

* vJunos-router requires Linux kernel 4.17+
* To check the boot log, use `docker logs -f <node-name>`.
4 changes: 2 additions & 2 deletions docs/manual/kinds/vr-vjunosswitch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ search:
---
# Juniper vJunos-switch

[Juniper vJunos-switch](https://support.juniper.net/support/downloads/?p=vjunos) is a virtualized EX9214 switch identified with `juniper_vjunosswitch` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.
[Juniper vJunos-switch](https://www.juniper.net/documentation/product/us/en/vjunos-switch/) is a virtualized EX9214 switch identified with `juniper_vjunosswitch` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.

Juniper vJunos-switch nodes launched with containerlab come up pre-provisioned with SSH, SNMP, NETCONF and gNMI services enabled.

## How to obtain the image

The qcow2 image can be downloaded from [Juniper website](https://support.juniper.net/support/downloads/?p=vjunos) and built with [vrnetlab](../vrnetlab.md).
The qcow2 image can be freely downloaded from the [Juniper support portal](https://support.juniper.net/support/downloads/?p=vjunos-switch) without a Juniper account and built with [vrnetlab](../vrnetlab.md).

## Managing Juniper vJunos-switch nodes

Expand Down
1 change: 1 addition & 0 deletions docs/manual/vrnetlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The images that work with containerlab will appear in the supported list as we i
| Juniper vMX | [juniper_vmx](kinds/vr-vmx.md) | [SRL & vMX](../lab-examples/vr-vmx.md) | |
| Juniper vQFX | [juniper_vqfx](kinds/vr-vqfx.md) | | |
| Juniper vSRX | [juniper_vsrx](kinds/vr-vsrx.md) | | |
| Juniper vJunos-Router | [juniper_vjunosrouter](kinds/vr-vjunosrouter.md) | | |
| Juniper vJunos-Switch | [juniper_vjunosswitch](kinds/vr-vjunosswitch.md) | | |
| Juniper vJunosEvolved | [juniper_vjunosevolved](kinds/vr-vjunosevolved.md) | | |
| Cisco XRv | [cisco_xrv](kinds/vr-xrv.md) | [SRL & XRv](../lab-examples/vr-xrv.md) | |
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nav:
- Juniper vMX: manual/kinds/vr-vmx.md
- Juniper vQFX: manual/kinds/vr-vqfx.md
- Juniper vSRX: manual/kinds/vr-vsrx.md
- Juniper vJunos-router: manual/kinds/vr-vjunosrouter.md
- Juniper vJunos-switch: manual/kinds/vr-vjunosswitch.md
- Juniper vJunosEvolved: manual/kinds/vr-vjunosevolved.md
- Cisco XRd: manual/kinds/xrd.md
Expand Down
2 changes: 1 addition & 1 deletion nodes/vr_vjunosswitch/vr-vjunosswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

var (
kindnames = []string{"juniper_vjunosswitch"}
kindnames = []string{"juniper_vjunosrouter", "juniper_vjunosswitch"}
defaultCredentials = nodes.NewCredentials("admin", "admin@123")
)

Expand Down
6 changes: 4 additions & 2 deletions schemas/clab.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"vr-vsrx",
"vr-juniper_vsrx",
"juniper_vsrx",
"vr-vjunosswitch",
"vr-juniper_vjunosswitch",
"juniper_vjunosrouter",
"juniper_vjunosswitch",
"juniper_vjunosevolved",
"vr-xrv",
Expand Down Expand Up @@ -902,6 +901,9 @@
"vr-vsrx": {
"$ref": "#/definitions/node-config"
},
"juniper_vjunosrouter": {
"$ref": "#/definitions/node-config"
},
"juniper_vjunosswitch": {
"$ref": "#/definitions/node-config"
},
Expand Down
Loading