Skip to content

Commit

Permalink
bring back templates
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 30, 2021
1 parent e8425b7 commit e88a5e7
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 28 deletions.
38 changes: 21 additions & 17 deletions lab-examples/vr05/sros4.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,47 @@ topology:
defaults:
kind: vr-sros
image: registry.srlinux.dev/pub/vr-sros:21.2.R1
license: /home/kellerza/license/license-sros21.txt
license: license-sros21.txt
labels:
isis_iid: 0
nodes:
sr1:
labels:
systemip: 10.0.50.31/32
sid_idx: 1
config:
vars:
systemip: 10.0.50.31/32
sid_idx: 1
sr2:
labels:
systemip: 10.0.50.32/32
sid_idx: 2
config:
vars:
systemip: 10.0.50.32/32
sid_idx: 2
sr3:
labels:
systemip: 10.0.50.33/32
sid_idx: 3
config:
vars:
systemip: 10.0.50.33/32
sid_idx: 3
sr4:
labels:
systemip: 10.0.50.34/32
sid_idx: 4
config:
vars:
systemip: 10.0.50.34/32
sid_idx: 4
links:
- endpoints: [sr1:eth1, sr2:eth2]
labels:
vars:
port: 1/1/c1/1, 1/1/c2/1
ip: 1.1.1.2/30
vlan: "99,99"
isis_iid: 0
- endpoints: [sr2:eth1, sr3:eth2]
labels:
vars:
port: 1/1/c1/1, 1/1/c2/1
vlan: 98
isis_iid: 0
- endpoints: [sr3:eth1, sr4:eth2]
labels:
vars:
port: 1/1/c1/1, 1/1/c2/1
isis_iid: 0
- endpoints: [sr4:eth1, sr1:eth2]
labels:
vars:
port: 1/1/c1/1, 1/1/c2/1
isis_iid: 0
24 changes: 13 additions & 11 deletions lab-examples/vr05/vr01.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@ topology:
srl:
kind: srl
image: registry.srlinux.dev/pub/srlinux:21.3.1-410
license: /home/kellerza/license/srl21.key
labels:
systemip: 10.0.50.50/32
isis_iid: 0
sid_idx: 11
license: license.key
config:
vars:
systemip: 10.0.50.50/32
isis_iid: 0
sid_idx: 11
sros:
kind: vr-sros
image: registry.srlinux.dev/pub/vr-sros:21.2.R1
type: sr-1
license: /home/kellerza/license/license-sros21.txt
labels:
systemip: 10.0.50.51/32
sid_idx: 10
isis_iid: 0
license: license-sros21.txt
config:
vars:
systemip: 10.0.50.51/32
sid_idx: 10
isis_iid: 0

links:
- endpoints: ["srl:e1-1", "sros:eth1"]
labels:
vars:
port: ethernet-1/1, 1/1/c1/1
vlan: 10
isis_iid: 0
75 changes: 75 additions & 0 deletions templates/base__srl.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{{ expect .systemip "ip" }}
{{ optional .isis_iid "0-31" }}
{{ range .links }}
{{ expect .port "^(ethernet-\\d+/|e\\d+-)\\d+$" }}
{{ expect .name "string" }}
{{ expect .ip "ip" }}
{{ optional .vlan "0-4095" }}
{{ optional .metric "1-10000" }}
{{ end }}

/interface lo0 {
admin-state enable
subinterface 0 {
ipv4 {
address {{ .systemip }} {
}
}
ipv6 {
address ::ffff:{{ ip .systemip }}/128 {
}
}
}
}

/network-instance default {
router-id {{ ip .systemip }}
interface lo0.0 {
}
protocols {
isis {
instance default {
admin-state enable
level-capability L2
set level 2 metric-style wide
# net should not be multiline (net [), becasue of the SRL ... prompt
net [ 49.0000.0000.0000.0{{ default 0 .isis_iid }} ]
interface lo0.0 {
}
}
}
}
}

/system lldp admin-state enable


{{ range .links }}
/interface {{ .port }} {
admin-state enable
vlan-tagging true
subinterface {{ default 10 .vlan }} {
set vlan encap single-tagged vlan-id {{ default 10 .vlan }}
set ipv4 address {{ .ip }}
set ipv6 address ::FFFF:{{ ip .ip }}/127
}
}

/network-instance default {
interface {{ .port }}.{{ default 10 .vlan }} {
}
protocols {
isis {
instance default {
interface {{ .port }}.{{ default 10 .vlan }} {
circuit-type point-to-point
level 2 {
metric {{ default 10 .metric }}
}
}
}
}
}
}

{{ end }}
Empty file added templates/base__vr-sros.tmpl
Empty file.
32 changes: 32 additions & 0 deletions templates/srl-ifaces__srl.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ expect .systemip "ip" }}
{{ range .links }}
{{ expect .port "^(ethernet-\\d+/|e\\d+-)\\d+$" }}
{{ expect .name "string" }}
{{ end }}
/interface lo0 {
admin-state enable
subinterface 0 {
ipv4 {
address {{ .systemip }} {
}
}
ipv6 {
address ::c1ab:{{ ip .systemip }}/128 {
}
}
}
}
/network-instance default {
router-id {{ ip .systemip }}
interface lo0.0 {
}
}
/system lldp admin-state enable
/ network-instance mgmt {
description "set from clab"
}
{{ range .links }}
/interface {{ .port }} {
admin-state enable
}
{{ end }}

0 comments on commit e88a5e7

Please sign in to comment.