Skip to content

Commit

Permalink
Merge pull request #238 from srl-wim/vr-xrv
Browse files Browse the repository at this point in the history
added Cisco XRv kind
  • Loading branch information
hellt committed Jan 22, 2021
2 parents 6713c50 + bc6f3ae commit e1f4498
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 4 deletions.
18 changes: 17 additions & 1 deletion clab/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
)

// supported kinds
var kinds = []string{"srl", "ceos", "linux", "alpine", "bridge"}
var kinds = []string{"srl", "ceos", "crpd", "vr-sros", "vr-vmx", "vr-xrv", "linux", "bridge"}

var defaultConfigTemplates = map[string]string{
"srl": "/etc/containerlab/templates/srl/srlconfig.tpl",
Expand Down Expand Up @@ -551,6 +551,22 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error {

node.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", node.Env["USERNAME"], node.Env["PASSWORD"], node.ShortName, node.Env["CONNECTION_MODE"])

case "vr-xrv":
node.Image = c.imageInitialization(&nodeCfg, node.Kind)
node.Group = c.groupInitialization(&nodeCfg, node.Kind)
node.Position = c.positionInitialization(&nodeCfg, node.Kind)
node.User = user

// env vars are used to set launch.py arguments in vrnetlab container
defEnv := map[string]string{
"USERNAME": "clab",
"PASSWORD": "clab@123",
"CONNECTION_MODE": "bridge",
}
node.Env = mergeStringMaps(defEnv, envs)

node.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", node.Env["USERNAME"], node.Env["PASSWORD"], node.ShortName, node.Env["CONNECTION_MODE"])

case "alpine", "linux":
node.Config = c.configInitialization(&nodeCfg, node.Kind)
node.Image = c.imageInitialization(&nodeCfg, node.Kind)
Expand Down
28 changes: 28 additions & 0 deletions docs/lab-examples/vr-xrv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
| | |
| ----------------------------- | -------------------------------------------------------------------------------- |
| **Description** | A Nokia SR Linux connected back-to-back with Cisco XRv |
| **Components** | [Nokia SR Linux][srl], Cisco XRv |
| **Resource requirements**[^1] | :fontawesome-solid-microchip: 1 <br/>:fontawesome-solid-memory: 3 GB |
| **Topology file** | [vr03.yml][topofile] |
| **Name** | vr03 |
| **Version information**[^2] | `containerlab:0.9.0`, `srlinux:20.6.3-145`, `vr-xrv:6.1.2`, `docker-ce:19.03.13` |

## Description
A lab consists of an SR Linux node connected with Cisco XRv via a point-to-point ethernet link. Both nodes are also connected with their management interfaces to the `clab` docker network.

Cisco XRv VM is launched as a container, using [vrnetlab integration](../manual/vrnetlab.md).

<div class="mxgraph" style="max-width:100%;border:1px solid transparent;margin:0 auto; display:block;" data-mxgraph="{&quot;page&quot;:0,&quot;zoom&quot;:1.5,&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;check-visible-state&quot;:true,&quot;resize&quot;:true,&quot;url&quot;:&quot;https://raw.githubusercontent.com/srl-wim/container-lab/diagrams/vr03.drawio&quot;}"></div>

## Use cases
This lab allows users to launch basic interoperability scenarios between Nokia SR Linux and Cisco XRv network operating systems.

The lab directory [contains](https://github.com/srl-wim/container-lab/tree/master/lab-examples/vr03) files with essential configurations which can be used to jumpstart the interop demonstration.

[srl]: https://www.nokia.com/networks/products/service-router-linux-NOS/
[topofile]: https://github.com/srl-wim/container-lab/tree/master/lab-examples/vr03/vr03.yml

[^1]: Resource requirements are provisional. Consult with the installation guides for additional information.
[^2]: The lab has been validated using these versions of the required tools/components. Using versions other than stated might lead to a non-operational setup process.

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/hellt/drawio-js@main/embed2.js" async></script>
63 changes: 63 additions & 0 deletions docs/manual/kinds/vr-xrv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Cisco XRv

[Cisco XRv](https://www.juniper.net/us/en/products-services/routing/mx-series/XRv/) virtualized router is identified with `vr-xrv` 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.

vr-xrv nodes launched with containerlab comes up pre-provisioned with SSH, SNMP, NETCONF and gNMI (if available) services enabled.

## Managing vr-xrv nodes

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

Cisco XRv node launched with containerlab can be managed via the following interfaces:

=== "bash"
to connect to a `bash` shell of a running vr-xrv container:
```bash
docker exec -it <container-name/id> bash
```
=== "CLI via SSH"
to connect to the XRv CLI
```bash
ssh admin@<container-name/id>
```
=== "NETCONF"
NETCONF server is running over port 830
```bash
ssh admin@<container-name> -p 830 -s netconf
```
=== "gNMI"
using the best in class [gnmic](https://gnmic.kmrd.dev) gNMI client as an example:
```bash
gnmic -a <container-name/node-mgmt-address> --insecure \
-u clab -p clab@123 \
capabilities
```

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

## Interfaces mapping
vr-xrv container can have up to 90 interfaces and uses the following mapping rules:

* `eth0` - management interface connected to the containerlab management network
* `eth1` - first data interface, mapped to first data port of XRv line card
* `eth2+` - second and subsequent data interface

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

Data interfaces `eth1+` needs to be configured with IP addressing manually using CLI/management protocols.


## Features and options
### Node configuration
vr-xrv nodes come up with a basic configuration where only the control plane and line cards are provisioned, as well as the `clab` user and management interfaces such as NETCONF, SNMP, gNMI.

## Lab examples
The following labs feature vr-xrv node:

- [SR Linux and Cisco XRv](../../lab-examples/vr-xrv.md)

## Known issues and limitations
* LACP and BPDU packets are not propagated to/from vrnetlab based routers launched with containerlab.
10 changes: 9 additions & 1 deletion docs/manual/vrnetlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ To build a container image with SR OS inside users should follow [the instructio
#### Juniper vMX
Juniper's virtualized MX router - vMX - has been added to containerlab supported kinds under the [vr-vmx](kinds/vr-vmx.md) kind. A [demo lab](../lab-examples/vr-vmx.md) explains the way this kind can be used.

To build a container image with SR OS inside users should follow [the instructions](https://github.com/hellt/vrnetlab/tree/master/vmx#building-the-docker-image) provided and using the code of the forked version of a vrnetlab project.
To build a container image with vMX inside users should follow [the instructions](https://github.com/hellt/vrnetlab/tree/master/vmx#building-the-docker-image) provided and using the code of the forked version of a vrnetlab project.

#### Cisco XRv
Cisco's virtualized XR router (demo) - XRv - has been added to containerlab supported kinds under the [vr-xrv](kinds/vr-xrv.md) kind. A [demo lab](../lab-examples/vr-xrv.md) explains the way this kind can be used.

!!!note
`vr-xrv` kind is not suitable for XRv 9000 images.

To build a container image with XRv inside users should follow [the instructions](https://github.com/hellt/vrnetlab/tree/master/xrv#building-the-docker-image) provided and using the code of the forked version of a vrnetlab project.

### Limitations
* LACP and BPDU packets can not be delivered to/from VM's running inside the containers when launched with containerlab.
2 changes: 0 additions & 2 deletions lab-examples/vr02/vr02.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ topology:
vmx:
kind: vr-vmx
image: vrnetlab/vr-vmx:20.2R1.10
env:
CONNECTION_MODE: vrxcon

links:
- endpoints: ["srl:e1-1", "vmx:eth1"]
9 changes: 9 additions & 0 deletions lab-examples/vr03/srl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enter candidate
set / interface ethernet-1/1
set / interface ethernet-1/1 admin-state enable
set / interface ethernet-1/1 subinterface 0
set / interface ethernet-1/1 subinterface 0 ipv4
set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.1.1/24
set / network-instance default
set / network-instance default interface ethernet-1/1.0
commit now
14 changes: 14 additions & 0 deletions lab-examples/vr03/vr03.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: vr03

topology:
nodes:
srl:
kind: srl
image: srlinux:20.6.3-145
license: license.key
xrv:
kind: vr-xrv
image: vrnetlab/vr-xrv:6.1.2

links:
- endpoints: ["srl:e1-1", "xrv:eth1"]
3 changes: 3 additions & 0 deletions lab-examples/vr03/xrv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
configure
interface Gi0/0/0/0 ipv4 address 192.168.1.2 255.255.255.0
commit
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nav:
- ceos - Arista cEOS: manual/kinds/ceos.md
- vr-sros - Nokia SR OS: manual/kinds/vr-sros.md
- vr-vmx - Juniper vMX: manual/kinds/vr-vmx.md
- vr-xrv - Cisco XRv: manual/kinds/vr-xrv.md
- Configuration artifacts: manual/conf-artifacts.md
- Network wiring concepts: manual/network.md
- Packet capture & Wireshark: manual/wireshark.md
Expand All @@ -36,6 +37,7 @@ nav:
- WAN topology: lab-examples/wan.md
- SR Linux and Nokia SR OS: lab-examples/vr-sros.md
- SR Linux and Juniper vMX: lab-examples/vr-vmx.md
- SR Linux and Cisco XRv: lab-examples/vr-xrv.md

site_author: Roman Dodin
site_description: >-
Expand Down

0 comments on commit e1f4498

Please sign in to comment.