-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add vr-c8000v kind This is right now a verbatim copy of the existing vr-csr kind. I expect they will diverge in the future though, so it is best to create a copy now rather than encourage branching logic in the same file. * Bump github.com/containers/podman/v4 from 4.9.3 to 4.9.4 (#1964) Bumps [github.com/containers/podman/v4](https://github.com/containers/podman) from 4.9.3 to 4.9.4. - [Release notes](https://github.com/containers/podman/releases) - [Changelog](https://github.com/containers/podman/blob/v4.9.4/RELEASE_NOTES.md) - [Commits](containers/podman@v4.9.3...v4.9.4) --- updated-dependencies: - dependency-name: github.com/containers/podman/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * cRPD: allow root ssh directive (#1967) * cRPD: allow root ssh directive fixing: #1966 * remove version from the config template --------- Co-authored-by: Roman Dodin <dodin.roman@gmail.com> * Bump go to 1.21 (#1970) * bump go to 1.21 * change vmx link * fix another dead link * remove empty file * added envrc file * added c8000v docs --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Markus Vahlenkamp <github@vahlenkamp.net> Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
- Loading branch information
1 parent
0bf4958
commit 9b47e3a
Showing
9 changed files
with
216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
search: | ||
boost: 4 | ||
--- | ||
# Cisco c8000v | ||
|
||
The Cisco Catalyst 8000V Edge Software (Catalyst 8000V) is a virtual-form-factor router and is identified with `cisco_c8000v` kind in the [topology file](../topo-def-file.md). | ||
|
||
Cisco c8000v is a successor of [Cisco CSR1000v](../kinds/vr-csr.md) and is a **different** product from [Cisco 8000](../kinds/c8000.md) platform emulator. | ||
|
||
## Hardware resource requirements | ||
|
||
Each c8000v node is started with 1vCPU and 4GB of RAM by default. | ||
|
||
## Managing c8000v nodes | ||
|
||
/// note | ||
Cisco c8000v boots process takes around 5 minutes. To monitor boot progress: | ||
|
||
```bash | ||
docker logs -f <container-name/id> | ||
``` | ||
|
||
Wait for `Startup complete in: <time>` message. | ||
/// | ||
|
||
/// tab | SSH | ||
|
||
`ssh admin@<node-name>` | ||
Password: `admin` | ||
/// | ||
/// tab | bash | ||
to connect to a `bash` shell of a running c8000v container: | ||
|
||
```bash | ||
docker exec -it <container-name/id> bash | ||
``` | ||
|
||
/// | ||
|
||
/// note | ||
Default credentials: `admin:admin` | ||
/// | ||
|
||
## Interface naming convention | ||
|
||
c8000v container uses the following naming convention for its management and data interfaces: | ||
|
||
- `eth0` - management interface connected to the containerlab management network | ||
- `eth1` - Gi2 interface | ||
- `eth2` - Gi3 interface and so on. | ||
|
||
When containerlab launches c8000v node, it will set the static IPv4 address for the `eth0` interface and other interfaces will appear unset. | ||
|
||
``` | ||
node1#sh ip int br | ||
Interface IP-Address OK? Method Status Protocol | ||
GigabitEthernet1 10.0.0.15 YES manual up up | ||
GigabitEthernet2 unassigned YES unset administratively down down | ||
``` | ||
|
||
## Features and options | ||
|
||
### Default node configuration | ||
|
||
It is possible to launch nodes of `cisco_c8000v` kind with a basic config or to provide a custom config file that will be used as a startup config instead. | ||
|
||
When a node is defined without `startup-config` statement present, the node will boot with a factory config | ||
|
||
### User defined config | ||
|
||
With a [`startup-config`](../nodes.md#startup-config) property a user sets the path to the config file that will be mounted to a container and used as a startup-config: | ||
|
||
```yaml | ||
name: c8000v | ||
topology: | ||
nodes: | ||
c8000: | ||
kind: cisco_c8000v | ||
startup-config: r1.cfg | ||
``` | ||
|
||
When a config file is passed via `startup-config` parameter it will be used during an initial lab deployment. However, a config file that might be in the lab directory of a node takes precedence over the startup-config[^1]. | ||
|
||
## Lab examples | ||
|
||
```yaml | ||
name: c8000v | ||
topology: | ||
nodes: | ||
node1: | ||
kind: cisco_c8000v | ||
image: vrnetlab/vr-c8000v:17.11.01a | ||
node2: | ||
kind: cisco_c8000v | ||
image: vrnetlab/vr-c8000v:17.11.01a | ||
|
||
links: | ||
- endpoints: ["node1:eth1", "node2:eth1"] | ||
|
||
``` | ||
|
||
[^1]: if startup config needs to be enforced, either deploy a lab with `--reconfigure` flag, or use [`enforce-startup-config`](../nodes.md#enforce-startup-config) setting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Copyright 2020 Nokia | ||
// Licensed under the BSD 3-Clause License. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
package vr_c8000v | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"path" | ||
|
||
log "github.com/sirupsen/logrus" | ||
"github.com/srl-labs/containerlab/netconf" | ||
"github.com/srl-labs/containerlab/nodes" | ||
"github.com/srl-labs/containerlab/types" | ||
"github.com/srl-labs/containerlab/utils" | ||
) | ||
|
||
var ( | ||
kindnames = []string{"cisco_c8000v"} | ||
defaultCredentials = nodes.NewCredentials("admin", "admin") | ||
) | ||
|
||
const ( | ||
scrapliPlatformName = "cisco_iosxe" | ||
|
||
configDirName = "config" | ||
startupCfgFName = "startup-config.cfg" | ||
) | ||
|
||
// Register registers the node in the NodeRegistry. | ||
func Register(r *nodes.NodeRegistry) { | ||
r.Register(kindnames, func() nodes.Node { | ||
return new(vrC8000v) | ||
}, defaultCredentials) | ||
} | ||
|
||
type vrC8000v struct { | ||
nodes.DefaultNode | ||
} | ||
|
||
func (n *vrC8000v) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error { | ||
// Init DefaultNode | ||
n.DefaultNode = *nodes.NewDefaultNode(n) | ||
// set virtualization requirement | ||
n.HostRequirements.VirtRequired = true | ||
|
||
n.Cfg = cfg | ||
for _, o := range opts { | ||
o(n) | ||
} | ||
// env vars are used to set launch.py arguments in vrnetlab container | ||
defEnv := map[string]string{ | ||
"CONNECTION_MODE": nodes.VrDefConnMode, | ||
"USERNAME": defaultCredentials.GetUsername(), | ||
"PASSWORD": defaultCredentials.GetPassword(), | ||
"DOCKER_NET_V4_ADDR": n.Mgmt.IPv4Subnet, | ||
"DOCKER_NET_V6_ADDR": n.Mgmt.IPv6Subnet, | ||
} | ||
n.Cfg.Env = utils.MergeStringMaps(defEnv, n.Cfg.Env) | ||
|
||
// mount config dir to support startup-config functionality | ||
n.Cfg.Binds = append(n.Cfg.Binds, fmt.Sprint(path.Join(n.Cfg.LabDir, configDirName), ":/config")) | ||
|
||
if n.Cfg.Env["CONNECTION_MODE"] == "macvtap" { | ||
// mount dev dir to enable macvtap | ||
n.Cfg.Binds = append(n.Cfg.Binds, "/dev:/dev") | ||
} | ||
|
||
n.Cfg.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", | ||
n.Cfg.Env["USERNAME"], n.Cfg.Env["PASSWORD"], n.Cfg.ShortName, n.Cfg.Env["CONNECTION_MODE"]) | ||
|
||
return nil | ||
} | ||
|
||
func (s *vrC8000v) PreDeploy(_ context.Context, params *nodes.PreDeployParams) error { | ||
utils.CreateDirectory(s.Cfg.LabDir, 0777) | ||
_, err := s.LoadOrGenerateCertificate(params.Cert, params.TopologyName) | ||
if err != nil { | ||
return nil | ||
} | ||
return nodes.LoadStartupConfigFileVr(s, configDirName, startupCfgFName) | ||
} | ||
|
||
func (n *vrC8000v) SaveConfig(_ context.Context) error { | ||
err := netconf.SaveConfig(n.Cfg.LongName, | ||
defaultCredentials.GetUsername(), | ||
defaultCredentials.GetPassword(), | ||
scrapliPlatformName, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
log.Infof("saved %s running configuration to startup configuration file\n", n.Cfg.ShortName) | ||
return nil | ||
} | ||
|
||
// CheckInterfaceName checks if a name of the interface referenced in the topology file correct. | ||
func (n *vrC8000v) CheckInterfaceName() error { | ||
return nodes.GenericVMInterfaceCheck(n.Cfg.ShortName, n.Endpoints) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters