diff --git a/README.md b/README.md index f6335d78b..65d480c58 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,16 @@ ## Description Container-lab binary is setting up and destroying labs for networking containers. -Currently supporting standard linux containers as clients and networkign containers using SR-Linux +Currently supporting standard linux containers as clients and networking containers using Nokia SR-Linux, Arista cEOS ## installation +### cloning the repo + git clone https://github.com/srl-wim/container-lab +### using rpm installation + rpm -i contaianerlab-1.0.0.x86_64.rpm ## Usage @@ -21,11 +25,11 @@ There are some examples in the labs sub directory ### Deploy the lab -sudo ./containerlab -a deploy +sudo ./containerlab -t labs/wan-topo.yml -a deploy ### destroy the lab -sudo ./containerlab -a destroy +sudo ./containerlab -t labs/wan-topo.yml -a destroy ### generating a graph @@ -35,3 +39,19 @@ containerlab has the option to generate a topology graph using graphviz that can dot -Tps graph/wan-topo.dot -o graph/wan-topo.ps dot -Tpng -Gdpi=300 graph/wan-topo.dot > graph/wan-topo.png + +## logging in into the containers + +### SRL + +#### SRL login to the cli shell + +docker exec -ti sr_cli + +#### SRL login to the bash shell + +docker exec -ti /bin.bash + +### cEOS + +docker exec -ti Cli diff --git a/bin/containerlab b/bin/containerlab index 8bb4fdaec..acfd2077e 100755 Binary files a/bin/containerlab and b/bin/containerlab differ diff --git a/labs/fabric-topo.yml b/labs/fabric-topo.yml index e69de29bb..bacb1e042 100644 --- a/labs/fabric-topo.yml +++ b/labs/fabric-topo.yml @@ -0,0 +1,18 @@ +Prefix: test +Docker_info: + bridge: srlinux_bridge + ipv4_subnet: "172.19.19.0/24" + ipv6_subnet: "2001:172:19:19::/80" + +SRL_image: srlinux:20.6.1-286 +SRL_config: srl_config/test.json +SRL_license: srl_config/license.key +Client_image: henderiw/client-alpine:1.0.0 + +Duts: + wan1: ["srl", "bb", "ixr6", "srl_config/config.json"] + wan2: ["srl", "bb", "ixr6", "srl_config/config.json"] + + +Links: + - endpoints: ["wan1:e1-1", "wan2:e1-1"] diff --git a/src/config.go b/src/config.go index ad5bdcc56..c3299d5cc 100644 --- a/src/config.go +++ b/src/config.go @@ -63,6 +63,9 @@ type Node struct { Binds []string Pid int Cid string + MgmtIPv4 string + MgmtIPv6 string + MgmtMac string } // Link is a struct that contains the information of a link between 2 containers diff --git a/src/docker.go b/src/docker.go index 18785f723..73098a7d1 100644 --- a/src/docker.go +++ b/src/docker.go @@ -141,7 +141,12 @@ func (d *Docker) createContainer(name string, node *Node) (err error) { return err } node.Pid = s.State.Pid + node.MgmtIPv4 = s.NetworkSettings.Networks["srlinux_bridge"].IPAddress + node.MgmtIPv6 = s.NetworkSettings.Networks["srlinux_bridge"].GlobalIPv6Address + node.MgmtMac = s.NetworkSettings.Networks["srlinux_bridge"].MacAddress + log.Debug("Container pid: ", node.Pid) + log.Debug("Container pid: ", node.MgmtIPv4) return nil } diff --git a/src/main.go b/src/main.go index b4397526a..87ad57df4 100644 --- a/src/main.go +++ b/src/main.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + log "github.com/sirupsen/logrus" "github.com/spf13/pflag" @@ -88,6 +90,11 @@ func main() { } } + //show management ip addresses per Node + for dutName, node := range Nodes { + log.Info(fmt.Sprintf("Mgmt IP addresses of container: %s, IPv4: %s, IPv6: %s, MAC: %s", dutName, node.MgmtIPv4, node.MgmtIPv6, node.MgmtMac)) + } + case "destroy": log.Info("Destroying container lab: ... ", topo) // delete containers